简体   繁体   中英

Displaying an outline over an image?

I have an image 'C' of 800 x 700 pixels, and some code that finds the outline and saves this as a logical. I'd like to display the image with the outline superimposed, ideally in a specified colour such as red, but I'm running into difficulty; I've tried something like

imshow(C)
hold on
imshow(Outline)

But this doesn't work. I've also tried converting the logical to a double but am still running into trouble. Any ideas how I might do this?

My usual approach for that is to edit the alpha layer:

imshow(C);
hold on;
h = imshow(Outline);
set(h, 'AlphaData', im2double(Outline));
colormap jet; % should make the outline red

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM