Hello friends, I have applied Canny edge detection to three different images and I got three images of edges of circles of three different sizes. I want to show these three edges of circles of different radius in same figure but with different colors to compare them. How it can be done? I have tried to use imfused command but did not get desired result. Please help me
Asked
Active
Viewed 49 times
0
-
For faster response and better answers you should really consider providing a small example code with your problem. See http://www.sscce.org/ – Sigroad Apr 29 '14 at 21:46
1 Answers
0
Here is a quick solution but it might not be the best method:
% edge detection
I = imread('circuit.tif');
bw1 = edge(I,'canny');
bw2 = edge(I,'sobel');
% black result image (it could be anything else)
imrgb = repmat(zeros(size(bw1)), [1 1 3]);
% color matrices, red and green
rm = repmat(cat(3,1,0,0),size(bw1,1),size(bw1,2));
gm = repmat(cat(3,0,1,0),size(bw1,1),size(bw1,2));
% logical matrices with same dimension as the result image
lm1 = repmat(bw1,[1 1 3]);
lm2 = repmat(bw2,[1 1 3]);
% overwrite pixel positions from the color matrices according to the logical matrices
% logical matrices were derived from the edge detected ones
imrgb(lm1) = rm(lm1);
imrgb(lm2) = gm(lm2);
imshow(imrgb)

Sigroad
- 1,771
- 3
- 20
- 17