Code for Multimodal Histogram Segmentation of images

2 views (last 30 days)
This is the code that I found on Multimodal histogram segmentation... I ran the code but however I have 2 doubts..
1. How do we form a loop to run steps 2 through 4.
2. Where is our final segmented output image
% 1)Select an initial estimate for T T = 128; T0 = .5;
% 2)Segment the image using T. This will produce two % groups of pixels. G1 consisting of all pixels with gray % level values >T and G2 consisting of pixels with values <=T.
G1 = grayImage > T; G2 = grayImage <= T;
% 3)Compute the average gray level values mean1 and % mean2 for the pixels in regions G1 and G2.
meanGL1 = mean(grayImage(G1)) meanGL2 = mean(grayImage(G2))
% 4)Compute a new threshold value
Tnew=(1/2) * (meanGL1 +meanGL2)
if (Tnew - T) < T0 then run steps 2 through 4 until (Tnew - T) > T0
Some one plzzz help...its urgent

Answers (1)

Sean de Wolski
Sean de Wolski on 15 Oct 2014
doc multithresh
doc imquantize
  2 Comments
Sean de Wolski
Sean de Wolski on 17 Oct 2014
If you run those two commands, they will lead you to the documentation for the functions in MATLAB that find thresholds and apply them to images.

Sign in to comment.

Community Treasure Hunt

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

Start Hunting!