python - cv2.CHAIN_APPROX_SIMPLE doesn't simplify the number of contour points for a rectangle -


i'm following this python opencv contour guide. i'm using opencv 2.4.11 installed through brew (osx).

everything appears work, other when do: contours, hierarchy = cv2.findcontours(thresh,cv2.retr_tree,cv2.chain_approx_simple)

i same number of contour coordinate points cv2.chain_approx_none.

so in example of link, still 734 points rather 4.

anyone else experienced this?

nb: (note cv2.findcontours returns contours, hierarchy contrary documentation).

on further investigation, appears happening here many contours being drawn on each other (hiding fact approx_simple in fact working).

notice seeing there same number of contours, number of points in each contour changes (goes down above option).


Comments