[vtkusers] perspective image transformation
martin.affolter at ntb.ch
Wed Aug 10 06:25:07 EDT 2011
I've been reading and experimenting with textures and how to map them on planar surfaces. The goal is to map a certain (sub-)area (e.g. quadrangle) from an image onto a planar polygon (also quadrangle), which I achieved so far by defining the normalized textureCoords for each point in the polygon. The problem I'm facing is that the resulting texture appears distorted. So here my two questions:
1. is there a way to apply a perspective image-transformation (conserving straight lines) before using the image for texturing? This way I imagine the distortion should disappear because the subimage and the polygon would have the same shape and ratio. (analogy in OpenCV: warpImage(...))
2. is there a class that calculates the perspective transformation matrix (3x3) from corresponding image-points? (analogy in OpenCV: getPerspectiveTransform(...))
Any help or alternative suggestions are welcome.
PS: I've attached my result. Not sure if it will come through...
-------------- next part --------------
A non-text attachment was scrubbed...
Size: 89709 bytes
More information about the vtkusers