The Math Forum

Search All of the Math Forum:

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

Math Forum » Discussions » Software » comp.soft-sys.matlab

Topic: least squares on images
Replies: 0  

Advanced Search

Back to Topic List Back to Topic List  
Adam Chapman

Posts: 172
Registered: 1/12/09
least squares on images
Posted: Mar 22, 2014 6:16 PM
  Click to see the message monospaced in plain text Plain Text   Click to reply to this topic Reply

I'm trying to use least squares to minimise expression (9) :

(J,t) = argmin || tJ+(1-t)A-Irgb||^2

where t is a single channel image array (mxn), J is an RGB image (mxnx3), and Irgb is a 3-channel image (mxnx3) A is a 3x1 vector.

I'm ignoring the gradient terms in the equation from the original paper for now.

J and t can change, but Irgb and A are constant.

I'm really struggling to formulate this into a format that I can use a least squares method with.

J can be calculated from t and Irgb, so I guess I can reduce the input to just t.

This is what I've tried-

I rearranged the expression above to :

|| t(J-A) - (Irgb + A) ||^2

now If I set my input x to equal J-A, and y = (Irgb+A), I would expect y\x to return an estimate of t?

the expression is now in the form: ax-y, where a=t, x=(J-A) and y=Irgb+A;

I've listed the inputs so
x=[Jr(:)-A(1) Jg(:)-A(2) Jr(:)-A(3)];
y=[I_R(:)+A(1) I_G(:)+A(2) I_B(:)+A(3)];

where I_R=I(:,:,1), I_G=I(:,:,2) and I_B=I(:,:,2)

y\x is actually giving me a 3x3 matrix and I'm sure my formulating must be wrong somewhere, because I can't multiply my Nx1 vector x by the 3x3 matrix

If anybody can see where I've messed up it would be great if they can let me know.


Point your RSS reader here for a feed of the latest messages in this topic.

[Privacy Policy] [Terms of Use]

© The Math Forum at NCTM 1994-2017. All Rights Reserved.