I'm just a beginner in java and can't complete my project. I have written the code in python and I need some help to translate it to java. Here is the code:
import cv2
cpt = 0
vidStream = cv2.VideoCapture(0)
while True:
ret, frame = vidStream.read()
cv2.imshow("test window", frame)
cv2.imwrite("train-images/2/image%04i.jpg" % cpt, frame)
cpt += 1
if cv2.waitKey(10)==ord('q'):
break
Thanks for the help.