@@ -49,11 +49,6 @@ def find_location(self):
4949 # take the features which have only small convexity defects
5050
5151 (cx , cy ) = self ._find_contour_momentum (match_cnt )
52- #blank_image = np.zeros([1000, 1000, 3], np.uint8)
53- #cv2.drawContours(blank_image, [match_cnt], -1, (255, 255, 255), -1)
54- #cv2.drawContours(self.image, [hull], -1, (255, 255, 255), 5)
55- #self.popup_image(255- blank_image, 'cnt1')
56- #self.save_image('C:/Users/rqq82173/PycharmProjects/PuckBarcodeReader/test_' + str(cx) + '.png', 255-blank_image)
5752
5853 feature_orientation = math .atan2 (cy - y , cx - x ) # feature orientation
5954 puck_orientation = feature_orientation - math .pi / 2 # puck orientation shifted -pi/2 rad from feature orientation
@@ -62,10 +57,6 @@ def find_location(self):
6257 uni .set_feature_center (Point (cx , cy ))
6358 uni .set_feature_boarder (match_cnt )
6459
65- #uni.calculate_slot_bounds(uni.center(), uni.radius(), uni.angle())
66- #uni.draw_plate(Image(self.image), Color.White())
67- #self.popup_image(self.image, 'test')
68-
6960 return uni
7061
7162 def _find_puck_contours (self ):
@@ -75,9 +66,6 @@ def _find_puck_contours(self):
7566 cnt = ContoursManager (255 - edged )
7667 cnt .find_all ()
7768
78- # self.popup_image(blurred, 'bl')
79- # self.popup_image(edged, 'ero')
80-
8169 return cnt
8270
8371 def _find_enclosing_circle_of_largest_contour (self ):
@@ -91,14 +79,10 @@ def _find_contours_of_features(self, x, y, rad):
9179
9280 self .unipuck_contours .draw_largest_cnt (blank_image , Color .Black (), - 1 )
9381
94- # self.popup_image(blank_image, 'cn2')
95-
9682 img_open = ImageMorphology (blank_image ).do_open_morph (8 ) # removes some white artifacts
9783 img_open_cnt = ContoursManager (img_open )
9884 img_open_cnt .find_all ()
9985
100- # self.popup_image(img_open, 'morph2')
101-
10286 return img_open_cnt
10387
10488 def _find_feature (self , features_cnt ): # do this better
@@ -135,6 +119,4 @@ def popup_image(self, ima, name):
135119 cv2 .imshow (name , ima )
136120 cv2 .waitKey (0 )
137121 cv2 .destroyAllWindows ()
138- #
139- # def save_image(self, name, img):
140- # cv2.imwrite(name, img)
122+
0 commit comments