Thread Subject: How to count the number of each intensity value?

Subject: How to count the number of each intensity value?

From: Milchkaffee

Date: 23 Nov, 2009 16:15:13

Message: 1 of 4

Hi all,
I have 12-bit images, and I want to calculate the probability of each intensity value which appears in this image? Is there any good idea?

thanks a looooot :-)

Subject: How to count the number of each intensity value?

From: Jan Simon

Date: 23 Nov, 2009 17:13:05

Message: 2 of 4

Dear Milchkaffee!

> I have 12-bit images, and I want to calculate the probability of each intensity value which appears in this image? Is there any good idea?

help histc

Or equivalent function:
  S = sort(reshape(Image, 1, []));
  F = find([1, diff(S)]);
  A = S(F); % Sorted intensities
  N = diff([F, length(S) + 1]); % Number of occurrences

Kind regards, Jan

Subject: How to count the number of each intensity value?

From: Bruno Luong

Date: 23 Nov, 2009 17:22:20

Message: 3 of 4

"Milchkaffee " <zhengzhu_@hotmail.com> wrote in message <heeceh$etj$1@fred.mathworks.com>...
> Hi all,
> I have 12-bit images, and I want to calculate the probability of each intensity value which appears in this image? Is there any good idea?
>
> thanks a looooot :-)

Use HIST or HISTC

Bruno

Subject: How to count the number of each intensity value?

From: Milchkaffee

Date: 23 Nov, 2009 17:22:20

Message: 4 of 4

Dear Jan,
thank you very much for your fast answer, I'll try it immediately... :-D

best wishies!
"Jan Simon" <matlab.THIS_YEAR@nMINUSsimon.de> wrote in message <heefr1$hro$1@fred.mathworks.com>...
> Dear Milchkaffee!
>
> > I have 12-bit images, and I want to calculate the probability of each intensity value which appears in this image? Is there any good idea?
>
> help histc
>
> Or equivalent function:
> S = sort(reshape(Image, 1, []));
> F = find([1, diff(S)]);
> A = S(F); % Sorted intensities
> N = diff([F, length(S) + 1]); % Number of occurrences
>
> Kind regards, Jan

Tags for this Thread

Add a New Tag:

Separated by commas
Ex.: root locus, bode

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.

rssFeed for this Thread

Contact us at files@mathworks.com