Transformation of discrete, quadratic optimization problem into system of linear equations

23 Views Asked by At

I am reading the paper Poisson Image Editing by Pérez, Gangnet and Blake. On page 3, they derive a discrete quadratic optimization problem:

$$\min_f \sum_{\left\langle p, q\right\rangle \cap \Omega \neq \emptyset} (f(p) - f(q) - v_{pq})^2 \text{ with } f(p) = f^\star(p) \text{ on } \partial \Omega$$

which, without giving a justification or reference, they turn into a system of linear equations:

$$\forall p \in \Omega: \left|N_p\right| f(p) - \sum_{q \in N_p \cap \Omega} f(q) = \sum_{q \in N_p \cap \partial \Omega} f^\star(q) + \sum_{q \in N_p} v_{pq}$$

I am not very familiar with discrete or nonlinear optimization, so I have no clue what is going on here. Is this obvious to someone familiar with the topic? Can anyone point me in the right direction?