why there are spurious edges in case of edge detection in HSI color space?

8 views (last 30 days)
I am trying to detect edges in color images. In case of HSI color space, although number of edges is more than the other color spaces, but there are spurious edges, in some images,at locations where there is constant intensity. Why is it so? Conversion from RGB to HSI and vice-versa is correct. We cannot consider the HSI to be the best since it contains spurious edges in some images. I am not arriving at any conclusion. Please help.

Answers (1)

DGM
DGM on 2 May 2023
In nine years, nobody else came to any conclusion either, since OP never revealed the image, the code, or even the edge detection method being used. Consider this the first lesson. If you want your question to be answered within the decade, it's crucial to provide enough information that other people know what you're working with.
That said, this question does appear to be answerable if we make some leaps of intuition. The distinction between HSI, HSV, and HSL is moot here. The problem is more basic and will apply to all polar models. That might be a clue.
This is probably where the expectations are formed. We can create edgemaps of the RGB channels like so:
% read an RGB image
inpict = imread('peppers.png');
% calculate the edge map by some means
% edge() can't handle multichannel inputs, so use a loop
outpict = false(size(inpict));
for c = 1:size(inpict,3)
outpict(:,:,c) = edge(inpict(:,:,c));
end
% show it
% for some unknown reason, imshow() can't handle logical images
% unless they're single-channel, so cast it to double for viewing
imshow(double(outpict),'border','tight')
Okay, so that looks great, let's just transform the image and do the same thing again.
% convert the image to HSI/HSV/HSL/whatever
% MATLAB/IPT have no HSI tools, but HSV suffices for demonstration
hsxpict = rgb2hsv(inpict);
% calculate the edge map by some means
outpict = false(size(inpict));
for c = 1:size(inpict,3)
outpict(:,:,c) = edge(hsxpict(:,:,c));
end
% show it
imshow(double(outpict),'border','tight')
How did all those crispy red edges get there? Notice that they're all in red -- or rather, since we're in HSV, they're all in hue. Well, what's hue look like?
imshow(hsxpict(:,:,1),'border','tight')
It seems that there are indeed a lot of edges there, and they're all strong edges. In fact, they're all edges representing a swing from extreme black to extreme white. This happens because H is a circular continuum. These two extremes are actually adjacent, but not as far as any edge detection routine can discern. The only thing it can see is the local gradient.
I don't know of a good method or reason to apply these edge finding techniques to a polar model. Since this is a dead thread, I don't really think it's required to come up with an answer to that.
That said, there may be value in discussing the components other than hue. Specifically, we might want to reduce a color image to grayscale and find the edges of the grayscale image. The differences in the brightness components of the various models might be of interest. Again, MATLAB/IPT does not have any HSI/HSL tools, but if all we need are I or L, we can calculate those alone. Generally, the differences aren't going to be large. Using luma is going to generally be better than V,L, or I, and MATLAB already has a tool for that (rgb2gray() and im2gray() calculate BT601 luma).

Community Treasure Hunt

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

Start Hunting!