<p>I think you can convert from the RGB space to the HSV one, or whatever color space has the HUE in a single channel.</p>

<p>Take the HUE channel, and make the edge detection on that one.</p>

<p>Here a simple Matlab script to achieve the result.</p>

<pre><code>I = imread('image.png');
hsv = rgb2hsv(I);
hue = hsv(:,:,1);
edges = edge(uint8(hue),'sobel');
imshow(edges);
</code></pre>

CC BY-SA 3.0
2015-08-09T12:13:20.517Z
2015-08-09T17:03:58.693Z
2015-08-09T17:03:58.693Z
psicomante
<p>Color difference is a difference in brightness, in some color channel. So while the sum of individual channels stay the same, there is a intensity difference if there is a color difference.</p>

<p>Now the basic algorithms do not really specify how you should hadle the multi channel data. So there is nothing wrong with using a different color space. On the other hand nothing says you can not apply the convolution on all channels and then pick the result that is most contrasting.</p>

CC BY-SA 3.0
2015-08-09T11:28:28.467Z
2015-08-09T11:28:28.467Z
joojaa
<p>I'm looking for an algorithm that can identify edges across which colour is changing sharply, rather than just finding changes in brightness.</p>

<p>Is this just a matter of using a different colour space with existing edge detection algorithms, or is there a better approach?</p>

CC BY-SA 3.0
2015-08-09T11:55:11.810Z
Yes, using an appropriate color space is what you want.
Julien Guertault
<color><algorithm><edge-detection>
How can I detect edges between different colours of the same brightness?
trichoplax is on Codidact now
# How can I detect edges between different colours of the same brightness?

(Asked by: username_0 on 2015-08-09)

I'm looking for an algorithm that can identify edges across which colour is changing sharply, rather than just finding changes in brightness.

Is this just a matter of using a different colour space with existing edge detection algorithms, or is there a better approach?

**Tags:** color, algorithm, edge-detection

> **Comments:**
> **username_1**: Yes, using an appropriate color space is what you want.  

---

## 2 answers

### Answer by username_2 on 2015-08-09. Score: 3 | Accepted answer

I think you can convert from the RGB space to the HSV one, or whatever color space has the HUE in a single channel.

Take the HUE channel, and make the edge detection on that one.

Here a simple Matlab script to achieve the result.

```
I = imread('image.png');
hsv = rgb2hsv(I);
hue = hsv(:,:,1);
edges = edge(uint8(hue),'sobel');
imshow(edges);

```


---

### Answer by username_3 on 2015-08-09. Score: 2

Color difference is a difference in brightness, in some color channel. So while the sum of individual channels stay the same, there is a intensity difference if there is a color difference.

Now the basic algorithms do not really specify how you should hadle the multi channel data. So there is nothing wrong with using a different color space. On the other hand nothing says you can not apply the convolution on all channels and then pick the result that is most contrasting.


---

