Update findContours parameter type
This commit is contained in:
+1
-1
@@ -16,7 +16,7 @@ def thresh_callback(val):
|
||||
|
||||
## [findContours]
|
||||
# Find contours
|
||||
_, contours, _ = cv.findContours(canny_output, cv.RETR_TREE, cv.CHAIN_APPROX_SIMPLE)
|
||||
contours, _ = cv.findContours(canny_output, cv.RETR_TREE, cv.CHAIN_APPROX_SIMPLE)
|
||||
## [findContours]
|
||||
|
||||
## [allthework]
|
||||
|
||||
+1
-1
@@ -16,7 +16,7 @@ def thresh_callback(val):
|
||||
|
||||
## [findContours]
|
||||
# Find contours
|
||||
_, contours, _ = cv.findContours(canny_output, cv.RETR_TREE, cv.CHAIN_APPROX_SIMPLE)
|
||||
contours, _ = cv.findContours(canny_output, cv.RETR_TREE, cv.CHAIN_APPROX_SIMPLE)
|
||||
## [findContours]
|
||||
|
||||
# Find the rotated rectangles and ellipses for each contour
|
||||
|
||||
@@ -13,7 +13,7 @@ def thresh_callback(val):
|
||||
canny_output = cv.Canny(src_gray, threshold, threshold * 2)
|
||||
|
||||
# Find contours
|
||||
_, contours, hierarchy = cv.findContours(canny_output, cv.RETR_TREE, cv.CHAIN_APPROX_SIMPLE)
|
||||
contours, hierarchy = cv.findContours(canny_output, cv.RETR_TREE, cv.CHAIN_APPROX_SIMPLE)
|
||||
|
||||
# Draw contours
|
||||
drawing = np.zeros((canny_output.shape[0], canny_output.shape[1], 3), dtype=np.uint8)
|
||||
|
||||
@@ -13,7 +13,7 @@ def thresh_callback(val):
|
||||
canny_output = cv.Canny(src_gray, threshold, threshold * 2)
|
||||
|
||||
# Find contours
|
||||
_, contours, _ = cv.findContours(canny_output, cv.RETR_TREE, cv.CHAIN_APPROX_SIMPLE)
|
||||
contours, _ = cv.findContours(canny_output, cv.RETR_TREE, cv.CHAIN_APPROX_SIMPLE)
|
||||
|
||||
# Find the convex hull object for each contour
|
||||
hull_list = []
|
||||
|
||||
@@ -17,7 +17,7 @@ def thresh_callback(val):
|
||||
|
||||
## [findContours]
|
||||
# Find contours
|
||||
_, contours, _ = cv.findContours(canny_output, cv.RETR_TREE, cv.CHAIN_APPROX_SIMPLE)
|
||||
contours, _ = cv.findContours(canny_output, cv.RETR_TREE, cv.CHAIN_APPROX_SIMPLE)
|
||||
## [findContours]
|
||||
|
||||
# Get the moments
|
||||
|
||||
+1
-1
@@ -21,7 +21,7 @@ for i in range(6):
|
||||
cv.line(src, vert[i], vert[(i+1)%6], ( 255 ), 3)
|
||||
|
||||
# Get the contours
|
||||
_, contours, _ = cv.findContours(src, cv.RETR_TREE, cv.CHAIN_APPROX_SIMPLE)
|
||||
contours, _ = cv.findContours(src, cv.RETR_TREE, cv.CHAIN_APPROX_SIMPLE)
|
||||
|
||||
# Calculate the distances to the contour
|
||||
raw_dist = np.empty(src.shape, dtype=np.float32)
|
||||
|
||||
Reference in New Issue
Block a user