Hello.
This might be the wrong way of doing things, but I pass an array from LabView into my C++ function as a simple array of char. I then create an OpenCV image and point the pointer to my data that was passed. At the end of the function I use cvReleaseImage to delete all the OpenCV images, would that remove the data off my original pointer?
also, Would there be a better way of performing an in-place operation which modifies the original image?
EXPORT void smoothImg(uchar * the_img, int size_x, int size_y)
{
CvSize size;
size.height = size_y ;
size.width = size_x;
IplImage * img1 = cvCreateImageHeader(size, IPL_DEPTH_8U, 1);
img1->imageData = (char *)the_img;
img1->imageDataOrigin = img1->imageData;
IplImage * img2 = cvCreateImage(size, IPL_DEPTH_8U, 1);
// this is because I want my end result to be in img1 (same data as my the_img
memcpy(img2->imageData,img1->imageData,sizeof(char)*size_x*size_y);
cvSmooth(img2,img1,CV_BLUR, 5,5);
cvReleaseImage(&img1 );
cvReleaseImage(&img2 );
}
Note: it doesnt seem to affect my images as the results are correct, but I want to make sure this is right before I put it everywhere
Thanks!