Discover MakerZone

MATLAB and Simulink resources for Arduino, LEGO, and Raspberry Pi

Learn more

Discover what MATLAB® can do for your career.

Opportunities for recent engineering grads.

Apply Today

Thread Subject:
How to calculate pdf of sub-histogram?

Subject: How to calculate pdf of sub-histogram?

From: Mohd Farhan

Date: 12 Nov, 2011 17:30:24

Message: 1 of 4

hello,

let suppose i have gray-image.
i calculated the histogram of that image by imhist().
& then divide this histogram in 4 sub-histograms, {let from 0-50, 51-100, 101-150, 151-255}.
i want to calculate the pdf of these 4 sub-histogram individually.

How can i do that? so that i can calculate its individual cdf.

"cumsum" is showing error ( like... integer values not allowed )

I want to apply basic formula of pdf/cdf to calculate my individual sub-histogram, values per each gray-levels.

please help me.

Subject: How to calculate pdf of sub-histogram?

From: Casper

Date: 12 Nov, 2011 23:27:14

Message: 2 of 4

Do you have any idea about the distribution underlying each sub-histogram? If not then you likely need to estimate the parameters of said distribution using MLE or the likes.

"Mohd Farhan " <farhan7787@gmail.com> wrote in message <j9mafg$o35$1@newscl01ah.mathworks.com>...
> hello,
>
> let suppose i have gray-image.
> i calculated the histogram of that image by imhist().
> & then divide this histogram in 4 sub-histograms, {let from 0-50, 51-100, 101-150, 151-255}.
> i want to calculate the pdf of these 4 sub-histogram individually.
>
> How can i do that? so that i can calculate its individual cdf.
>
> "cumsum" is showing error ( like... integer values not allowed )
>
> I want to apply basic formula of pdf/cdf to calculate my individual sub-histogram, values per each gray-levels.
>
> please help me.

Subject: How to calculate pdf of sub-histogram?

From: ImageAnalyst

Date: 13 Nov, 2011 18:12:49

Message: 3 of 4

Mohd:
I totally don't understand. What do you mean "I want to apply basic
formula of pdf/cdf to calculate my individual sub-histogram, values
per each gray-levels. "?? You already HAVE the individual sub-
histogram bin values, you said so. So why do you want to do something
else to get them? Besides, other than a normalization factor, the sub-
histogram IS the pdf. But let's take a step and back and have you
tell us why you need, or think you need, the pdf or the histogram at
all.
ImageAnalyst

Subject: How to calculate pdf of sub-histogram?

From: Mohd Farhan

Date: 14 Nov, 2011 12:48:10

Message: 4 of 4

ImageAnalyst <imageanalyst@mailinator.com> wrote in message <a6a14e6a-a542-4537-b4d3-2be271c95415@o5g2000yqa.googlegroups.com>...
> Mohd:
> I totally don't understand. What do you mean "I want to apply basic
> formula of pdf/cdf to calculate my individual sub-histogram, values
> per each gray-levels. "?? You already HAVE the individual sub-
> histogram bin values, you said so. So why do you want to do something
> else to get them? Besides, other than a normalization factor, the sub-
> histogram IS the pdf. But let's take a step and back and have you
> tell us why you need, or think you need, the pdf or the histogram at
> all.
> ImageAnalyst

my problem is solved now.

But now i am stuck in one problem, let suppose for a histogram i calculated some min. class value, & want to know at which gray level..

like here: http://www.labbookpages.co.uk/software/imgProc/otsuThreshold.html

min. within class variance is 0.4909, BUT HOW CAN I KNOW IT IS ON WHICH LEVEL i.e. 1 or 2 or 3 or 4 or 5?

Actually i want this for larger images. i.e. to know at which level the variance is min.?

please help me out.

Tags for this Thread

No tags are associated with this thread.

What are tags?

A tag is like a keyword or category label associated with each thread. Tags make it easier for you to find threads of interest.

Anyone can tag a thread. Tags are public and visible to everyone.

Contact us