Sumi
Sumi

Reputation: 21

Using histogram equalization for 3 regions in histogram

I'm trying to develop an application that will stretching the histogram for each region..

In one picture, the histogram will be divided into 3 region which are dark, mid and bright region. the range will be: [0 85], [85 171] and [171 255]

my problem is, how to write a code to use histogram equalization on each region separately and after that, the result will be in one histogram and show one image too.

Upvotes: 1

Views: 333

Answers (1)

R. Schifini
R. Schifini

Reputation: 9313

Is this what you want?

r = randn(1000,1);
[N,X] = hist(r,30);

lowLim = -1;
highLim = 1;

L1 = X<lowLim;
L2 = X>highLim;

figure
hold on
bar(X,N)
bar(X(L1),N(L1),'k')
bar(X(L2),N(L2),'r')

colored region histogram

Upvotes: 1

Related Questions