LBitmap::ManualPerspectiveDeskew

#include "ltwrappr.h"

virtual L_INT LBitmap::ManualPerspectiveDeskew(InPoints, ppOutBitmap)

pMANUALPERSPECTIVEDESKEWPOINTS InPoints;

pointer to Manual3DDeskewPoints structure

pBITMAPHANDLE* ppOutBitmap;

pointer of pointer to bitmap handle

Corrects the view perspective.

Parameter Description
InPoints Pointer to Manual3DDeskewPoints structure that contains a list of points to be transformed to match the location of the mapped points list.
ppOutBitmap Pointer of pointer to bitmap handle that contains the deskewed image.

Returns

SUCCESS

The function was successful.

< 1

An error occurred. Refer to Return Codes.

Comments

Typically, this function is used as a step in preprocessing images from digital cameras.

It changes the image based on a perspective view equation. It takes the depth of the objects into account as well as their relative dimensions.

This function can change the specified image. To keep the original image unchanged, use this function on a copy.

It is best to choose input points that are far away from each other.

Use this function or LBitmap::PerspectiveDeskew if there is deformation along all three axes. Use the LBitmap::Deskew if there is deformation along the x- and y- axes.

This function can only process entire images. It does not support regions.

This function supports 24 and 36-bit color images and 8 and 16-bit grayscale images.

This function supports signed/unsigned images.

Required DLLs and Libraries

LTDIS
LTFIL
LTIMGCOR

For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application.

Platforms

Win32, x64.

See Also

Functions:

LBitmap::PerspectiveDeskew, LBitmap::Deskew, LBitmap::AlignImages, LBitmap::Keystone, Class Members

Example

#define MAKE_IMAGE_PATH(pFileName) TEXT("C:\\Users\\Public\\Documents\\LEADTOOLS Images\\")pFileName 
L_INT LBitmap__ManualPerspectiveDeskewFilterBitmapExample(L_VOID) 
{ 
   L_INT nRet ; 
   LBitmap LeadBitmap ; 
   nRet = LeadBitmap.Load(MAKE_IMAGE_PATH(TEXT("cannon.jpg")), 0,ORDER_BGR); 
   if(nRet !=SUCCESS) 
      return nRet; 
   int Width = LeadBitmap.GetWidth(); 
   int Height = LeadBitmap.GetHeight(); 
   /* Apply manual perspective deskew filter to move down the top right corner by half of the image height*/ 
   MANUALPERSPECTIVEDESKEWPOINTS manual3ddeskewpoints ; 
   manual3ddeskewpoints.InputPoints[0].x = 0        ; manual3ddeskewpoints.InputPoints[0].y   =  0 ; 
   manual3ddeskewpoints.InputPoints[1].x = Width-1  ; manual3ddeskewpoints.InputPoints[1].y   =  0 ; 
   manual3ddeskewpoints.InputPoints[2].x = 0        ; manual3ddeskewpoints.InputPoints[2].y   =  Height-1 ; 
   manual3ddeskewpoints.InputPoints[3].x = Width-1  ; manual3ddeskewpoints.InputPoints[3].y   =  Height-1 ; 
   manual3ddeskewpoints.MappingPoints[0].x = 0        ; manual3ddeskewpoints.MappingPoints[0].y =  0 ; 
   manual3ddeskewpoints.MappingPoints[1].x = Width-1  ; manual3ddeskewpoints.MappingPoints[1].y =  Height/2 ; 
   manual3ddeskewpoints.MappingPoints[2].x = 0        ; manual3ddeskewpoints.MappingPoints[2].y =  Height-1 ; 
   manual3ddeskewpoints.MappingPoints[3].x = Width-1  ; manual3ddeskewpoints.MappingPoints[3].y =  Height-1 ; 
   pBITMAPHANDLE pOutBitmap = NULL; 
   nRet = LeadBitmap.ManualPerspectiveDeskew(&manual3ddeskewpoints, &pOutBitmap); 
   return nRet; 
} 

Help Version 19.0.2017.10.27
Products | Support | Contact Us | Copyright Notices
© 1991-2017 LEAD Technologies, Inc. All Rights Reserved.
LEADTOOLS Raster Imaging C++ Class Library Help