Skip to content
Advertisement

Tag: contour

How contour an image area with known coordinates?

I have an ultrasound image and the coordinates (array of x and y points) of the tumor of each image. How can I make a contour around the tumor with those known coordinates using cv.drawContours()? I wish to delete all the information around the tumor and stay only with the tumor image/information. I am getting this error: error Traceback (most

OpenCV Drawing Contour Error Assertion Failed

So I am trying to follow guide on how to scan a document in https://www.pyimagesearch.com/2014/09/01/build-kick-ass-mobile-document-scanner-just-5-minutes/ exactly on the step 2 process where i am supposed to find the contour and draw it to the image, i got an “Assertion Failed” error on drawContour function The guide did not have screenCnt = None so at first i got Error like screenCnt

How to detect and draw contours using OpenCV in Python?

I wrote the following code to detect and draw contours: And here is the error I received: Traceback (most recent call last): File “C:/Users/R.K.singh/Desktop/Image processing/intro-to-contours.py”, line 10, in contours,hierarchy = cv2.findContours(thresh,cv2.RETR_TREE,cv2.CHAIN_APPROX_SIMPLE); ValueError: too many values to unpack What is wrong? I am using Python 2.7 and OpenCV 3.1.0 Answer In order to emphasize Selchuk’s point, the syntax involving OpenCV 3.x

Python showing an OpenCV Assertion error for finding contours

I was trying to draw contours in an image using Python OpenCV. My code is the following: I am getting an error while compiling this code. The error is the following: How can I avoid this error? Answer The problem should be that cv2.drawContours (and in general all opencv “drawing” functions in python) have output equal to None. Try this

Advertisement