Rank: 61 based on 620 downloads (last 30 days) and 14 files submitted
photo

David Young

E-mail
Company/University
University of Sussex
Lat/Long
50.86579132080078, -0.086335003376007

Personal Profile:
Professional Interests:
Image Processing

 

Watch this Author's files

 

Files Posted by David View all
Updated   File Tags Downloads
(last 30 days)
Comments Rating
09 Dec 2011 Screenshot Image correspondences using cross-correlation Find matching features in pairs of images using normalised cross-correlation: class file and demo. Author: David Young image analysis, optic flow, optical flow, stereo vision, image registration, image matching 135 14
  • 5.0
5.0 | 4 ratings
09 Dec 2011 Screenshot Affine optic flow Estimates the parameters of an affine (first-order) optic flow model from two images. Author: David Young optical flow, image motion, active vision, logpolar, affine, foveal vision 66 5
  • 5.0
5.0 | 2 ratings
09 Dec 2011 Image gradients with Gaussian smoothing Image grey-level gradients are estimated using Gaussian smoothing followed by differencing. Author: David Young image processing, image smoothing, gaussian smoothing, gradients, first derivative 17 0
07 Dec 2011 Screenshot Extended Brookshear Machine emulator and assembler Emulator and assembler for a simple computer, a teaching aid for computer science courses. Author: David Young machine code, assembler, gui, education, teaching, emulator 11 0
29 Sep 2011 A multidimensional map class MapN provides a map class similar to containers.Map, but with multidimensional keys. Author: David Young map, container, containers, memoize, containersmap, oop 7 0
Comments and Ratings by David View all
Updated File Comments Rating
21 Feb 2012 Log-polar image sampling Resamples an image from a conventional grid to a log-polar grid, and back. Author: David Young

Hi Gomathy. Measuring small rotations is difficult, but you could try my affine optic flow estimator at http://www.mathworks.co.uk/matlabcentral/fileexchange/27093-affine-optic-flow If you have difficulty with it, please let me know.

17 Feb 2012 Log-polar image sampling Resamples an image from a conventional grid to a log-polar grid, and back. Author: David Young

Hi Gomathy. Your code is almost OK. One problem is that you have chosen very small rotations to test, so it is hard to see if the results are right. Instead of fractions of a degree, try using many degrees, so that you can tell if there's a big error or just a small inaccuracy.

The second problem is that your conversion from the y-coordinate of the correlation peak to an angle is not correct. Remember that the number of wedges is just a full circle, so in your case a change of 500 in the y-coordinate corresponds to 360 degrees or 2*pi radians. If you use this, then the code works.

Here is my test code, based on yours, but simplified to make it easier to analyse.

 Iref = imread('cameraman.tif');
 deg = 73;
 I = imrotate(Iref, deg, 'bilinear', 'crop');

 rmin = 5;
 rmax = 125;
 nw = 500;
 xc = size(Iref, 2)/2;
 yc = size(Iref, 1)/2;

 lp_Iref = logsample(Iref, rmin, rmax, xc, yc, [], nw);
 lp_I = logsample(I, rmin, rmax, xc, yc, [], nw);

 cc = normxcorr2(lp_I, lp_Iref);
 [max_cc, imax] = max(cc(:));
 [ypeak, xpeak] = ind2sub(size(cc), imax)

 drot = 360 * (ypeak - nw) / nw % prints 72.72 for initial deg=73

The choice of the parameters is up to you - you seem to have chosen good ones for this problem.

24 Dec 2011 Hough transform for circles A Hough transform function for detecting circles, optimised to allow search over radii. Author: David Young

Hi Ivan, thanks for the comment. If you set npeaks to 1, you will get the circle with the strongest evidence. If that is not the right circle, then you will need additional code to select the circle you want, using some other selection criteria, such as radius or position.

06 Dec 2011 Log-polar image sampling Resamples an image from a conventional grid to a log-polar grid, and back. Author: David Young

Yeoh cs: There are no general rules for setting those parameters. It depends on the original image and the purpose of doing the transform.

rmax determines the "field of view" of the transform. That is, it gives the radius of the region of the original image that is sampled.

nw determines the resolution at the outside ring. If you want to capture the full detail of the original image, with one transform pixel for each original pixel, you need to make nw equal to 2*pi*rmax. However, this results in massive oversampling nearer the centre, so you may want a smaller value.

I normally set only one of rmin and nr, and allow the other to default, so that the pixels in the sampled image have an aspect ratio of 1. There is always a "hole" at the centre of a log-polar image, and rmin determines how big this hole is. Near the centre of the log-polar image the original image is grossly oversampled, and the smaller rmin is, the worse this is.

