I am trying to make a dip::EuclideanSkeleton
. However, when executed, it throws me an Unhandled exception. Is it a mismatch between the return type and the type passed to the function? If so, how can I fix this? I have no more guesses. Without dip::EuclideanSkeleton
the program works.
#include <iostream>
#include <opencv2/core/core.hpp>
#include <opencv2/imgproc/imgproc.hpp>
#include <opencv2/highgui/highgui.hpp>
#include <string>
#include "diplib.h"
#include "diplib/file_io.h"
#include "diplib/regions.h"
#include "diplib/display.h"
#include <dip_opencv_interface.h>
#include "diplib/binary.h"
int main() {
cv::Mat img = cv::imread("Cables.jpg", cv::IMREAD_GRAYSCALE);
if (img.empty()) {
return -1;
}
cv::Mat thresh = img.clone();
medianBlur(thresh, thresh, 7);
threshold(thresh, thresh, 127, 255, cv::THRESH_BINARY);
dip::Image image = dip_opencv::MatToDip(thresh);
dip::Image conv = dip::EuclideanSkeleton(image);
cv::Mat final = dip_opencv::DipToMat(conv);
cv::imshow("", final);
cv::waitKey(0);
}
in:
-
dataType_ {dt=UINT8 (1) } dip::DataType
out:
-
dataType_ {dt=SFLOAT (9) } dip::DataType
Unhandled exception at 0x00007FF85A0F3B29 in Skel_endpoints.exe: Microsoft C++ exception: dip::ParameterError at memory location 0x000000BAF730EDD8.