image processing canny edge detection
4 ビュー (過去 30 日間)
古いコメントを表示
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
回答 (1 件)
Walter Roberson
2020 年 5 月 31 日
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 件のコメント
Image Analyst
2020 年 6 月 1 日
Looks like it was answered in your duplicate question: https://www.mathworks.com/matlabcentral/answers/538715-image-processing-edge-edge-detection#comment_877923
参考
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!