Quantcast
Channel: Intel® Software - Intel® Integrated Performance Primitives
Viewing all articles
Browse latest Browse all 1489

pLevels of ippiHistogramEven_8u_C1R

$
0
0

Hello, I am wondering how do they calculate the pLevels in ippiHistogramEven_8u_C1R function? More specifically, if the lower level is 0, upper level is 255 and nLevels is 13, the returned pLevels of the function would be looked like this: { 0,22,44,66,87,108,129,150,171,192,213,234,255}

Now, for some reasons I need to reproduce the exact same sequence, I've tried some rounding methods such as round, floor and ceil, and so far still couldn't make it work.

Can anyone kindly tell me what method or equation do I need to use in order to get the same pLevels ??

Below is an example that I used to calculate pLevels (using round method):

   int nBins = nLevels-1;

   float binSize = (float)(upperLevel - lowerLevel) / (float)(nBins);

   for(int i=0; i<nLevels; ++i)

   {      

      float level = (float)i * binSize;

      if(level > 0)

      {

         level = floor(level + 0.5);

      }

      else

      {

         level = ceil(level - 0.5);

      }

      pLevels[i] = lowerLevel + (Ipp32s)level;

   }

And the result I get is

{0,21,43,64,85,106,128,149,170,191,213,234,255}

Any suggestions would be appreciated!


Viewing all articles
Browse latest Browse all 1489

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>