Community
cancel
Showing results for 
Search instead for 
Did you mean: 
peter03436
Beginner
135 Views

IPP Histogram image size limitation (seg fault)

I'm running ippiHistogramEven_8u_C1R on images of various sizes (Code Below). When I try images greater than 1000 x 1000 pixels, this routine crashes with Segmentation Fault. Is this a known limitation/problem or am I doing something drastically wrong? Any help would be greatly appreciated. I'd like to profile this function up to images of 3000 x 3000 pixels.

void ippHist(IplImage * pic)
{
int i;
IppiSize imgSize = {image->width,image->height};
Ipp32s levels[256],histo[256];

ippiHistogramEven_8u_C1R(pic,image->width,imgSize,levels,histo,256,0,255);
}
0 Kudos
6 Replies
Rob_Ottenhoff
New Contributor I
135 Views

Hi Peter,

You could try the following:

At least you have to use the widthStep and the width of the image.

void ippHist(IplImage * pic)
{
int i;
IppiSize imgSize = {pic->width, pic->height};
Ipp32s levels[256],histo[256];

ippiHistogramEven_8u_C1R(pic->imageData, pic->widthStep ,imgSize,levels,histo,256,0,255);
}

Hope this helps.

Rob
peter03436
Beginner
135 Views

Although that would be more technically correct, I don't think it will solve the problem. image is the global variable that is passed into that function so pic->width and image-> width are the same thing. Thanks for trying though, so far I havn't seen much guidance on this.

Rob_Ottenhoff
New Contributor I
135 Views

Ok. But make sure you use the widthStep and not the width. This will cause memory trouble if your image width is not a multiple of 32.
peter03436
Beginner
135 Views

I made the changes just to see, but it didn't change the performance. It works fine up to 1000x1000 pixels. BTW, I have a 64 bit system not 32. So i'm still stuck.
Vladimir_Dudnik
Employee
135 Views

Do you mean it work not so fast or you still have crash on 3kx3k image?

What version of IPP do you use and what is your linkage model (do you use IPP as dynamic or static libraries)?

Regards,
Vladimir

peter03436
Beginner
135 Views

It still crashes with a seg fault on any image larger than 1000 x 1000.
I'm using IPP 5.3.1.062 dynamic linking on a 64 bit linux system.
Reply