Detects pupil of the eye from the images/video and create a circle around it.
cv2.GaussianBlur
with kernel size (9, 9) to remove noise to an extentcv2.medianBlur
to reduce the noise furthercv2.findContours
to find all the contours visible after thresholding and select the largest contour out of them only, as it is the pupil.x
,y
,w
,h
from the cv2.boundingRect
.cv2.circle
cv2.VideoCapture
read()
cv2.findContours
, get the x
,y
,w
,h
from the cv2.boundingRect
cv2.circle
NOTE
: use cap.set(cv2.CAP_PROP_POS_FRAMES, 0)
to loop back the video from beginning otherwise, it will throw error as there is no frame to capture.
NOTE
: At the end release()
the video file.