int main()
{
IplImage* image = cvLoadImage("lena.jpg");
// Create some windows to show the input
// and output images in.
//
cvNamedWindow("Example4-in");
cvNamedWindow( "Example4-out");
// Create a window to show our input image
//
cvShowImage( "Example4-in", image );
// Create an image to hold the smoothed output
//
IplImage* out = cvCreateImage(cvGetSize(image), IPL_DEPTH_8U, 3);
// Do the smoothing
//
cvSmooth( image, out, CV_GAUSSIAN, 3, 3 );
// Show the smoothed image in the output window
//
cvShowImage( "Example4-out", out );
// Be tidy
//
cvReleaseImage(&out);
// Wait for the user to hit a key, then clean up the windows
//
cvWaitKey( 0 );
cvDestroyWindow( "Example4-in");
cvDestroyWindow( "Example4-out");
}
The book said the memory would release by themselve
But how about the pointer?
They didn't point it to 0(null)
And this is not the only example which didn't do that
Would the openCV do this for the users too?
Thanks