Derivative of $P^{-1}HP$ w.r.t. $H$

50 Views Asked by At

Is there a matrix expression for $\frac{d}{dH}P^{-1}HP$ (for constant square matrix $P$)?

Background (if necessary)

I seek to design an objective function (and its gradient) over the 8D space of image homographies (in computer vision sense), which are 3x3 matrices such that:

$$H\mathbf{x}=\begin{bmatrix}h_{11}&h_{12}&h_{13}\\h_{21}&h_{22}&h_{23}\\h_{31}&h_{32}&1\end{bmatrix}\begin{bmatrix}x\\y\\1\end{bmatrix}=w\begin{bmatrix}x'\\y'\\1\end{bmatrix}=w\mathbf{x'}$$

where $x$ and $y$ are input coordinates and $x'$ and $y'$ are transformed (output) coordinates, and $w$ is a meaningless variable.

In designing this objective function I seek to apply penalties to distortions, rotations, and scalings of an object while avoiding penalizing translation. So I might consider the following objective function:

$$f(H)=\log(h_{11})^2+h_{12}^2+h_{21}^2+\log(h_{22})^2+h_{31}^2+h_{32}^2$$

which would encourage $H$ to remain close to an identity matrix excepting its last column (ignoring translation). It is also easy to find the gradient $f'(H)$ of this objective function.

I think this approach is fine for an object centered at the origin. However if the object is far from the origin, then some interaction between translation and other transformations increases. For example, for a small object positioned around $(x,y)=(100,0)$ there will not be much difference in effect of small rotations about the origin, and translation parallel to the $y$ axis.

So I feel I need to translate that object to the origin first, evaluate the above objective function there, and then reverse the original translation:

$$f_{absolute}(H)=f(P^{-1}HP)$$

where $P$ is a translation that takes the origin to the object's centroid (at least approximately). This is still easy to evaluate, but the gradient of this is what led to my question:

$$f_{absolute}'(H)=\frac{d}{dH}f(P^{-1}HP)=f'(P^{-1}HP)\frac{d}{dH}P^{-1}HP$$

1

There are 1 best solutions below

0
On BEST ANSWER

Yes it is linear so it is its own derivative, that is, if $L(H) = P^{-1} H P$ then $DL(H) \Delta = L(\Delta)$.