Ask Your Question
1

videocapture read constantly increased memory usage

asked 2015-10-12 07:33:39 -0600

mullet904 gravatar image

updated 2015-10-19 06:49:38 -0600

LBerger gravatar image

Acquiring a jpeg from a IP camera, the following while statement causes unrestricted increase in memory with each iteration. Replacing the .read with .grab and .retrieve does not change the behaviour.

--cv:videocapture memory leak (bug #1481) was found while researching this problem and seems to address my problem however, I can;t seem to get an OpenCV version that doesn't continue to have my problem.

---the following command reveals the OpenCV version $ pkg-config --modversion opencv 3.0.0

---the following produced the memory leak.

while(1)
{
      cv::Mat a;
      Cam3.open("http://"My URL"/image/jpeg.cgi");
      Cam3.read(a)
      cv::imshow("Window", a);
      cv::waitKey(1);
      Cam3.release();
       a.release();
 }

Any help would be appreciated.

jim

edit retag flag offensive close merge delete

Comments

LorenaGdL gravatar imageLorenaGdL ( 2015-10-12 10:04:45 -0600 )edit

1 answer

Sort by ยป oldest newest most voted
0

answered 2015-10-19 05:46:53 -0600

mullet904 gravatar image

As this apparently is an unresolved issue, I made a work around using curl to grab the image then converted it to cv::Mat for use with opencv.

No memory problems, good speed.

edit flag offensive delete link more

Comments

Do you think this would be a problem reading frames from a MP4 file, or does it just occur if you're reading frames from a device?

medloh gravatar imagemedloh ( 2015-10-19 13:08:19 -0600 )edit

Question Tools

1 follower

Stats

Asked: 2015-10-12 07:33:39 -0600

Seen: 1,031 times

Last updated: Oct 19 '15