Most frequent pixel intensity

Is it possible to calculate the most frequent pixel intensity of the image?
More precise: given the fact that the background of the image is the biggest area, by calculating this value one could individually (i.e. per image) estimate the background.
Is that possible by any chance?


Hi Dominik,

By your question, I’m assuming that you’re attempting to identify objects in an image, correct?

Most of the automatic thresholding algorithms employed by IdentifyPrimAutomatic employ some model of the image histogram. The histogram is basically a function describing the frequency of each pixel intensity, which is what you’re looking for.

Each method does this differently, and does it on a per-image basis (unless you specify ‘All’). If your background is very large, you might want to try Background or RobustBackground.

Have you given these methods a try and found that they’re not working for you? If I’ve misunderstood what you’re looking for, please correct me.


Hi Mark,

there is no problem about the segmentation, we are using the RidlerClavardAdaptive algorithm.
The source for illumination in our trials is a mercury arc lamp resulting in varying illumination intensity.
What we want to do: calculate differences in background values in order to quantify different illumination intensities in different images.
As a next step, we want to even all the images of a series in order to guarantee virtual similar illumination intensity.




In that case, it appears that the CorrectIllumination_Calculate module may be in order; it produces an illumination function from an image (or set of images). This function can then be applied with CorrectIllumination_Apply on a image-by-image basis.

CorrectIllumination_Calculate is one of our more complex modules, so check out the help to see if fits your needs and let us know if something doesn’t make sense.