ImageDisplacements
provides a way to calculate the displacements between two images (e.g for optical flow purposes) and return a two channel image containing the dx,dy displacements.
What should I do if I already have a two channel image of displacements and want to warp an existing image? i.e how can I use an image to warp another image?
Suppose I have this warped image newimg
:
... which originally came from:
testimg = ImageResize[ExampleData[{"TestImage", "House2"}], 512];
Without knowing the transformation, but given an optical flow image:
ImageAdjust@Image[
First@ImageDisplacements[{testimg, newimg}]
]
... how can I use this to "unwarp" the distorted image efficiently back into something resembling the original?