Is constantly calling cv2.VideoCapture(link, 0) creating new objects in memory?

Viewed 27

I have an application that from time to time crashes. This app is connected to an AXIS camera. The goal of the app is to capture frames, process them for object detection and send the results to a server. Here is the thing after a random period of time there is a RTSP session timeout. After some digging, it came to my mind that the cv2.VideoCapture might be the problem. I never release the object. Since the app needs to constantly capture frames I'm constantly calling the following command:

image = cv2.VideoCapture(link, 0)

where "link" is the ip address of the camera in RTSP protocol. So I have the following question: what are the chances that the cv2.Videocapture(link,0) is creating in background several objects that that are having conflicts with each other and the camera drops the connection? I don't use image.read() because the frames are in a buffer and the processing is done on past frames instead of the instantaneous frame.

0 Answers
Related