質問編集履歴

1

指摘点の変更、実行を行った結果エラーコードが変わったため更新します

2019/07/08 13:06

投稿

退会済みユーザー
test CHANGED
File without changes
test CHANGED
@@ -20,11 +20,11 @@
20
20
 
21
21
  cont = contourprocess(can_img)
22
22
 
23
- File "hogehoge.py", line 11, in contourprocess
23
+ File "hogehoge.py", line 12, in contourprocess
24
24
 
25
- gray = cv2.cvtColor(img, cv2.COLOR_BGR2GRAY)
25
+ contours, hierarchy = cv2.findContours(gray, cv2.RETR_EXTERNAL, cv2.CHAIN_APPROX_SIMPLE)
26
26
 
27
- cv2.error: OpenCV(3.4.2) c:\miniconda3\conda-bld\opencv-suite_1534379934306\work\modules\imgproc\src\color.hpp:253: error: (-215:Assertion failed) VScn::contains(scn) && VDcn::contains(dcn) && VDepth::contains(depth) in function 'cv::CvtHelper<struct cv::Set<3,4,-1>,struct cv::Set<1,-1,-1>,struct cv::Set<0,2,5>,2>::CvtHelper'
27
+ ValueError: too many values to unpack (expected 2)
28
28
 
29
29
  ```
30
30
 
@@ -72,7 +72,7 @@
72
72
 
73
73
 
74
74
 
75
- can_img = cv2.imread("canny.can_img.png")
75
+ can_img = cv2.imread("canny\can_img.png")
76
76
 
77
77
  cont = contourprocess(can_img)
78
78