Showing results for

- Intel Community
- Software Development SDKs and Libraries
- Intel® Integrated Performance Primitives
- Histogram function problem

- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Mute
- Printer Friendly Page

Highlighted
##

Isaac_D_

Beginner

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content

01-22-2014
02:46 PM

4 Views

Histogram function problem

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.

4 Replies

Highlighted
##

Chao_Y_Intel

Employee

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content

01-22-2014
07:18 PM

4 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

Highlighted
##

Igor_A_Intel

Employee

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content

01-23-2014
02:43 AM

4 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

Highlighted
##

Isaac_D_

Beginner

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content

01-23-2014
05:04 AM

4 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.

Highlighted
##

Isaac_D_

Beginner

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content

01-23-2014
05:04 AM

4 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.

For more complete information about compiler optimizations, see our Optimization Notice.