# Help Understanding the Robert Cross Operator

I have been reading this Wikipedia article: https://en.wikipedia.org/wiki/Roberts_cross

And it says this: Now I have also been reading this for the Robert Cross operator (from Feature Extraction and Image Processing 3rd Edition): I can understand The books explanation (kinda) but not wikipedia.

So in Code I will have something like this:

EdgeValue(at x,y) = Max[(Px+1,y - Px,y+1), (Px,y - Px+1,y+1)]


So from the 2 values I choose the max. And in the new image I just draw that value in x,y. Makes sense.

What I do not get is Wikipedia. Why does it go on finding the gradient? Also that looks like the Pythagorean Theorem not a gradient equation.

• Shouldn't you take the max of the two absolute values? – Niki Estner Aug 2 '15 at 5:49
• Would you please let me know what kind book do you have referenced? – gmotree Aug 2 '15 at 21:42

What I do not get is Wikipedia. Why does it go on finding the gradient?

You subtract two nearby pixel values. That is a gradient, or as close as you can get on a discrete image.

Also that looks like the Pythagorean Theorem not a gradient equation.

As the book text say, "it is often better to consider the two templates as providing the components of an edge vector". If you want the length of a vector, you use the Pythagorean Theorem.

The better question is: why use the max or the sum of the absolute values, or: what's the difference?

To show that, it's best to try the filter on a rotationally symmetric template: that way, we can see how it acts on different edge angles: As you can see, adding the absolute values of the gradient vector (this is sometimes called the "L1-Norm") gives larger edge strengths for horizontal and vertical edges than diagonal edges. Taking the max of the two absolute values of the gradient vector (also known as the "L-infinity Norm") gives slightly larger edge values for diagonal edges. Using the ordinary Euclidean norm (i.e. the Pythagorean Theorem) gives exactly the same edge strength for any angle, which is of course the right result.

The only downside (I'm aware of) is that this requires two multiplications and a square root for every pixel, which used to be very expensive operations when the Roberts operator was invented. They're still expensive on mobile or embedded platforms today, but on a PC, you might not even notice the difference.

• So basically the roberts operator can be used with all those 3 methods you mention right? As long as you convolve the two operators separately with the iamge – Trt Trt Aug 2 '15 at 10:38
• @TrtTrt: Of course. You can can use any method you like ;-) – Niki Estner Aug 2 '15 at 11:04