Trying to set-up my point cloud based virtual studio with the gift of real-time captured textures.
For that, I need to turn the original camera image into a straight front view of various objects.
I tried using the various Homography nodes and using the resulting Matrix to transform textures. The results were rather strange. With the transformation being limited to a sort of skew. I’ll try to grab a screenshot soon.
I tried various corner ordering, eventually settling for that from the Homography help patch.
I also attempted modifying the UV coordinates in the Dynamic mesh example IIRC, but the stretching was only applied per-triangle.
Probably missing some detail here, maybe need to apply homography to camera instead of texture but could definitely use some tips so I don’t waste time next time I get around to it.
i don’t think this is feasible just using a 2D (texture) transform as your scene objects are 3-dimensional (and probably not aligned in a plane) and therefore need different stretchings.
from your point of view the red part should probably disappear (being perpendicular to the wanted “virtual” position) while the yellow part would need some stretching.
you’d probably need some reprojection approach where you need a 3D geometry representation of your scene, virtually project the image on them from the correct position onto the scene and recapture it from the intended position.
the “Calibrate a projector and Reproject” patches from VL.OpenCV should give you and idea how to do it. (VL.Badmapper also appears to have a similar patch but I’m not familiar with that).
Hey @motzi, thanks so much for the answer, I loved how you built on top of the illustration :D
It does seem like that might be the way to go in situations with considerable lens warping or when the goal is to have a full 3D representation with a dynamic texture.
I did give Homography another go before delving into OpenCV or Badmapper, and it does seem to work actually. Based on the included Homography example, I’ve created this patch that stretches target points to full view using a Transform applied on a QuadRenderer.