I am trying to build a mediaPlayer using Python (LIB: wxPython, Mplayer, MplayerCtrl, OpenCV). I am using openCV to give a no look Pause feature.
Real Time pace detection is running on a infinite loop and in Mplayerctrl Pause serves as Both Pause and Unpause button. and also the playback timer and playback slider is not working . If anyone could help.
def on_special(self,event):
cap = cv2.VideoCapture(0)
flag=True
while flag:
ret, img = cap.read()
faces = face_cascade.detectMultiScale(img, 1.3, 5)
for (x,y,w,h) in faces:
cv2.rectangle(img,(x,y),((x+w),(y+h)),(255,0,0),2)
faces1=faces
roi_color = img[y:y+h, x:x+w]
'''eyes = eye_cascade.detectMultiScale(roi_gray)
#Draw rectangle along eyes
for (ex,ey,ew,eh) in eyes:
cv2.rectangle(roi_color,(ex,ey),(ex+ew,ey+eh),(0,255,0),2)'''
cv2.imshow('img',img)
self.mplayer.Pause()
k = cv2.waitKey(30) & 0xff
if k == 27:
break
cap.release()
What I have tried:
i am having problem with the pause function.. As an infinite loop is running and the Pause() handles the function 2 ways (Pause and Unpause)...
So if anyone could see :)