Pass in a reference to the pointer. At the moment, you're passing the pointer by value, which means that when you change that pointer here:
dst = cvCreateImage(s,8,1)
you're changing a local copy of the pointer, which gets destroyed when the function ends, and the original pointer is untouched.
I'm new to OpenCV, I had to look up the documentation on these function to even know what they were.
Would something like
*dst = *(cvCreateImage(s,8,1))
Work?
You can either use a pointer to pointer or a reference to pointer.
For example
void imagething( IplImage *src, IplImage **dst )
{
CvSize s;
s.width =100;
s.height =100;
*dst = cvCreateImage(s,8,1)
cvResize( src, *dst )
}
Last edited on