Intel® Integrated Performance Primitives
Deliberate problems developing high-performance vision, signal, security, and storage applications.

ippiHistogramEven_8u_C3R

hadipardis
Beginner
630 Views

Hi, I use the following Delphi code for calculating the histogram (with 255 bins) of an image using ippiHistogramEven_8u_C3R.

-------------------------

var

LowerLevel,UpperLevel,nLevels:array[0..2] of IPP32s;
pHist,pLevels:array[0..2] of array[0..255] of IPP32s;
begin

LowerLevel[0]:=0;
LowerLevel[1]:=0;
LowerLevel[2]:=0;

UpperLevel[0]:=255;
UpperLevel[1]:=255;
UpperLevel[2]:=255;

nLevels[0]:=256;
nLevels[1]:=256;
nLevels[2]:=256;


.....

ippiHistogramEven_8u_C3R(pSrc,scanline,roisize,@pHist,@pLevels,@nlevels,@LowerLevel,@UpperLevel);

end;

but when I run it I get this message from ippGetStatusString: "Null Pointer Error". But what is the problem? Thanks

0 Kudos
8 Replies
Vladimir_Dudnik
Employee
630 Views

I may guess the problem is that one of the pointers passed to the function as a parameter is NULL.

Vladimir

0 Kudos
hadipardis
Beginner
630 Views
Thanks,But as you can see from my code, there isn't any NULL pointer. Should I use ippimalloc for creating pHist & pLevel? If so, could you please give me an example. Thanks
0 Kudos
Vladimir_Dudnik
Employee
630 Views

Please find an example how to callippiHistogramEven function on the page 11-28 of IPP 5.3 manual, volume 2.

Vladimir

0 Kudos
hadipardis
Beginner
630 Views
I am using IPP v5.2 and in its manual there isn't any example to show how to call ippiHistogramEven on multi-channel images. Could you please putthe relevant example of IPP 5.3 here? Anyway, I am wondering why my mentioned code doesn't work!! What do you think? Thanks
0 Kudos
Vladimir_Dudnik
Employee
630 Views

there is example from IPP 5.3 manual

Example 11-5 Computing the Even Histogram of an Image

// Compute histogram of an image for 4 bins in the range [28, 127];

// compute level values for the bins.

{

Ipp8u img[WIDTH*HEIGHT];

IppiSize imgSize = {WIDTH, HEIGHT};

Ipp32s levels[5], histo[5];

ippiHistogramEven_8u_C1R(img, WIDTH, imgSize, levels,

histo, 5, 28, 128);

// When the function completes operation the array histo will // contain a

histogram in specified range, and the array

// levels will contain the level values {28, 53, 78, 103, 128}

}

Regards,
Vladimir

0 Kudos
hadipardis
Beginner
630 Views

Thanks. But I need an exxample for ippiHistogramEven_8u_C3R. Unfortunately, my problem is still remained! If you show me an example in Delphi, it can help me a lot!

0 Kudos
Vladimir_Dudnik
Employee
630 Views

Please take a look on IPP Delphi sample. Although it does not show you exactly that function, but I think your the main problem is converting memory pointers from Delphi environment to IPP call

Vladimir

0 Kudos
hadipardis
Beginner
630 Views
Thanks Nikolay! Yes, you are right and my problem solved! :)
0 Kudos
Reply