You are on page 1of 2

A=imread(college.

jpg);

A=rgb2gray(a);

C=edge(a,’sobel’);

D=edge(a,’prewitt’);

E=edge(a,’log’);

F= edge(a,’canny’);

Showimage(a,’original image’)

Tiltle(‘original image’)

Figure

Showimage(c,’sobel’)

Title(‘sobel’)

Figure

Showimage(d,’prewitt’)

Title(‘prewitt’)

Figure

Showimage(e,’log’)

Title(‘log’)

Figure

Showimage(f,’canny’)

Title(‘canny’)

Watershed transform
B=imread(.png);

A=rgb2gray(B);

GLOBAL EDGE_SOBEL;

Gradient=edge filter(a, edge_sobel);

Threshold=caluclate0tsuthreshold(gradient);

Edge image=~segmentby threshold(gradient, threshold);

Distance image= distance transform(edgeimage);

Threshold2=calculate0tsuthreshold(distance image);

Threshold image=segment by threshold (distance image ,threshold 2)

Marker image=searchblobs(threshold image);

Segmentimage=watershed(gradient,marker image);

Figure

Show colorimage(b,’teaset’)

Title(‘teaset.png’)

Figure

Colormaplength=length(unique(segmented image));

Show image(segmented image, ‘result of watershed transform’, jetcolormap(colormaplength));

You might also like