OpenCv code to open and save image from webcam:
def webcam(request):
camera = cv2.VideoCapture(0)
while True:
return_value,image = camera.read()
cv2.imshow('image',image)
if cv2.waitKey(1) & 0xFF == ord('s'):
cv2.imwrite('./media/test.jpg',image)
break
camera.release()
cv2.destroyAllWindows()
return render(request,'page.html')
This is a function from a django project. It is being called when pressing an Html button and it turns on the webcam. It opens it on a popup python window though. Does anyone know if and how could I integrate that window to open into the same or different Html page? Meaning, when I press the button instead of opening outside the webpage, I need to open the can in the Html page itself.
Thanks for any help in advance.