Quantcast
Channel: OpenCV Q&A Forum - RSS feed
Viewing all articles
Browse latest Browse all 41027

findContours Exception

$
0
0
Hi, I just have simple code to find the contours in an image : vector >cont; frame = imread("hw.jpg"); cvtColor(frame, frame_gray, COLOR_BGR2GRAY); background = imread("background.jpg"); //convert background to grayscale cvtColor(background, background_gray, COLOR_BGR2GRAY); //perform frame differencing absdiff(background_gray, frame_gray, DifferenceImage); //obtain threshold image threshold(DifferenceImage, ThresholdImage, 45, 255, THRESH_BINARY); //blur image blur(ThresholdImage, BlurImage, Size(40, 40)); threshold(BlurImage, ThresholdImage2, 45, 255, THRESH_BINARY); findContours(ThresholdImage2, cont, CV_RETR_EXTERNAL, CV_CHAIN_APPROX_NONE); imshow("Capture", frame); imshow("Threshold Image", ThresholdImage2); cvWaitKey(50); I get the exception "Unhandled exception at 0x6F04C3A2 (ucrtbase.dll). An invalid parameter was passed to a function that considers invalid parameters fatal." What's wrong ? Thanks

Viewing all articles
Browse latest Browse all 41027