For the following formula solving for world coordinates [X Y Z]:
$eq.(1)\begin{bmatrix} X \\ Y \\ Z \\ \end{bmatrix} = R^{T}\begin{bmatrix} u\\ v \\ 1 \\ \end{bmatrix} -R^{T}t $
Where R' is R$^{T}$, Wworld is $\begin{bmatrix} X\\ Y \\ Z \\ \end{bmatrix}$ Wcam is $\begin{bmatrix} u\\ v \\ 1 \\ \end{bmatrix}$ and tvec is a 3 x 1 mat called t, is it okay to code the minus as shown below?
$Wworld = R' Wcam -(R't) $
Wworld = R.transpose()* Wcam - (R.transpose() * tvec)
Is this Python? If so, then you'll need to call the transpose function as
np.transpose(R)rather than the way you have it written. To save operations, you may also want to factor out the $R^T$ and compute it as follows:I am assuming this whole time you have the line
import numpy as npearlier in your code. Other than the way you're calling the transpose function, your way is correct too.