Skip to content

Commit 7afa3dc

Browse files
committed
reformatted code for more easily readable
1 parent ff3b93d commit 7afa3dc

File tree

1 file changed

+9
-8
lines changed

1 file changed

+9
-8
lines changed
+9-8
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,18 @@
11
import cv2 as cv
2+
23
# import numpy as np
34

4-
img = cv.imread('..\img\hand1.jpg' , 0)
5-
flag,frame = cv.threshold(img , 70 , 255 , cv.THRESH_BINARY)
5+
img = cv.imread("..\img\hand1.jpg", 0)
6+
flag, frame = cv.threshold(img, 70, 255, cv.THRESH_BINARY)
67

7-
contor,_ = cv.findContours(frame.copy(),cv.RETR_TREE,cv.CHAIN_APPROX_SIMPLE)
8+
contor, _ = cv.findContours(frame.copy(), cv.RETR_TREE, cv.CHAIN_APPROX_SIMPLE)
89

910
hull = [cv.convexHull(c) for c in contor]
1011

11-
final = cv.drawContours(img , hull , -1 , (0 , 0 , 0) )
12-
cv.imshow('original_image' , img)
13-
cv.imshow('thres' , frame)
14-
cv.imshow('final_hsv' , final)
12+
final = cv.drawContours(img, hull, -1, (0, 0, 0))
13+
cv.imshow("original_image", img)
14+
cv.imshow("thres", frame)
15+
cv.imshow("final_hsv", final)
1516

1617
cv.waitKey(0)
17-
cv.destroyAllWindows()
18+
cv.destroyAllWindows()

0 commit comments

Comments
 (0)