1
$\begingroup$

Here is my problem:

I have an image divided into segments. Each segment consists of pixels with coordinates (x,y) called vector $v$, each pixel has a length 3 vector RGB called $I(v)$. I want to find an affine matrix (3x3) $A$ which minimises $I(v) - A[v^T 1]^T$, however not just for the pixel, but for the whole segment. This means that the minimisation equation becomes $\sum\limits_{v \in segment}||I(v) - A[v^T 1]^T ||^2$.

How would I go about minimising this? Preferably with functions in numpy/scipy or similar (e.g. MATLAB/Octave).

  • 0
    What is an affine matrix? What is a segment? What does the notation $[v^T 1]^T$ mean (I would interpret $1$ as a vector of ones, which would mean that $v^T1$ is a scalar, which would mean the transpose is superfluous)?2012-05-29
  • 0
    a segment is a portion of the image. the notation $[v^T 1]^T$ is the homogeneous version of $[x y]$ i.e. $[x y 1]^T$. An affine matrix is a matrix which represents an affine transformation. in this case a 3x3 with a 1 in the bottom right corner.2012-05-29
  • 0
    Assuming that a segment is a finite set, then this is just least squares in $\mathbb{R}^8$.2012-05-29
  • 0
    Could you explain what you mean?2012-05-29
  • 0
    The bottom-right corner of $A$ is the value of the blue channel of pixel $(0,0)$; I'm pretty sure you don't need a $1$ there. Also, you should perform minimization on each colour channel independently, as you'll get the same answer.2012-05-29
  • 0
    After the action of the matrix $A$, are you looking at mapping back to $\mathbb{R}^2$ by $[x,y,z]\mapsto[x/z,y/z]$?2012-05-29

1 Answers 1