From: Dave on
Hello all,

my project basically deals with grayscale images which contain white clouds on gray background of irregular shapes. I need to find out the area of each cloud and convert the unnecessary clouds into gray,the background color.

I used the commands area,edge,regionprops inorder to achieve the task. I successfully traced out the edges of the clouds using edge command.Calculated the areas using regionprops command.

I am facing following problems

1. some clouds are sharing common boundaries and the regions so formed also coming under the evaluation.

2.You can observe some gray spots inside the white clouds.It should not come into my evaluation.

3. unnecessary clouds(i.e., which have less area than needed) should be converted into gray or background color.

Code I have written so far

%my first matlab script to detect the edge
I=imread('G:\05.jpg');
I=RGB2GRAY(I);
BW1=edge(I,'canny',-1);
imshow(BW1)
disp('area using bwarea')
bwarea(BW1)
bwarea(I)
%area(BW1)
disp('using regionprops')
L=bwlabel(BW1);
STATS=regionprops(L,'Area');
disp('area using regionprops')
STATS.Area

Any one please help me out.I can post the image but I don't know the way to post it since I am new to this group

thankyou