uisng peaks on linescan of image as locations for polyfits.

2 views (last 30 days)
I take a horizontal linescan through an image of what should be regular spaced fluorescent beads. However due to optical distortion, at large distances from the centre, their location is different to what it should be - This is what I'm trying to measure.
So I take the linescan (red line) using the centre coordinates of the image (i.e. rows/2 and cols/2)
I then plot these and use the peakdet.m file to find the peaks. (This just finds the brightest pixel in each peak,with no fitting or interpolation)
[maxtab, mintab] = peakdet(yth_row, level);
where level is a threshold (which I just take as the mean/4, and yth_row is my linescan thru the image.
So my linescan with the found peaks are:
What I need to do is to use the peaks found by peakdet (i.e. maxtab) and perform some sort of fit (polynomial of order 5) around each peaks and include say 3 pixels each side of this peak. Then use the max in this fit to give the "real" locations of the each peak with sub-pixel resolution.
This is where I am stuck.
(maxtab(:,1) is the vector of x locations of the peaks, and maxtab(:,2) is the actual y value of them.
Any help would be appreciated.

Answers (1)

Image Analyst
Image Analyst on 3 Nov 2015
Actually I'm not seeing any noticeable distortion in that image. Is there any? Pincushion or barrel? Anyway, see my attached demos of polyfit() and spline().
  14 Comments

Sign in to comment.

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!