how to get enhanced segmented image
Show older comments
i used roipolyold to select the region i want.... now when i use the below code i get the segmented image and the unwanted image in blue color.... can i change the blue color to black so that i get the perfect segmented output....
ROI = ROIPOLYOLD(inputImage);
binaryImage = ROI;
fontSize=15;
structBoundaries = bwboundaries(binaryImage);
xy=structBoundaries{1};
x = xy(:, 2);
y = xy(:, 1);
outerImage = inputImage;
outerImage(~binaryImage) = 0;
leftColumn = min(x);
rightColumn = max(x);
topLine = min(y);
bottomLine = max(y);
width = rightColumn - leftColumn + 1;
height = bottomLine - topLine + 1;
segmentedImage = imcrop(outerImage, [leftColumn, topLine, width, height]);
Accepted Answer
More Answers (0)
Categories
Find more on Image Arithmetic in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!