Update findContours parameter type
This commit is contained in:
@@ -10,8 +10,8 @@ class shape_test(NewOpenCVTests):
|
||||
a = self.get_sample('samples/data/shape_sample/1.png', cv.IMREAD_GRAYSCALE)
|
||||
b = self.get_sample('samples/data/shape_sample/2.png', cv.IMREAD_GRAYSCALE)
|
||||
|
||||
_, ca, _ = cv.findContours(a, cv.RETR_CCOMP, cv.CHAIN_APPROX_TC89_KCOS)
|
||||
_, cb, _ = cv.findContours(b, cv.RETR_CCOMP, cv.CHAIN_APPROX_TC89_KCOS)
|
||||
ca, _ = cv.findContours(a, cv.RETR_CCOMP, cv.CHAIN_APPROX_TC89_KCOS)
|
||||
cb, _ = cv.findContours(b, cv.RETR_CCOMP, cv.CHAIN_APPROX_TC89_KCOS)
|
||||
|
||||
hd = cv.createHausdorffDistanceExtractor()
|
||||
sd = cv.createShapeContextDistanceExtractor()
|
||||
|
||||
@@ -31,7 +31,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)
|
||||
|
||||
Reference in New Issue
Block a user