This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

VLIB 3.0.07 Histogram with 32bits precision

Dear all,

I'm using VLIB 3.0.07 histogram function (VLIB_histogram_1D_U8) on DM8148's C674x DSP. 

My test image is grayscale 8bits 800x600 (image size 480KB).

The computed histogram tallies with the public image processing library ImageJ except those values exceeding 64K (due to 16bits data type).

I like to find out if there's any function for 32bits computed histogram?

Or if the source code to the VLIB library is available so that I could generate another function to handle 32bits?

Or what should be a better approach to getting the histogram of image with this dimension?

Thank you

Regards

May

  • May,

    Currently, there is not any function for 32bits computed histogram, and VLIB source is not publicly available. There are a couple options to consider depending on your specific requirements.  As you might have noticed, the VLIB histogram gives users the ability to specify specific bin boundaries, which may or may not be a power of 2, and can be different sizes.  If your application can work with a power of 2 histogram (where the bins are have equal ranges which are on a power of 2 boundaries), then you can use the IMGLIB histogram functions.  They are highly pipelined and perform well.  They also have 16 bit bin containers, but the source is publicly available, so you should be able to alter it for 32 bit bin containers, or right shifting for fewer bins that 256.

    If your application requires the VLIB version and can't use a variant of the IMGLIB version, then you can split your image into slices, and take separate histograms on each slice, either adding the resultant histograms into 32 bit bins, or down-shifting the resultant histograms into smaller values before accumulating.

    In the longer term, I can add your request to the queue of future releases of VLIB.  Out of curiosity, would you require 32-bits per bin for exact pixel accumulation, or would a right shift parameter be sufficient to meet your needs?  The implementation of a right shift parameter would effectively return all the bin sums right shifted by the number specified (a value of 4  would effectively divide each bin by 16 to help larger images fit within 16 bit values).  It may be possible that the right shift option may be better performing and require less memory, which is why I bring it up.

    Regards,

    Jesse

  • Hi Jesse,

    Thank you for responding to my question.

    Currently I had implemented the 2nd method that you mentioned where I sliced up my image and accumulated the histograms into 32bit bins using VLIB.

    As for IMGLIB, previously I was concerned with its optimization for C674x, but a TI staff had helped to clear this concerns. Hence I'll attempt to make a 32bit version using the source code provided in IMGLIB.

    As for the right shifting option, I need to check further as the histogram is used for further image processing work down the pipeline and I'm still unsure if exact pixel accumulation is a must or not.

    Regards

    May