1
$\begingroup$

Studying for my finals in Image Processing. Trying to solve the following question:

An image processing specialist recommended an algorithm for Edge Detection in a color image RGB. He argued that it was unnecessary to switch to a different color model. You can calculate the gradient in each of the three images R, G and B, and calculate a new vector which is the sum of the gradients. Using the sum of the gradients we find the edges. Why is he wrong?

The solution was:

Consider color of figure $C_{\text{Figure}}^{\text{RGB}}=\left(100,0,0\right)$ and color of background $C_{\text{Background}}^{\text{RGB}}=\left(0,100,0\right)$. The gradient of the red color element will be the same size as that of the green color element but their marks will be opposite so we will get the sum of the gradients to be zero, even though there is an actual edge.

I'm trying to understand the solution. I understand that in theory you will get the same size, but why they are opposite? How do I move from the color into the gradient, mathematically speaking? Is it possible to provide a more "formal" argument?

$\endgroup$
5
  • $\begingroup$ Hi! Do you understand what the gradient of an image is? $\endgroup$ Feb 7 at 14:23
  • $\begingroup$ Read here: en.m.wikipedia.org/wiki/Gradient $\endgroup$ Feb 7 at 14:58
  • $\begingroup$ It's kind of a dumb argument. A reasonable person would look at the sum of the absolute values or squares of the gradient. You are looking for a change and it doesn't matter if the change goes up or down. A change is a change. $\endgroup$
    – Hilmar
    Feb 7 at 15:07
  • $\begingroup$ @Hilmar: It's teaching that sometimes a person from out of town with a briefcase and a big hourly rate isn't always better at the job than a monkey wearing a Rolex. $\endgroup$
    – TimWescott
    Feb 7 at 15:27
  • $\begingroup$ @TimWescott: I think it's more that teachers need to learn how to ask meaningful and relevant questions instead of making up random stuff. $\endgroup$
    – Hilmar
    Feb 8 at 14:39

1 Answer 1

1
$\begingroup$

How do I move from the color into the gradient, mathematically speaking?

I'm going to just hand you the answer, but check your notes. The hint is that it's called a color vector. Mathematically, you treat it as a 3-element vector like any other. This means that you can do arithmetic on it; i.e. $C_2^{RGB} - C_1^{RGB} = \left ( c^R_2 - c^R_1, c^G_2 - c^G_1, c^B_2 - c^B_1\right )$.

I understand that in theory you will get the same size, but why they are opposite? ... Is it possible to provide a more "formal" argument?

If you treat $C^{RGB}$ as a vector, then the rest should be obvious.

$\endgroup$
2
  • $\begingroup$ Why did you substract and not sum the vectors? $\endgroup$
    – vesii
    Feb 8 at 15:05
  • $\begingroup$ What is a gradient? What would a vector gradient over a discrete space look like? $\endgroup$
    – TimWescott
    Feb 8 at 16:07

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.