virtual L_INT LBitmap::Keystone(pPoints, pOutBitmap)
four polygon points to be mapped to rectangle
resultant rectified bitmap
Performs inverse perspective transformation (keystoning) on an image.
|pPoints||Pointer to L_POINT that contains four polygon points to be mapped to rectangle.|
|pOutBitmap||Pointer of pointer to the bitmap handle that represents the resultant rectified bitmap.|
The function was successful.
An error occurred. Refer to Return Codes.
Frequently, images captured by portable devices are distorted because they are projected onto a surface at an angle. Vertical lines become slanted, etc. This function maps a polygon to a rectangle (an inverse perspective transformation), and can be used to correct the perspective of such images.
The input pPoints should contain 4 polygon points. These points will become the corners of the rectangle and the rest of the pixels are shifted accordingly.
This function can only process entire images. It does not support regions.
This function supports 12 and 16-bit grayscale and 48 and 64-bit color images.
Required DLLs and Libraries
For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application.
#if defined (LEADTOOLS_V19_OR_LATER)
L_INT nRet ;
LBitmap LeadBitmap ;
nRet = LeadBitmap.Load(MAKE_IMAGE_PATH(TEXT("Master.jpg")), 0,ORDER_BGR) ;
return nRet ;
/* Apply a Keystone filter */
pBITMAPHANDLE pOutBitmap = NULL ;
L_POINT pPoints ;
pPoints.x = 94 ;
pPoints.y = 94 ;
pPoints.x = 306 ;
pPoints.y = 43 ;
pPoints.x = 318 ;
pPoints.y = 237 ;
pPoints.x = 98 ;
pPoints.y = 237 ;
nRet = LeadBitmap.Keystone(pPoints, &pOutBitmap);
#endif // LEADTOOLS_V19_OR_LATER
Medical Web Viewer .NET
.NET, Java, Android, and iOS/macOS Assemblies
C API/C++ Class Libraries