Image Series Analysis: Curve fitting the pixels

Hi,
I have a series of k images of dimension m by n. The intensity of the each pixels in the image changes as a function of image number. I would like to fit each pixel in the series of k images to a simple function, but I do not know how to set up the loop.
How can I generate a pixel by pixel curve fit for the image series, and then display the results of the fit as a "map" of the fit values?
Thanks

5 Kommentare

Image Analyst
Image Analyst am 14 Okt. 2012
Does each pixel in each subsequent image change by the same factor or is every pixel doing their own thing? In other words, will you have one fitted curve for the whole image sequence, or will you have m*n curves - one fitted curve for each of the m*n pixels in the image?
Avigdor
Avigdor am 14 Okt. 2012
You raise a good and interesting point!
Each of the m*n pixels will be doing their own thing, but I will use one function to fit the each pixel series. So the fit parameters will be different for each pixel series. These parameters are what I want to "map"
It would be something if each pixel series would need their own fitting function :)
Image Analyst
Image Analyst am 14 Okt. 2012
So let's say you were fitting a quadratic and you'd have a million quadratics. So you'd then get the average quadratic. I think that this might be the same as, or darn close to, just fitting a quadratic to a 1D series which is just the mean of the whole image. In any event, it might be good enough for what you want to do. What do you really want to do? Compensate for lighting variation, like a spotlight roaming around your image, or more global lighting variations?
Avigdor
Avigdor am 15 Okt. 2012
No, it is much simpler than you imagine.
I am fitting the time course of the pixels to a simple exponential function, for a given change in parameter I apply to each image.
I need the fit parameters for each pixel to then map the parameters over a reference image.
Thanks.
Matt J
Matt J am 15 Okt. 2012
Bearbeitet: Matt J am 15 Okt. 2012
What's wrong with the approach I already outlined for you? Extract the data for each pixel, curve fit that data, then replace the data with the fitted curve.

Melden Sie sich an, um zu kommentieren.

Antworten (1)

Matt J
Matt J am 14 Okt. 2012
Bearbeitet: Matt J am 14 Okt. 2012

0 Stimmen

If you have the image series as an m x n x k array A, then you can extract the data for each m,n by
for m=1:M
for n=1:N
data=reshape( A(m,n,:) , 1,[]);
end
end
I'm not saying that's the optimal thing to do, but if you must use a loop, that's how you could do it. The optimal approach would depend on the form of the curve your fitting with.

2 Kommentare

Avigdor
Avigdor am 14 Okt. 2012
Thanks for the tip! Yes, this would be the first step, but it isn't so much arranging the data that is the problem for me, it's the looping over the data to perform the fit.
Once you have generated data, how would you go about looping to perform the fit for each m over k and each n over k, then mapping to the image?
Matt J
Matt J am 14 Okt. 2012
Bearbeitet: Matt J am 14 Okt. 2012
You would/could use the same loop you use to extract the data, but store the fitted curve to another matrix B
for m=1:M
for n=1:N
data=reshape( A(m,n,:) , 1,[]);
B(m,n,:)=reshape( mycurvefitFunction(data) ,1,1,[]);
end
end

Melden Sie sich an, um zu kommentieren.

Kategorien

Mehr zu Get Started with Curve Fitting Toolbox finden Sie in Hilfe-Center und File Exchange

Gefragt:

am 14 Okt. 2012

Community Treasure Hunt

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

Start Hunting!

Translated by