Search Comments and Ratings

go

   
Date File Comment by Comment Rating
24 Sep 2014 textborder - Higher contrast text using a 1-pixel-thick border Draws text on a figure with a 1-pixel-thick border. Author: Joao Henriques Sim

Sim (view profile)

Works really nice. There a bug when using graphics with transparency (when the figure's render property is set to 'opengl'). It might be the same bug as Colin suffered. I fixed it by forcing the white text with an offset of 1 in its z coordinate, while the black text remains on the z=0 plane.

line 44 of the April 2010 version:
set(h, 'Position', [pos(1:2), 1])

5
17 Sep 2014 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 Aneesh

Aneesh (view profile)

when i converts the given colour image to hsv image and performs this matlab code on hsv image, no edge information is getting... what is the reason??

Comment only
23 Oct 2013 textborder - Higher contrast text using a 1-pixel-thick border Draws text on a figure with a 1-pixel-thick border. Author: Joao Henriques Joao Henriques

Hi Colin, I tried your code on R2012a but can't reproduce the bug.

I also developed the code on R2008b and used it with "surface" objects, of which "pcolor" is one example, and had no problems as well.

It must be a MATLAB bug in the specific version you're using. Which one is it?

Comment only
17 Oct 2013 textborder - Higher contrast text using a 1-pixel-thick border Draws text on a figure with a 1-pixel-thick border. Author: Joao Henriques Colin

Colin (view profile)

If anyone else has this trouble, here's the reason: When the function converts back to data units for the position of the offset text, for some reason Matlab sets the z value to 17.3205 (in my bug example). It doesn't do that when the entered values don't change the x and y positions, such as for the centered white text... My work around is to add a couple lines in the offset for-loop setting the z back to 0 after the unit conversion, like this:

pos = get(h(k),'Position');
set(h(k),'Position',[pos(1:2),0])

Comment only
16 Oct 2013 textborder - Higher contrast text using a 1-pixel-thick border Draws text on a figure with a 1-pixel-thick border. Author: Joao Henriques Colin

Colin (view profile)

This function works on a regular figure, but not if you are adding annotation over a pcolor plot. For some reason the four border text objects plot over the white centered one.

I've unsuccessfully tried the following modifications to the function:

1) adding an extra white centered one plotted first so that the black ones should be sandwhiched.

2) using uistack to explicitly try and tell Matlab which one to put on top.

Reversing the colors does not help. Something about the offsetting over a pcolor plot makes matlab force that text to stay on top in the plotting stack.

So unfortunately it's no use in the most likely situation I would want to add contrast to text.

Example of the bug:

pcolor(peaks)
textborder(30,30,'hello world')

2
18 Sep 2013 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 lakshmi

please give the information regarding
'color image edge detection using split gaussian function'

4
09 Aug 2013 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 Iván

Iván (view profile)

This is excellent!!
It's more than what I was looking for!
Thanks! =)

5
12 Jun 2013 disptable - Display matrix with column or row labels Displays a matrix with per-column or per-row labels. Author: Joao Henriques Jerry Gregoire

Very nice. Quick easy. saves much fprintf format hassle. Thanks

Comment only
28 Nov 2012 strjoin Joins cell array into a single string, with delimiter. Small, vectorized and fast. Author: Joao Henriques Jan Simon

Jan Simon (view profile)

Have you seen: http://www.mathworks.com/matlabcentral/fileexchange/26077-cstr2string ? This C-Mex pre-allocates the output to gain more speed. But even in pure Matlab this might be faster than expanding the input cell string:
delimiter = strrep(delimiter, '\', '\\');
s = sprintf(['%s', delimiter], c{:});

Comment only
24 Sep 2012 disptable - Display matrix with column or row labels Displays a matrix with per-column or per-row labels. Author: Joao Henriques Monica He

Thank you!

5
12 Feb 2012 disptable - Display matrix with column or row labels Displays a matrix with per-column or per-row labels. Author: Joao Henriques Joao Henriques

I'm glad you found it useful! It certainly makes console output much more appealing, that's why I shared it :)

I think what you mean in your example code is:
>>disptable(exmplematrix,S,'A|B|C|D')

Notice that S is a variable, not a string.

But you're right, there's a small bug with cell arrays. I should have tested that case better. I'm updating the file, but if you don't want to wait, it's simple: just replace iscellarray with iscellstr (it appears 2 times in the file). That's all!

Comment only
11 Feb 2012 disptable - Display matrix with column or row labels Displays a matrix with per-column or per-row labels. Author: Joao Henriques Don Isiko

Hi there ^^, just wanted to say thank you very much for this submission! It really helped make my user interface for my project softer on the eyes haha. I was just wondering however, could you also give an example of using as part of the input? I tried the following but matlab wouldn't allow it...

>>disptable(exmplematrix,'S','A|B|C|D')

Where S is a string matrix defined like so:

S={'D1' 'D2 'D3' 'D4'}
S= 'D1' 'D2' 'D3' 'D4'

But whenever I try it says:

??? Undefined function or method 'iscellarray' for input arguments of type 'cell'.

Any help available with this? I'm doing this because I want to make a string that adjust its size depending upon results i.e

Bounce 1 Bounce 2 Bounce 3

Becomes:

Bounce 1 Bounce 2

When there are only results for 2 bounces because of initial values

Thanks!!

5
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 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 :)

Comment only
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 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]);

Comment only
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 Tolga Birdal

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

Comment only
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 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).

Comment only
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 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.

Comment only
30 Jul 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 Tolga Birdal

Although it seems theoretically correct, I have tried your code with different derivatives (such as 5 point stencil and Simoncelli's 5-tap derivatives), and the results got worse.

Could you think of any cause for this problem?

Cheers,

Comment only

Contact us