Rank: 904 based on 77 downloads (last 30 days) and 4 files submitted
photo

Joao Henriques

E-mail
Company/University
University of Coimbra

Personal Profile:

Personal info and publications:
http://www.isr.uc.pt/~henriques/

Professional Interests:

 

Watch this Author's files

 

Files Posted by Joao View all
Updated   File Tags Downloads
(last 30 days)
Comments Rating
12 Dec 2010 Screenshot Figure to play and analyze videos with custom plots on top A figure ready to scroll through and play videos. You can also draw any custom graphics on it. Author: Joao Henriques video processing, visualization, figure, video analysis, video, image processing 19 0
07 Jul 2010 Screenshot Fast edges of a color image (actual color, not converting to grayscale) Edges of a color image by the max gradient method. Author: Joao Henriques edges, edge detection, color image, image processing 37 6
28 Apr 2010 Screenshot textborder - Higher contrast text using a 1-pixel-thick border Draws text on a figure with a 1-pixel-thick border. Author: Joao Henriques border, text, figure, visualization 4 0
27 Apr 2010 Screenshot disptable - Display matrix with column or row labels Displays a matrix with per-column or per-row labels. Author: Joao Henriques display, matrix, table, labels 17 0
Comments and Ratings by Joao View all
Updated File Comments Rating
16 Dec 2011 maximize Platform independent function to maximize a figure window. Author: Oliver Woodford

Works as advertised, thank you!

27 Oct 2011 Fast edges of a color image (actual color, not converting to grayscale) Edges of a color image by the max gradient method. Author: Joao Henriques

Anyway, this is an interesting topic but I haven't studied it extensively, so if at times I seem out of touch I apologize :)

27 Oct 2011 Fast edges of a color image (actual color, not converting to grayscale) Edges of a color image by the max gradient method. Author: Joao Henriques

I didn't implement Simmoncelli's, but it's not surprising that the 5-point stencil is worse.

The estimation window is thin (5x1 or 1x5); it was really made for one-dimensional cases. It will be highly dependent on the direction of the axes, which makes it noisy.
(I assume you're not talking about the other 5-point stencil, which computes the Laplacian, not a directional derivative.)

The idea behind the Sobel and Prewitt filters is to take a simple difference estimator and blur it in 2 dimensions (ie, low-pass filter). The blurring is mostly isotropic, unlike 5-point stencil that gives high preference to one dimension/axis (x or y).

Following that line of reasoning, I tried convolution of a difference operator and a gaussian; it has good results and you can vary the sigma. Here's the code (also sobel and 5-point, commented out).

% yfilter = fspecial('sobel');
% yfilter = [-1, 8, -8, 1]' / 12;
sigma = 0.5;
yfilter = imfilter(fspecial('gaussian', ceil(sigma * 6), sigma), [1; 0; -1]);

09 Oct 2011 Fast edges of a color image (actual color, not converting to grayscale) Edges of a color image by the max gradient method. Author: Joao Henriques

Since some people asked by e-mail, here's more insight into the algorithm:

This seems to be an old technique and it's very well-known; I learned about it when I was a student, in my Computer Vision class. Unfortunately the lecture notes are not in English. But after searching around a bit, I found it's from this paper:

Silvano Di Zenzo, "A note on the gradient of a multi-image", 1986

You can download the PDF easily. What I did is all in that paper, but there are many ways of calculating the maximum eigenvalue (gradient magnitude). The author used those sin/cos formulas, but I calculated it directly by applying the eigenvalue formulas for 2x2 matrices, which you can find in Section 1.2 of The Matrix Cookbook (available online).

16 Sep 2011 Fast edges of a color image (actual color, not converting to grayscale) Edges of a color image by the max gradient method. Author: Joao Henriques

I'm not sure the derivative estimation can be improved much. I may be ignoring some more recent work, but my impression is that that line of research was dropped a while ago, and most people nowadays use simple estimates of the derivatives. The papers I read showed improvements on synthetic images but no real-life data. (Correct me if I'm wrong please!)

The reason is that obtaining "good" edges depends on your problem, and usually it doesn't make sense to optimize it at such a low-level. There's always a risk of overfitting your data. I come from a pattern recognition background, so usually we try to get good low-level features but sort them out at a higher level (eg., fitting line segments, classifying windows with SVMs).

This method yields better results when grayscale data doesn't show edges but color data does. Sobel filters are the same as simple differences (ie, xfilter=[-1 1]) with a small amount of smoothing. So I'm not sure you can squeeze much more performance out of edge detection code, even with those methods.

Comments and Ratings on Joao's Files View all
Updated File Comment by Comments Rating
27 Oct 2011 Fast edges of a color image (actual color, not converting to grayscale) Edges of a color image by the max gradient method. Author: Joao Henriques Henriques, Joao

