Ask Your Question
0

How to Dispose a PCA instance.

asked 2013-12-16 07:12:06 -0500

MRDaniel gravatar image

I was curious, the PCA class does not implement a dispose/release method, but appears to have the eigenVectors and eigenValues associated with it.

Is there a feature of OpenCV's memory management that handles this?

Regards,

Daniel

edit retag flag offensive close merge delete

Comments

1

i don't think, you'll have to worry about it. if the PCA goes out of scope, eigenVectors/values and mean will clean up on their own ( like any cv::Mat does. )

berak gravatar imageberak ( 2013-12-16 07:22:35 -0500 )edit

Well, i wanted to be sure. I also thought the cv::Mat needed the release() function to be called?

MRDaniel gravatar imageMRDaniel ( 2013-12-16 07:32:09 -0500 )edit

Ok, found it....

"The first thing you need to know about Mat is that you no longer need to manually allocate its memory and release it as soon as you do not need it. While doing this is still a possibility, most of the OpenCV functions will allocate its output data automatically. As a nice bonus if you pass on an already existing Mat object, which has already allocated the required space for the matrix, this will be reused. In other words we use at all times only as much memory as we need to perform the task."

MRDaniel gravatar imageMRDaniel ( 2013-12-16 07:33:21 -0500 )edit

1 answer

Sort by ยป oldest newest most voted
0

answered 2014-01-26 20:52:10 -0500

MRDaniel gravatar image

"The first thing you need to know about Mat is that you no longer need to manually allocate its memory and release it as soon as you do not need it. While doing this is still a possibility, most of the OpenCV functions will allocate its output data automatically. As a nice bonus if you pass on an already existing Mat object, which has already allocated the required space for the matrix, this will be reused. In other words we use at all times only as much memory as we need to perform the task."

edit flag offensive delete link more
Login/Signup to Answer

Question Tools

Stats

Asked: 2013-12-16 07:12:06 -0500

Seen: 195 times

Last updated: Jan 26 '14