#include "Ltimgcor.h"

L_LTIMGCOR_API L_INT L_UnWarp(pInputBitmap, pOutputBitmap, pPoints, uFlags)


pointer to a bitmap handle

pBITMAPHANDLE pOutputBitmap;

pointer of a pointer to a bitmap handle

L_POINT pPoints;

pointer to an array of structures

L_UINT uFlags;


Removes the distortion in an image of a cylindrical object, as if removing a label from off of the cylinder and flattening it out.




Pointer to the input bitmap handle


Pointer of a pointer to the output bitmap handle


Pointer to an array of L_POINT structures that represents the locations of the input points on the distorted image


Reserved for future use


SUCCESS The function was successful.
< 1 An error occurred. Refer to Return Codes.


Typically, this function is used in preprocessing images from digital cameras. This function requires an array of 8 points. An Invalid Parameters Exception will be thrown if no array of 8 points is passed. The following image shows the use of this function to flatten a label from a pill bottle. The numbers on the label represent the points in the array. The four corners (1, 2, 3, and 4) are fixed points. The interior points on the label (5, 6, 7, and 8) are the ones that are moved to flatten the image.

Use the L_UnWarp function if the image contains a distortion of a cylindrical object. Use the L_ManualPerspectiveDeskew, L_PerspectiveDeskew, or L_Keystone function if there is a planar deformation along all three axes. Use the L_DeskewBitmap function if there is deformation along both the x- and y- axes.

This function supports 24- and 36-bit color images, 8-bit grayscale images, and 1-bit binarized images.

This function supports signed/unsigned 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.


Win32, x64, Linux.

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 API Help