I am busy working on some very simple vehicle detection software using Python and OpenCV. I want to take a screen capture on the moment an object hits the line
I have created.
Searching on Google resulted in nothing or some very big C++ projects. Since I am very unskilled with C++ I tought I would try to ask it here.
My code:
import cv2
face_cascade = cv2.CascadeClassifier('cars.xml')
vc = cv2.VideoCapture('dataset/traffic3.mp4')
if vc.isOpened():
rval , frame = vc.read()
else:
rval = False
while rval:
rval, frame = vc.read()
cv2.line(frame, (430, 830), (430, 100),(0,255,0), 3)
cv2.line(frame, (700, 700), (700, 100),(0,0,255), 3)
cv2.imshow("Result",frame)
cv2.waitKey(1);
vc.release()
So I want to take a screencapture the moment a vehicle passes on of the 2 lines?
Can somebody help me? Thanks.