필터 지우기
필터 지우기

combining the result of sobel operator into a color egde detector

조회 수: 1 (최근 30일)
Sat m
Sat m 2013년 2월 23일
댓글: ankita taparia 2018년 12월 10일
i am applying sobel operator to each of the RGB color planes comprising the image. now, how can i combine these results into a color edge detector? and if i can then what are the difference between the resulting edges and the grayscale image? can i represent the resulting edges by matlab code?

채택된 답변

Image Analyst
Image Analyst 2013년 2월 23일
편집: Image Analyst 2013년 2월 23일
I don't think that will do what you think it will, but go ahead and see. Experiment and learn. You can combine the results with cat():
rgbImage = cat(3, redEdgeImage, greenEdgeImage, blueEdgeImage);
imshow(rgbImage);
You might want to convert to hsv color space:
hsv = rgb2hsv(rgbImage);
hImage = hsv(:,:,1);
sImage = hsv(:,:,2);
vImage = hsv(:,:,3);
and do edge detection on either the v channel or the h channel, depending on how you define edge. Again, experiment and see what you can get. There are papers on this in Vision Bib: Search Vision Bib
  댓글 수: 4
Sat m
Sat m 2013년 2월 23일
i am having confusion in 1 case. i can see that in case of combining the redegde, greenedge and blueedge, i see morer edges that in the result of sobel applied on a grayscale image. is this becasue, grayscale images has less channels than RGB image and as sobel operator algorithm applied on each channel to get the resultant edges? is this the reason for getting more edges in combined rgb image?
Image Analyst
Image Analyst 2013년 2월 23일
When you combine them, the combined image may show edges in one channel that didn't show up in the other channels. For example an edge that shows up in the blue channel may not show up in the red channel so the red channel appears to have less edge pixels. But when you combine them, any channel that had an edge at a location will show up, even if it's only one channel, so the combined image may seem to have more edges. To oversimplify, let's say the red channel had 1000 edge pixels, the green channel had 2000 edge pixels, and the blue channel had 3000 edge pixels. Now let's say that none of those pixels overlapped (were in the same location). So the most any single channel has is 3000 edge pixels but in the combined image you see 1000+2000+3000 = 6000 edge pixels, which is more than any one color channel had.

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

Community Treasure Hunt

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

Start Hunting!

Translated by