superposition of binary image contours on grid level image 255

I need to draw a yellow line from the binary image contours I have this image
I made a work to detect urban spot then I want to draw yellow line of the last picture contours as the following picture

 Accepted Answer

Try this
% Get boundaries of the regions in the binary image.
boundaries = bwboundaries(binaryImage);
% Display those boundaries over the original image
hold on; % Don't blow away existing displayed image.
visboundaries(boundaries, 'Color', 'y'); % Display outline.
hold off;
If you have an antique version of MATLAB, use the following code to display the boundaries instead of visboundaries():
% Get boundaries of the regions in the binary image.
boundaries = bwboundaries(binaryImage);
numberOfBoundaries = size(boundaries, 1);
hold on;
for k = 1 : numberOfBoundaries
thisBoundary = boundaries{k};
plot(thisBoundary(:,2), thisBoundary(:,1), 'y', 'LineWidth', 2);
end
hold off;

More Answers (2)

Thank you very much I arrived to resolve because of you

1 Comment

You're very welcome. The usual thing we do in this forum to thank people is to "Accept this answer" to give the person reputation points (not that I need anymore, but that is the custom).

Sign in to comment.

Categories

Find more on Deep Learning Toolbox 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!