Quote Originally Posted by metamofia View Post
Hi, im doing histogram equalization as my final year project. as for now i need to come up with just the histogram for the image i will be opening. im using mfc and have done a few codes to my project. the recent update was me writing the codes to calculate every pixel's value within the image. so what i want to know now is how do i draw the histogram, ie the values of the intensity corresponding to the total pixel numbers.
Calculating every pixel's intensity is only the first step. Next you have to generate the actual histogram table and I believe you were already shown how to do that in another thread.

The histogram table should have 256 elements according to your x axis - and assuming 8-bit greyscale. Those 256 values will represent the x-array values and each value contained in the 256 elements (bins in histogram terminology) will represet the y values.

You will use the histogram table to generate a BAR CHART. For each of the 256 elements in the array you start at the x-axis and draw a vertical line up to the point that represents the pixel count in the bin. Of course there are going to be scaling issues to deal with - especially after you have done the equalization - so your y-axis range will need to be changed.