cvGet2D error
i think this two parts of code is independent to each of them.
CvMat *itgMap = cvCreateMat(gray->height + 1,gray->width + 1,CV_32SC1);
for(int> y=0;y<itgmap->height;y++)
for(int> x=0;x<itgmap->width;x++) {>
double pvalue = cvGet2D(gray,y-1,x-1).val[0]; // part1
double itg = cvGet2D(itgMap,y,x-1).val[0]; // part2
....... it makes segmentation fault error
but
for(int y=0;y<itgmap->height;y++)
for(int x=0;x<itgmap->width;x++) {
double pvalue = cvGet2D(gray,y-1,x-1).val[0];
this works ok .. and
for(int y=0;y<itgmap->height;y++)
for(int x=0;x<itgmap->width;x++) {
double itg = cvGet2D(itgMap,y,x-1).val[0];
and it works well too..
only when both codes are enabled at same time, it makes segmentation faults but I can't see any relation of them.. how is it possible?
Both functions are actually related since the use the same pointers x and y to the data. Could you please post the exact error?
this is simple test code for gray image .. I tried it by opencv 2.2 and 2.45 but got same segmentation fault
void testProblem(IplImage *srcImg){ int width = srcImg->width; int height = srcImg->height;
}
I'm sorry.. cuz it's my first time to post question at opencv forum. , I can't post image or correctly boxed source code.