I have problems with OpenCV, precisely with the following snippet of code:
Code:
char* item;
...
...
printf("Filter started\n");
item = ReadingFrom(...);
printf("The Item: s\n", item);
printf("strlen(item): lu\n", strlen(item));
IplImage* img = cvLoadImage(item, CV_LOAD_IMAGE_COLOR);
printf("img pointer: p\n", img);
IplImage* outimg = cvCreateImage(cvGetSize(img), IPL_DEPTH_8U, 3);
printf("outimg pointer: %p\n", outimg);
cvSmooth(img, outimg, CV_GAUSSIAN, 5, 5, 0, 0);
cvSaveImage("smoothed.jpg", outimg, 0);
cvReleaseImage(&img);
cvReleaseImage(&outimg);
It seems that both cvSmooth and cvSaveImage cause a "Segmentation fault: 11".
I am using a proprietary framework I cannot modify.
The function ReadingFrom() is defined as follows:
Code:
void *ReadingFrom(...) {
void* item;
...
...
return item;
}
The following instructions:
Code:
printf("The Item: s\n", item);
printf("strlen(item): %lu\n", strlen(item));
return the value of the item string and its size.
I suppose there is a problem in item I pass to cvLoadImage.
How can I check exactly what is item?
Saverio