TIEVisionImage.perspectiveTransform
Declaration
procedure perspectiveTransform(dest: TIEVisionImage; matrix: TIEVisionImage); safecall;
Description
Perform a perspective image (matrix) transformation of vectors.
| Parameter | Description |
| dest | Container for the resulting image |
| matrix | 3x3 or 4x4 floating-point transformation matrix |
Example
// Load test image
ImageEnView1.IO.LoadFromFile( 'D:\TestImage.jpg' );

// Find where a point on the original image is positioned after applying a homography (e.g. as used with warpPerspective)
hmat := IEVisionLib().createMath().findHomography( srcPoints, dstPoints, ievREGULAR );
// Points are stored as a 1 row, 2 channel float image of x,y pairs
ptsIn := IEVisionLib().createImage( 1, 1, ievFLOAT32, 2 );
pIn := ptsIn.getScanline( 0 );
pIn[0] := 200;
pIn[1] := 150;
ptsOut := IEVisionLib().createImage();
ptsIn.perspectiveTransform( ptsOut, hmat );
pOut := ptsOut.getScanline( 0 );
ShowMessage( Format( '200,150 => %.1f,%.1f', [ pOut[0], pOut[1] ]));
// Grid points (green) and a selected point (red) mapped onto the warped image