Question
Contrast Streching, Extracting the Green im_double = im2double(im); im_contrast = histeq(im_double); im_green = im_contrast(:,:,2); %%Clear Border, Filtering The Image im_clear = imclearborder(im_green); im_bi = imbilatfilt(im_clear);
Contrast Streching, Extracting the Green im_double = im2double(im); im_contrast = histeq(im_double); im_green = im_contrast(:,:,2); %%Clear Border, Filtering The Image im_clear = imclearborder(im_green); im_bi = imbilatfilt(im_clear); im_med = medfilt2(im_bi); %%Binarize im_gray = graythresh(im_med); middleground = imbinarize(im_med, im_gray); middlegroundClean = bwareaopen(middleground,5); BWclean = bwareafilt(middlegroundClean, 1,'largest'); se = strel('disk' , 1); im_erode = imerode(BWclean , se); se = strel('disk' , 2); Image_segment = imdilate(im_erode , se); D = -bwdist(~Image_segment); Ld = watershed(D);
bw2 = Image_segment; bw2(Ld == 0) = 0;
mask = imextendedmin(D,2);
D2 = imimposemin(D,mask); Ld2 = watershed(D2); bw3 = Image_segment; bw3(Ld2 == 0) = 0; cc = bwconncomp(bw3); L = labelmatrix(cc); y = [\"shuffle\" , \"noshuffle\"]; rgb = label2rgb(L,'jet','k', y(randi(numel(y))));
What should I add in the code that the output looks like this
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started