Skip to content
Advertisement

Tag: image-processing

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

Detect white background on images using python

Is there a way to tell whether an image as a white background using python and what could be a good strategy to get a “percentage of confidence” about this question? Seems like the literature on internet doesn’t cover exactly this case and I can’t find anything strictly related. The images I want to analyze are typical e-commerce website product

Advertisement