Display as red specific cells of binary image

2 views (last 30 days)
Hello,
i have a binary image which i display with imshow function of matlab. After that i edit that array at specific cells and i want to display those cells as red with a later imshow call.
How can i do that

Accepted Answer

OCDER
OCDER on 18 Jul 2018
ImBW = rand(100)>0.5; %binary image
ImROI = zeros(100, 'logical'); %area you want to show as red
ImROI(25:50, 25:50) = 1; %just creating a random area to show as red
figure(1)
imshow(ImBW)
figure(2)
imshow(im2double(cat(3, ImROI|ImBW, ImBW, ImBW)))

More Answers (0)

Categories

Find more on Printing and Saving 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!