MATLAB Answers

EvaUCL
0

how to colored the edge detection result(binary image)?

EvaUCL
さんによって質問されました 2016 年 1 月 4 日
最新アクティビティ Keerthana Goud さんによって 回答されました 2019 年 8 月 5 日 2:41
hello everyone, now i'm working with the edge detection of human lungs.i've successfully detected the edge by using 'canny' edge function in matlab. the lungs edge has been extracted too. in this case, the result is a binary image and i do binary inversion then. so the edge line will be black and the background will be white. the question is how to colored the edge line? the code snippet of mine below :
%code BWImage = edge(closeBW,'canny'); IbC = ~im2bw(BWImage, 0.25);
and the result image was attached.
thanks in advance!

  0 件のコメント

サインイン to comment.

2 件の回答

David Young
回答者: David Young
2016 年 1 月 4 日

You can set the colour map when you display the binary image. For example
img = imread('pout.tif');
imedge = edge(img, 'canny');
imshow(imedge, 'ColorMap', [1 1 1; 0 0 1]);
Displays blue (0,0,1) edges on a white (1,1,1) background. See this description.

  0 件のコメント

サインイン to comment.


回答者: Keerthana Goud 2019 年 8 月 5 日 2:41

If imedge is the extracted boundary, it can be given color with the following code.
imshow(imedge, 'colormap', [0 0 1; 1 1 1]); Displays blue(0 0 1) edge on white background(1 1 1).

  0 件のコメント

サインイン to comment.



Translated by