Merge pull request #15530 from sturkmen72:update_samples_v4

This commit is contained in:
Alexander Alekhin
2019-09-20 16:41:41 +00:00
3 changed files with 14 additions and 35 deletions
+1 -1
View File
@@ -32,7 +32,7 @@ def find_squares(img):
bin = cv.dilate(bin, None)
else:
_retval, bin = cv.threshold(gray, thrs, 255, cv.THRESH_BINARY)
bin, contours, _hierarchy = cv.findContours(bin, cv.RETR_LIST, cv.CHAIN_APPROX_SIMPLE)
contours, _hierarchy = cv.findContours(bin, cv.RETR_LIST, cv.CHAIN_APPROX_SIMPLE)
for cnt in contours:
cnt_len = cv.arcLength(cnt, True)
cnt = cv.approxPolyDP(cnt, 0.02*cnt_len, True)