Opened 15 years ago

Last modified 14 years ago

#24594 closed defect

OpenCV 2.0 - HoughLinesP memory allocation — at Version 1

Reported by: nicola.conci@… Owned by: stante@…
Priority: Normal Milestone:
Component: ports Version: 1.8.2
Keywords: Cc:
Port: OpenCV

Description (last modified by jmroot (Joshua Root))

hi, I tried running the HoughLinesP function on a video, to check consistency of lines over successive frames. I guess there is something wrong with the allocation/deallocation though, since running it several times you notice the memory increases until the computer slows down.

if I comment the HoughLinesP function, everything runs smoothly.

That's a sample of the code (myFrame and edges are 320x240):

int	blockSize=8;

for (int c=1;c<300;c++) {
	 	
		cap >> myFrame;

		cvtColor(myFrame, edges, CV_RGB2GRAY, 0);
		
		Canny(edges, edges, 80, 120, 3, false);

		for (int k=0;k<(edges.rows-blockSize);k+=blockSize-1) {
			for (int l=0;l<(edges.cols-blockSize);l+=blockSize-1) {				
				vector<Vec4i> lines;
				Mat blockEdge(edges,Rect(l,k,blockSize,blockSize));
				Mat blockOrig(myFrame,Rect(l,k,blockSize,blockSize));				
				//APPLY HOUGH
				HoughLinesP(blockEdge, lines, 1, CV_PI/90, 5, 4, 10 );
				
				blockEdge.release();
				blockOrig.release();

			
			}
		}
		
		waitKey(10);
		printf("Frame n: %d", c);
		
	}

Thanks, Nicola

Change History (1)

comment:1 Changed 15 years ago by jmroot (Joshua Root)

Description: modified (diff)
Owner: changed from macports-tickets@… to stante@…
Port: OpenCV added

Please remember to fill in the Port field and cc the maintainer.

Note: See TracTickets for help on using tickets.