From e233f7d199e5785dfc0743cd27766adbf500d438 Mon Sep 17 00:00:00 2001 From: berak Date: Sun, 10 Jul 2016 11:17:00 +0200 Subject: [PATCH] py_tutorials: fix cv2.findContours return val --- .../py_contour_features/py_contour_features.markdown | 2 +- .../py_contours_more_functions.markdown | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/doc/py_tutorials/py_imgproc/py_contours/py_contour_features/py_contour_features.markdown b/doc/py_tutorials/py_imgproc/py_contours/py_contour_features/py_contour_features.markdown index 06ac8e4a5..237725ea4 100644 --- a/doc/py_tutorials/py_imgproc/py_contours/py_contour_features/py_contour_features.markdown +++ b/doc/py_tutorials/py_imgproc/py_contours/py_contour_features/py_contour_features.markdown @@ -23,7 +23,7 @@ import numpy as np img = cv2.imread('star.jpg',0) ret,thresh = cv2.threshold(img,127,255,0) -contours,hierarchy = cv2.findContours(thresh, 1, 2) +im2,contours,hierarchy = cv2.findContours(thresh, 1, 2) cnt = contours[0] M = cv2.moments(cnt) diff --git a/doc/py_tutorials/py_imgproc/py_contours/py_contours_more_functions/py_contours_more_functions.markdown b/doc/py_tutorials/py_imgproc/py_contours/py_contours_more_functions/py_contours_more_functions.markdown index 66ab00613..2a96cb0ea 100644 --- a/doc/py_tutorials/py_imgproc/py_contours/py_contours_more_functions/py_contours_more_functions.markdown +++ b/doc/py_tutorials/py_imgproc/py_contours/py_contours_more_functions/py_contours_more_functions.markdown @@ -38,8 +38,8 @@ import numpy as np img = cv2.imread('star.jpg') img_gray = cv2.cvtColor(img,cv2.COLOR_BGR2GRAY) -ret, thresh = cv2.threshold(img_gray, 127, 255,0) -contours,hierarchy = cv2.findContours(thresh,2,1) +ret,thresh = cv2.threshold(img_gray, 127, 255,0) +im2,contours,hierarchy = cv2.findContours(thresh,2,1) cnt = contours[0] hull = cv2.convexHull(cnt,returnPoints = False) @@ -93,9 +93,9 @@ img2 = cv2.imread('star2.jpg',0) ret, thresh = cv2.threshold(img1, 127, 255,0) ret, thresh2 = cv2.threshold(img2, 127, 255,0) -contours,hierarchy = cv2.findContours(thresh,2,1) +im2,contours,hierarchy = cv2.findContours(thresh,2,1) cnt1 = contours[0] -contours,hierarchy = cv2.findContours(thresh2,2,1) +im2,contours,hierarchy = cv2.findContours(thresh2,2,1) cnt2 = contours[0] ret = cv2.matchShapes(cnt1,cnt2,1,0.0)