I'm sorry if it has been ask before but I couldn't find the proper answer to my question.
For a better understanding, let me briefly explain the context of my problem
Context
I have two images (A and B) with non planar object on it. I would like to be able to take the coordinate of a pixel pA from A and project it into B. Since my scene is not planar, I can't use homography. What I want to do is first project my pixel pA into the 3D world and then project the result into the image B to get pB. pA (2D) -> pWorld (3D) -> pB (2D). Fortunately, I know the coordinate z of pworld. My question concerns the first step pA (2D) -> pWorld (3D).
Question
How to project my 2D point pA (u,v) into the world (pWorld=(X,Y,Z)), Z being given? I also have the extrinsic matrix Rt (3x4) and the intrinsic matrix K (3x3) of my camera.
What I tried
I know that :
s*(u v 1)' = K * Rt * (X Y Z)' [1]
s is the scale. But I would like to have the opposite process, Z being given. Something like:
(X Y) = SOMETHING * (u v)
I can rewrite [1] to get
s*(u v 1/s 1/s)' = G * (X Y Z 1)'
with G = (l1 l2 l3 l4) (l means line)
l1 = first line of (K*Rt)
l2 = second line of (K*Rt)
l3 = 0 0 1/Z 0
l4 = 0 0 0 1
G is invertible and I can then have
(X Y Z 1)' = inv(G) * (us vs 1 1)'
But I can't use that since I don't know the scale. I think I'm a bit confused concerning this scale thing. I know usually we normalized to get rid of it but here, I can't.
Maybe that's not the good way to proceed. If someone can explain me the good way, I would be really glad to hear about it.
Thank you in advance.