Ask Your Question

Maren's profile - activity

2018-08-07 03:42:54 -0600 received badge  Enthusiast
2018-07-06 07:47:34 -0600 received badge  Student (source)
2018-07-06 07:37:06 -0600 commented answer isContourConvex always returns "False"?

Oh I see, thank you! :) Will all images give the result "False" then because of pixelation? And is it any other method I

2018-07-06 07:21:50 -0600 marked best answer isContourConvex always returns "False"?

I have tried to use cv2.isContourConvex on several different shapes, but I get "False" all the time. I think I might have misunderstood how cv2.isContourConvex is working. Can anyone help?

Here is how I have tried to use it on the image below (which should be convex, right?):

img = cv2.imread('convex.png')

img_gray=cv2.cvtColor(img,cv2.COLOR_BGR2GRAY)
ret, thresh = cv2.threshold(img_gray,0,255,cv2.THRESH_BINARY+cv2.THRESH_OTSU)
image,contours, hierarchy = cv2.findContours(thresh,cv2.RETR_TREE,cv2.CHAIN_APPROX_NONE)
cnt = contours[0]

print cv2.isContourConvex(cnt)

image description

2018-07-06 07:21:50 -0600 received badge  Scholar (source)
2018-07-06 07:06:25 -0600 edited question isContourConvex always returns "False"?

isContourConvex always returns "False" I have tried to use cv2.isContourConvex on several different shapes, but I get "F

2018-07-06 07:06:10 -0600 edited question isContourConvex always returns "False"?

Problems with isContourConvex I have tried to use cv2.isContourConvex on several different shapes, but I get "False" all

2018-07-06 06:54:15 -0600 asked a question isContourConvex always returns "False"?

Problems with isContourConvex I have tried to use cv2.isContourConvex on several different shapes, but I get "False" all