Anyway, this is an interesting topic but I haven't studied it extensively, so if at times I seem out of touch I apologize :)

27 Oct 2011 Fast edges of a color image (actual color, not converting to grayscale) Edges of a color image by the max gradient method. Author: Joao Henriques Henriques, Joao

I didn't implement Simmoncelli's, but it's not surprising that the 5-point stencil is worse.

The estimation window is thin (5x1 or 1x5); it was really made for one-dimensional cases. It will be highly dependent on the direction of the axes, which makes it noisy.
(I assume you're not talking about the other 5-point stencil, which computes the Laplacian, not a directional derivative.)

The idea behind the Sobel and Prewitt filters is to take a simple difference estimator and blur it in 2 dimensions (ie, low-pass filter). The blurring is mostly isotropic, unlike 5-point stencil that gives high preference to one dimension/axis (x or y).

Following that line of reasoning, I tried convolution of a difference operator and a gaussian; it has good results and you can vary the sigma. Here's the code (also sobel and 5-point, commented out).

% yfilter = fspecial('sobel');
% yfilter = [-1, 8, -8, 1]' / 12;
sigma = 0.5;
yfilter = imfilter(fspecial('gaussian', ceil(sigma * 6), sigma), [1; 0; -1]);

27 Oct 2011 Fast edges of a color image (actual color, not converting to grayscale) Edges of a color image by the max gradient method. Author: Joao Henriques Birdal, Tolga

Hey Joao ,

Well, you are right at some point but in Sobel-like edges you are considering only 3x3 neighborhoods, while more advanced derivatives such as Simoncelli or 5 point stencil use a larger neighborhood and they are proved to be more robust against noise.

Actually my questions was whether you evaluated any other derivatives or not. Thanks for the response. I would appreciate if you could try others and give a feedback. I happened to realize that the algorithm only works with Sobel-like derivatives.

/tolga

09 Oct 2011 Fast edges of a color image (actual color, not converting to grayscale) Edges of a color image by the max gradient method. Author: Joao Henriques Henriques, Joao

Since some people asked by e-mail, here's more insight into the algorithm:

This seems to be an old technique and it's very well-known; I learned about it when I was a student, in my Computer Vision class. Unfortunately the lecture notes are not in English. But after searching around a bit, I found it's from this paper:

Silvano Di Zenzo, "A note on the gradient of a multi-image", 1986

You can download the PDF easily. What I did is all in that paper, but there are many ways of calculating the maximum eigenvalue (gradient magnitude). The author used those sin/cos formulas, but I calculated it directly by applying the eigenvalue formulas for 2x2 matrices, which you can find in Section 1.2 of The Matrix Cookbook (available online).

16 Sep 2011 Fast edges of a color image (actual color, not converting to grayscale) Edges of a color image by the max gradient method. Author: Joao Henriques Henriques, Joao

I'm not sure the derivative estimation can be improved much. I may be ignoring some more recent work, but my impression is that that line of research was dropped a while ago, and most people nowadays use simple estimates of the derivatives. The papers I read showed improvements on synthetic images but no real-life data. (Correct me if I'm wrong please!)

The reason is that obtaining "good" edges depends on your problem, and usually it doesn't make sense to optimize it at such a low-level. There's always a risk of overfitting your data. I come from a pattern recognition background, so usually we try to get good low-level features but sort them out at a higher level (eg., fitting line segments, classifying windows with SVMs).

This method yields better results when grayscale data doesn't show edges but color data does. Sobel filters are the same as simple differences (ie, xfilter=[-1 1]) with a small amount of smoothing. So I'm not sure you can squeeze much more performance out of edge detection code, even with those methods.

Top Tags Applied by Joao
figure, visualization, border, color image, display
Files Tagged by Joao View all
Updated   File Tags Downloads
(last 30 days)
Comments Rating
12 Dec 2010 Screenshot Figure to play and analyze videos with custom plots on top A figure ready to scroll through and play videos. You can also draw any custom graphics on it. Author: Joao Henriques video processing, visualization, figure, video analysis, video, image processing 19 0
07 Jul 2010 Screenshot Fast edges of a color image (actual color, not converting to grayscale) Edges of a color image by the max gradient method. Author: Joao Henriques edges, edge detection, color image, image processing 37 6
28 Apr 2010 Screenshot textborder - Higher contrast text using a 1-pixel-thick border Draws text on a figure with a 1-pixel-thick border. Author: Joao Henriques border, text, figure, visualization 4 0
27 Apr 2010 Screenshot disptable - Display matrix with column or row labels Displays a matrix with per-column or per-row labels. Author: Joao Henriques display, matrix, table, labels 17 0

Contact us at files@mathworks.com