Whats wrong with this Histogram Partition

조회 수: 2 (최근 30일)
Muhammad Ali Qadar
Muhammad Ali Qadar 2013년 11월 11일
편집: Muhammad Ali Qadar 2013년 11월 18일
Hi,
I am trying to do following stuff,
1. Smooth the historam using 1*3 smoothing filter
2. Partition the histogram by taking taking first and last histogram components as minima
What I did and understand is following code
I=imread('cameraman.tif');
[h bin]=imhist(I);
%Apply Smoothing Filter
f=[1 1 1]/3;
ff=filter2(f, h, 'same');
%============================================
%Partitioning Histogram
a=ff<(ff+1);
b=ff>(ff-1);
I think something wrong in partitioning, Thanks in Advance for your suggestions

답변 (1개)

Image Analyst
Image Analyst 2013년 11월 12일
Sentence #2 does not make sense to me. The first and last components of the histogram will be one gray level lower than the darkest gray level, and one gray level higher than the brightest gray level, respectively. I don't know what partition means. How are minima involved in a "partition" operation (whatever partition is, which I still do not know)? When we talk about splitting a histogram into different ranges we talk about thresholding. Of course thresholding your image at one less than the darkest gray level will give you a totally white image (all true) binary image, while thresholding at one more than the brightest gray level will give you a totally black (totally false) binary image.
Please clarify!!
  댓글 수: 3
Image Analyst
Image Analyst 2013년 11월 12일
There could be numerous local minima. You can find them all with
localMinsInHist = imregionalmin(theHistogram);
But anyway, once you've determined found one that you want to use, call it f, you can "threshold" or "binarize" the image this way:
[theHistogram, grayLevels] = imhist(grayImage);
% Now compute f.
binaryImage = grayImage < f; % or can use >, >= or <=
Muhammad Ali Qadar
Muhammad Ali Qadar 2013년 11월 18일
편집: Muhammad Ali Qadar 2013년 11월 18일
@Image Analyst Please have a look at the above image from paper it shows how the partition need to be done, please need more suggestions

댓글을 달려면 로그인하십시오.

카테고리

Help CenterFile Exchange에서 Histograms에 대해 자세히 알아보기

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by