Search All of the Math Forum:

Views expressed in these public forums are not endorsed by NCTM or The Math Forum.

Notice: We are no longer accepting new posts, but the forums will continue to be readable.

Topic: Intensity correction using least-squares non-linear approximation question
Replies: 11   Last Post: Jul 5, 2012 12:06 PM

 Messages: [ Previous | Next ]
 K M Posts: 17 Registered: 4/26/12
Re: Intensity correction using least-squares non-linear approximation question
Posted: Jul 5, 2012 5:16 AM

"Bruno Luong" <b.luong@fogale.findmycountry> wrote in message <jsvqi3\$otd\$1@newscl01ah.mathworks.com>...
> "K M" wrote in message <jsvom2\$ikn\$1@newscl01ah.mathworks.com>...
>

> >
> > I is the image to be transformed and thus X in the MATLAB lsqcurvefit syntax.

>
> 1_ Fine, but where do you declare it (I) in cost? Did you want I to be x_data?
>
> 2) If you want to solve least-square equality: y_data = a*x_data + b,
>
> then just do
> P = [ones(numel(xdata,1) xdata(:)] \ y_data(:);
> a = P(2); b = P(1);
>
> 3) But I still don't think that's the correct way to formulate the matching intensity. The unknown affine transform is operated on the input space of the histogram, not the output values; which is entirely different.
>
> Bruno

My apologies Bruno. I have spotted a rather big typo. The function is F = cost(val,I)) and not F = cost(val,xo,x_data,y_data).

I wanted the probability density function of I to be x_data so that the function would find a linear transformation for I such that its histogram matches y_data.

I think your comment in point 3 describes why it is not working. However, I was under the impression that by stipulating the histogram of I to be x_data and by defining the function as I did, lsqcurvefit would find the parameters such that

hist(fun(I)) is approximately hist(J) and thus does operate on the input space ?

Date Subject Author
6/26/12 K M
6/27/12 ImageAnalyst
7/3/12 K M
7/3/12 Bruno Luong
7/3/12 K M
7/3/12 Bruno Luong
7/5/12 K M
7/5/12 Bruno Luong
7/5/12 K M
7/5/12 Bruno Luong
7/5/12 K M
7/5/12 K M