In the end though, you have to look at what you are using the log-polar image for, and use either theoretical arguments or empirical tests to decide the parameters.

18 Nov 2011 Log-polar image sampling Resamples an image from a conventional grid to a log-polar grid, and back. Author: David Young

Yeoh cs: I'm sorry, but I have not written a tutorial on the use of this transform, and there isn't room to write one here. There are many papers on applications of log-polar transforms, and it would be best to start with those and then ask specific questions on MATLAB Answers.

Comments and Ratings on David's Files View all
Updated File Comment by Comments Rating
10 May 2012 Hough transform for circles A Hough transform function for detecting circles, optimised to allow search over radii. Author: David Young James

Gracias David Young por este algoritmo, me ayudo mucho para detectar comprimidos en un blister,

03 May 2012 Log-polar image sampling Resamples an image from a conventional grid to a log-polar grid, and back. Author: David Young Bharath

Hello David,

Do you know how to find the image point corresponding a point in the log-polar transformed space? Is there an easy way to do it?

26 Mar 2012 Log-polar image sampling Resamples an image from a conventional grid to a log-polar grid, and back. Author: David Young Janaka

Hi David
Thanks for your submission. I have been following your answers and submissions and they all are very useful. Greatly appreciate your work.

I am trying to use imrotate for checking the rotation between two image frames (1024x1024 int16) coming from HH and HV polarized antennas of a marine radar. They are 16-bit data (comes as Matlab matrices) and the HV is rotated w.r.t HH. I tried to use the above piece of code but first I tried with the rotation of HH w.r.t. itself but drot always comes as 0. Is it due to the data? Should this valid for int8 only? Here is the modified code I used. Greatly appreciate your reply.

HHdble=double(HH);
HVdble=double(HV);

Iref = HHdble;
deg = 10;

 I = imrotate(Iref, deg, 'bilinear', 'crop');
 rmin = 5;
 rmax = 512; %%125;
 nw = 512;
 xc = size(Iref, 2)/2;
 yc = size(Iref, 1)/2;
 lp_Iref = logsample(Iref, rmin, rmax, xc, yc, [], nw);
 lp_I = logsample(I, rmin, rmax, xc, yc, [], nw);
 cc = normxcorr2(lp_I, lp_Iref);
 [max_cc, imax] = max(cc(:));
 [ypeak, xpeak] = ind2sub(size(cc), imax)
 drot = 360 * (ypeak - nw) / nw %% comes as '0' .

24 Feb 2012 Log-polar image sampling Resamples an image from a conventional grid to a log-polar grid, and back. Author: David Young Gomathy

Thanks David.

21 Feb 2012 Log-polar image sampling Resamples an image from a conventional grid to a log-polar grid, and back. Author: David Young Young, David

Hi Gomathy. Measuring small rotations is difficult, but you could try my affine optic flow estimator at http://www.mathworks.co.uk/matlabcentral/fileexchange/27093-affine-optic-flow If you have difficulty with it, please let me know.

Top Tags Applied by David
image processing, filtering, image analysis, convolution, 2d
Files Tagged by David View all
Updated   File Tags Downloads
(last 30 days)
Comments Rating
09 Dec 2011 Screenshot Image correspondences using cross-correlation Find matching features in pairs of images using normalised cross-correlation: class file and demo. Author: David Young image analysis, optic flow, optical flow, stereo vision, image registration, image matching 135 14
  • 5.0
5.0 | 4 ratings
09 Dec 2011 Screenshot Affine optic flow Estimates the parameters of an affine (first-order) optic flow model from two images. Author: David Young optical flow, image motion, active vision, logpolar, affine, foveal vision 66 5
  • 5.0
5.0 | 2 ratings
09 Dec 2011 Image gradients with Gaussian smoothing Image grey-level gradients are estimated using Gaussian smoothing followed by differencing. Author: David Young image processing, image smoothing, gaussian smoothing, gradients, first derivative 17 0
07 Dec 2011 Screenshot Extended Brookshear Machine emulator and assembler Emulator and assembler for a simple computer, a teaching aid for computer science courses. Author: David Young machine code, assembler, gui, education, teaching, emulator 11 0
29 Sep 2011 A multidimensional map class MapN provides a map class similar to containers.Map, but with multidimensional keys. Author: David Young map, container, containers, memoize, containersmap, oop 7 0

Contact us at files@mathworks.com