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

Histogram function problem

Isaac_D_
Beginner
364 Views

Hi,

I want to make a code in C++ using Intel libraries (specially IPP) of a MATLAB function, I was wondering if I can do it, because it seems simple but I'm trying and no have results using the histograms functions or a combination of simple functions. Here it is:

[I_hist, pos] = hist(I(:),vminI:(vmaxI-vminI)/99:vmaxI);

I is a 257 vector long (double type)

The vminI and vminI came from the maximum and minimum value of I which is easy to obtain using ippsMax and ippsMin, my real problem is making the vector I_hist (100 elements long, double type). I tried making first the range using VectorSlope (which by the way equals to the pos vector) and then CountInRange but this last one is only for Ipp32f data type and I need double. Maybe the answer is for that way. I hope you can help me. Thanks for your time.

Regards.

0 Kudos
4 Replies
Chao_Y_Intel
Moderator
364 Views

Hello, 

Most of the IPP image related functions are only support 32 bit float point. Is the double precision really needed in the code. If not, it may convert to 32 bit float point for computation.

Thanks,
Chao

0 Kudos
Igor_A_Intel
Employee
364 Views

hi Isaac,

you can use ippiHistogramRange_32f and define your set of levels or, if you need equal bins - you can use ippiHistogramEven_32f. And as Chao has mentioned above - you always can use conversion 32f<->64 routines.

regards, Igor

0 Kudos
Isaac_D_
Beginner
364 Views

Hi again,

Unfortunately the code need the double precision type because most of the values within I are like 0.000991984 or 0.000292276. Converting 32f<>64f will make the code inaccurate. Is there any other possible solution using IPP libraries or another one from Intel?

Regards.

0 Kudos
Isaac_D_
Beginner
364 Views

Hi again,

Unfortunately the code need the double precision type because most of the values within I are like 0.000991984 or 0.000292276. Converting 32f<>64f will make the code inaccurate. Is there any other possible solution using IPP libraries or another one from Intel?

Regards.

0 Kudos
Reply