3 채널 cv :: Mat (RGB 480x640 폭)이 있는데이 그림의 윤곽을 찾고 싶습니다. 나는 다른 예 시도 :OpenCV cv :: findcontours StackOverflow 예외
cv::findContours(contourOutput, contours, CV_RETR_LIST, CV_CHAIN_APPROX_NONE);
또는
cv::findContours(image, contours, hierarchy, CV_RETR_TREE, CV_CHAIN_APPROX_SIMPLE, cv::Point(0, 0));
나는 이력서의 크기에 주목 :: 매트 : This one This one 하지만를 내가 라인에서 유래 오류가 발생 때마다 관련된 채널 수와 관련이 있습니다. 내가 뭘해야할지 모르겠다. 몇 가지 작업을 수행 한 후, 내 코드는이 코드이며 findcontours에서 항상 스택 오버플로가 발생합니다.
cv::Mat src_gray;
cv::Mat dst;
cv::Mat canny_output;
std::vector<std::vector<cv::Point> > contours;
std::vector<cv::Vec4i> hierarchy;
cvtColor(src, src_gray, CV_BGR2GRAY);
int threshold_value = 0;
int threshold_type = 3;
int max_BINARY_value = 4;
threshold(src_gray, dst, threshold_value, max_BINARY_value, threshold_type);
/// Detect edges using canny
Canny(dst, canny_output, 100, 100 * 2, 3);
/// Find contours
findContours(canny_output, contours, hierarchy, CV_RETR_TREE, CV_CHAIN_APPROX_SIMPLE, cv::Point(0, 0));
은 내가 구하는 것은 : 'System.StackOverflowException'형식의 처리되지 않은 예외 findContours()
에 입력이 단일 채널 영상 있어야 xxx.exe이며
당신의 Canny는 입력으로 rgb src 이미지를 여전히 사용하고 있으며 임계 값은 아무 곳에도 없습니다 (dst는 사용되지 않습니다) – berak
그래, 고쳐 봤지만, 여전히 작동하지 않습니다. – user3661328
정확한 오류가 아직 없습니다. – berak