In the context of visual tracking and video processing I need to estimate variations of the orientation related to the angular velocity. I am trying to calculate the Jacobian matrix of a quaternion $\vec{q}_k$ respect to its (supposed to be constant) angular velocity $\vec{\omega}$.
$$\frac{\partial \vec{q}_k}{\partial \vec{\omega}}(\vec q_{k-1})$$
I found a method that uses the chains rule:
$$\frac{\partial \vec{q}_k}{\partial \vec{\omega}} = \frac{\partial \vec{q}_k}{\partial \vec{qwt}}(\vec q_{k-1}) \frac{\partial \vec{qwt}}{\partial \vec{\omega}} $$
where $\vec{qwt}$ is the quaternion form of the angular velocity. The first matrix is calculated with a matrix like this, where $q$ components are from $\vec q_{k-1}$
$$\frac{\partial \vec{q}_k}{\partial \vec{qwt}}(\vec q_{k-1})=\begin{pmatrix} q_w&-q_z &q_y &q_x \\q_z&q_w &-q_x &q_y\\-q_y&q_x &q_w &q_z\\-q_x&-q_y &-q_z &q_w \end{pmatrix}$$
I didn't find how to calculate the secon partial. It looks more tricky. Any ideas about how to start?