Quantcast
Channel: OpenCV Q&A Forum - Latest question feed
Viewing all articles
Browse latest Browse all 19555

Node.js + OpenCV readImage() memory leaks

$
0
0
I have a problem with memory leaks (about 3-4MB each even cycle of this code) on node.js + opencv. I think readImage() method causes that memory issue. How to free unused memory? I've tried release() function, but it causes segmentation error. Is anyone already encountered this problem? Please help. I'm stucked. download = wget.download(src, path + filename, options); download.on('end', function(output) { cv.readImage(path + filename, function(err, im) { if (err) throw err; if (im.width() < 1 || im.height() < 1) throw new Error('Image has no size'); im.detectObject('data/cascade.xml', {}, function(err, cars) { if (err) throw err; for (var i = 0; i < cars.length; i++) { car = cars[i]; im.rectangle([car.x, car.y], [car.width, car.height], [0, 255, 0], 2); } im.save(path + '_' + filename); }); }); });

Viewing all articles
Browse latest Browse all 19555

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>