image processing canny edge detection

5 Ansichten (letzte 30 Tage)
Mohammad abu aqoulah
Mohammad abu aqoulah am 31 Mai 2020
Kommentiert: Image Analyst am 1 Jun. 2020
i want to convert image without go to gray scal by split color image by to R G and B after that converting to canny and sum 3 pic

Antworten (1)

Walter Roberson
Walter Roberson am 31 Mai 2020
YourImage = imresize(imread('baby.jpg'), 1/8);
R = YourImage(:,:,1);
G = YourImage(:,:,2);
B = YourImage(:,:,3);
ER = edge(R, 'canny');
EG = edge(G, 'canny');
EB = edge(B, 'canny');
anyedge = ER | EG | EB;
alledge = ER & EG & EB;
majorityedge = (ER + EG + EB) >= 2;
Rany = R; Rany(anyedge) = 255;
Gany = G; Gany(anyedge) = 0;
Bany = B; Bany(anyedge) = 0;
RGBany = cat(3, Rany, Gany, Bany);
Rall = R; Rall(alledge) = 255;
Gall = G; Gall(alledge) = 0;
Ball = B; Ball(alledge) = 0;
RGBall = cat(3, Rall, Gall, Ball);
subplot(3,2,1)
imshow(YourImage);
title('Original');
subplot(3,2,2);
imshow(anyedge)
title('Edge found in any plane');
subplot(3,2,3)
imshow(majorityedge)
title('Edge found in 2+ planes');
subplot(3,2,4)
imshow(alledge)
title('Edge found in all planes');
subplot(3,2,5)
imshow(RGBany)
title('Original outlined with any edge');
subplot(3,2,6)
imshow(RGBall)
title('Original outlined with all edge')
Bany = B; Bany(anyedge) = 0;
  3 Kommentare
Mohammad abu aqoulah
Mohammad abu aqoulah am 1 Jun. 2020
i mean
i have image i want firstly split this image into R , G and B and show 3 images red , green and blue images
secondly apply edge canny in each 3 colore image
canny edge detection on green image (g_d)
canny edge detection on blue image (b_d)
canny edge detection on red image (r_d)
after that add (g_d)+(b_d)+(r_d) to have colore canny detection

Melden Sie sich an, um zu kommentieren.

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by