Skip to content

Commit

Permalink
reformatted code for more easily readable
Browse files Browse the repository at this point in the history
  • Loading branch information
slowy07 committed Jul 17, 2021
1 parent ff3b93d commit 7afa3dc
Showing 1 changed file with 9 additions and 8 deletions.
17 changes: 9 additions & 8 deletions Face and eye Recognition/gesture_control.py
Original file line number Diff line number Diff line change
@@ -1,17 +1,18 @@
import cv2 as cv

# import numpy as np

img = cv.imread('..\img\hand1.jpg' , 0)
flag,frame = cv.threshold(img , 70 , 255 , cv.THRESH_BINARY)
img = cv.imread("..\img\hand1.jpg", 0)
flag, frame = cv.threshold(img, 70, 255, cv.THRESH_BINARY)

contor,_ = cv.findContours(frame.copy(),cv.RETR_TREE,cv.CHAIN_APPROX_SIMPLE)
contor, _ = cv.findContours(frame.copy(), cv.RETR_TREE, cv.CHAIN_APPROX_SIMPLE)

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

final = cv.drawContours(img , hull , -1 , (0 , 0 , 0) )
cv.imshow('original_image' , img)
cv.imshow('thres' , frame)
cv.imshow('final_hsv' , final)
final = cv.drawContours(img, hull, -1, (0, 0, 0))
cv.imshow("original_image", img)
cv.imshow("thres", frame)
cv.imshow("final_hsv", final)

cv.waitKey(0)
cv.destroyAllWindows()
cv.destroyAllWindows()

0 comments on commit 7afa3dc

Please sign in to comment.