2013-10-22 05:22:13 -0600 | received badge | ● Editor (source) |
2013-10-22 05:21:24 -0600 | asked a question | Initialize the images. Problems with the memory. Hello, I am implementing some methods and i'm using OpenCv functions. I work with many frames of a video and i need to implement the best code to avoid some problems with the memory. I have some doubts: Doubt 1: How would it be better? - Option 1: - Option 2: I think that in option 2, the image1 is created many times(each time the method named picture_sintetica is called) and with the option 1 it will be created only once, but I'm not sure...and in other examples i've seen using the option 2. Doubt 2: Is it equivalent declare the image equal to zero (IplImage* image1 = 0;), to NULL (IplImage* image1 = NULL;) o to put anything (IplImage* image1;)? Doubt 3: When is it recommendable to use the function named cvCloneImage and when is it better to use cvCopy? |