which feature is better for comparing images like these?

hi everybody I used a prefabricate fuzzy code for threshold of a number of images. my main goal of using this code was obtaining a general Schematic of images,but when I used this code I reached to the conclusion that the result images are suitable for main purpose. you can see the following image bellow:
but in some cases the result is not fit to my purpose like to following image:
so I decided to put this code in a while loop to run repetitive , till I reach my desirable result like first image that I attached. by seeing the images that I attached I supposed that variance can be a good criteria for a desirable image. but after comparing the variance of the results of the 2 images that I attached, I found that variances are some how similar. I don't have enough information about image features. my question is that ,whether there is any feature that can help me to measure desirability of resulted images with that, and I can use that feature in while loop. I appreciated you if you can suggest me any idea.

Answers (2)

I don't know what you're doing in your loop to change the image. You need to mask your image so that the variance is not being dominated by the circle. You need to extract just the values inside the circle mask:
stdDev = std(grayImage(circleMask));
where circleMask is a binary image that is true inside the circle and false outside.
Instead of using "prefabricate fuzzy code" to quantize your image into four levels, why not simply use multithresh() to automatically determine the best thresholds:
grayImage = imread('cameraman.tif');
subplot(1,2,1);
imshow(grayImage, []);
numberOfOutputGrayLevels = 4;
[thresholds, map] = multithresh(grayImage, numberOfOutputGrayLevels);
out = imquantize(grayImage, thresholds);
subplot(1,2,2);
imshow(out, []);

4 Comments

OK, thanks dear. I tried multithresh but I couldn't get the result that I wanted. I need a feature to use in my while loop as condition . if this condition was not true it means that I get the result that I wanted like image1 that I attached and if it is true it means that the result is like image2 that I attached and while loop should continue. I appreciated you if you can suggest me any idea.
What is image1 and image2? Are those the left image and right image in the pictures you inserted in your original question?
image1 is right image in first image that I linked here. and Image2 is right image in second image that I linked.
I have no idea how you want to decide on the 4 thresholds to use. I guess that would split the image up into 5 gray level classes. I also don't know fuzzy so that's why I suggested multithresh() to pick the thresholds for you. Sorry I can't help more than that, but I just don't know what you want to achieve, like what criteria you'd like to use for a "desirability" metric.

Sign in to comment.

Asked:

on 21 Jun 2015

Commented:

on 22 Jun 2015

Community Treasure Hunt

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

Start Hunting!