SPImage.h File Reference
Detailed Description
SignWare Dynamic Development toolkit, static image object.
- Author:
- uko
SPImage object
The SPImage object implements a representation of a static image. The image may be loaded from a color, a gray-scale or a black-and-white image, most image formats can be read, such as tiff, jpeg, png, gif and many more.The SPImage object can load indexed color images, however the saved image will be converted to a true color image.
The SPImage object includes methods to perform signature cleaning (see Static Image cleaning), cleaning funtionality is optimized for signature snippets which are typically gray-scale or black-and-white regions of a scanned image that include the handwritten signature. Cleaning methods cannot be applied to color images.
The SPImage object contains methods to draw text, rectangles or images on the target image, e. g. to dynamically compose a tablet background image.
- Note:
- All cleaning functions allow a maximum image size of 1280 * 960 pixel. This also affects SPImageGetComplexity and SPImageInvert when using the flag SP_INVERT_ENGINE.
Static Image cleaning
Static image cleaning is optimized for signature snippets. Cleaning other images such as photographs might not produce the expected results. Cut the signature region whenever possible. Any elements that are not relevant to a signature might have negative effects on the cleaning process and signature verification.The cleaning functions provided here include:
- SPImageBinarize binarize the image, convert to a black-and-white image
- SPImageCleanDate remove handwritten text such as date etc.
- SPImageCleanFrames remove regions which might not belong to a signature
- SPImageCleanLines remove horizontal lines
- SPImageCleanSignature remove horizontal, printed text and dirt
- SPImageInvert invert the image
- SPImageMirror mirror the image at the horizontal and/or vertical axis
- SPImageRegion cut a region of the image
- SPImageRotate rotate the image in multiples of 90 degrees
Some cleaning functions are performed on black-and-white images, they are based on algorithms implemented in the static compare engine. Gray-scale and color images will be binarized, cleaned and the resulting black-and-white image will be used as a mask on the gray-scale or color image. The visible impact is that the background of the resulting gray-scale or color images will be cleaned while maintaining the gray and color levels of the signature. Please note that the image polarity (black text on white background) is essential for the masking process. It is recommended to call SPImageInvert (passing SP_INVERT_AUTO) first. The temporary binarization uses the default method and threshold (see SPImageSetDefaultBinarizeParams) and calls SPImageBinarize.
Some cleaning functions will resize the resulting image. Don't assume that the image size won't change, always retrieve the image size (see SPImageGetSize) if needed.
The resulting image will not be resized if the resulting image becomes empty, an empty image will thus have the size of the original image with all pixels set to 255 (white).
SPImageCleanBatch is optimized for batch mode operation where a set of images is to be cleaned using the same parameters. Interactive cleaning normally accesses the cleaning functions directly.
If you call SPImageCleanBatch, each of the above cleaning functions must be enabled separately with SPCleanParameterAppendEnableFlag, please see the sample code below.
The order of processing is determined by the order of appending the associated enable flags, but for speed reasons, these functions are always called first, according to the order of the enable flags:
- SPImageBinarize binarize the image, convert to a black-and-white image
- SPImageInvert invert the image, only called first if SP_INVERT_ENGINE is not set
- SPImageMirror mirror the image
- SPImageRegion cut a region from the image
- SPImageRotate rotate the image
Cleaning function | Enable flag | Required Parameters |
SPImageBinarize | SP_BINARIZE_ENABLE | SPINT32 SP_BINARIZE_THRESHOLD, SPINT32 SP_BINARIZE_METHOD |
SPImageCleanDate | SP_CLEAN_DATE_ENABLE | -- |
SPImageCleanFrames | SP_CLEANFRAMES_ENABLE | SPDOUBLE SP_CLEANFRAMES_TRUST |
SPImageCleanLines | SP_CLEANLINES_ENABLE | -- |
SPImageCleanSignature | SP_CLEAN_SIGNATURE_ENABLE | -- |
SPImageGetSignatureRegion | SP_CUT_SIGNATURE_REGION_ENABLE | -- |
SPImageInvert | SP_INVERT_ENABLE | SPINT32 SP_INVERT_FLAGS |
SPImageMirror | SP_MIRROR_ENABLE | SPINT32 SP_MIRROR_AXES |
SPImageRegion | SP_CUT_REGION_ENABLE | SPINT32 SP_CUT_REGION_TOP, SPINT32 SP_CUT_REGION_LEFT, SPINT32 SP_CUT_REGION_BOTTOM, SPINT32 SP_CUT_REGION_RIGHT |
SPImageRotate | SP_ROTATE_ENABLE | SPINT32 SP_ROTATE_ANGLE |
Cleaning functions using the static engine require a license for cleaning.
- Note:
- Dynamic signatures do not require cleaning as they are clean per se. You should not save dynamic signatures as static images but rather render dynamic signatures into static images whenever required, else important biometric features might be lost (static images cannot save the dynamic features of a signature).
int cleanImage(pSDKIMAGE_T pImage) { pSDKCLEANPARAMETER pParams = 0; int rc; rc = SPCleanParameterCreate(&pParams); if(rc != SP_NOERR) return rc; SPCleanParameterAppendEnableFlag(pParams, SP_INVERT_ENABLE); SPCleanParameterSetInt(pParams, SP_INVERT_FLAGS, SP_INVERT_AUTO); SPCleanParameterAppendEnableFlag(pParams, SP_CLEANLINES_ENABLE); rc = SPImageCleanBatch(pImage, pParams); SPCleanParameterFree(&pParams); return rc; }
Example (Java):
void cleanImage(SPImage pImage) throws SPSignwareException { SPCleanParameter pParams = new SPCleanParameter(); pParams.appendEnableFlag(SPImage.SP_INVERT_ENABLE); pParams.setParameter(SPImage.SP_INVERT_FLAGS, SPImage.SP_INVERT_AUTO); pParams.appendEnableFlag(SPImage.SP_CLEANLINES_ENABLE); pImage.clean(pParams); return rc; }
Defines | |
#define | SP_BINARIZE_ENABLE "SPBinarizeEnable" |
SPCleanParameter enable flag: binarize image. | |
#define | SP_BINARIZE_METHOD "SPBinarizeMethod" |
SPCleanParameter integer property: select the binarization method. | |
#define | SP_BINARIZE_THRESHOLD "SPBinarizeThreshold" |
SPCleanParameter integer property: threshold for binarization. | |
#define | SP_CLEAN_DATE_ENABLE "SPCleanDateEnable" |
SPCleanParameter enable flag: clean handwritten text. | |
#define | SP_CLEAN_SIGNATURE_ENABLE "SPCleanSignatureEnable" |
SPCleanParameter enable flag: clean signature. | |
#define | SP_CLEANFRAMES_ENABLE "SPCleanFrameEnable" |
SPCleanParameter enable flag: clean frames. | |
#define | SP_CLEANFRAMES_TRUST "SPCleanFrameTrust" |
SPCleanParameter floating-point property: trust value for cleaning frames. | |
#define | SP_CLEANLINES_ENABLE "SPCleanLineEnable" |
SPCleanParameter enable flag: clean lines. | |
#define | SP_CUT_REGION_BOTTOM "SPCutRegionBottom" |
SPCleanParameter integer property: bottom coordinate of cut region. | |
#define | SP_CUT_REGION_ENABLE "SPCutRegionEnable" |
SPCleanParameter enable flag: crop image to signature region. | |
#define | SP_CUT_REGION_LEFT "SPCutRegionLeft" |
SPCleanParameter integer property: left coordinate of cut region. | |
#define | SP_CUT_REGION_RIGHT "SPCutRegionRight" |
SPCleanParameter integer property: right coordinate of cut region. | |
#define | SP_CUT_REGION_TOP "SPCutRegionTop" |
SPCleanParameter integer property: top coordinate of cut region. | |
#define | SP_CUT_SIGNATURE 1 |
Flag to crop the image to the signature region. | |
#define | SP_CUT_SIGNATURE_REGION_ENABLE "SPCutSignatureRegionEnable" |
SPCleanParameter enable flag: crop the image to the signature region. | |
#define | SP_INVERT_AUTO 1 |
Flag to invert images automatically. | |
#define | SP_INVERT_ENABLE "SPInvertEnable" |
SPCleanParameter enable flag: invert image. | |
#define | SP_INVERT_ENGINE 2 |
Flag to request usage of the static cleaning engine instead of SignWare's own algorithms. | |
#define | SP_INVERT_FLAGS "SPInvertFlags" |
SPCleanParameter integer property: invert flags. | |
#define | SP_INVERT_NONE 4 |
Flag to cause the image not to be inverted. | |
#define | SP_MASK_AND 2 |
Mask operation: AND. | |
#define | SP_MASK_CPY 4 |
Mask operation: COPY. | |
#define | SP_MASK_MAX 6 |
Mask operation: MAX. | |
#define | SP_MASK_MIN 7 |
Mask operation: MIN. | |
#define | SP_MASK_NOTCPY 5 |
Mask operation: NOT COPY. | |
#define | SP_MASK_OR 1 |
Mask operation: OR. | |
#define | SP_MASK_XOR 3 |
Mask operation: XOR. | |
#define | SP_MIRROR_AXES "SPMirrorAxes" |
SPCleanParameter integer property: mirror axes. | |
#define | SP_MIRROR_ENABLE "SPMirrorEnable" |
SPCleanParameter enable flag: mirror image. | |
#define | SP_ROTATE_ANGLE "SPRotateAngle" |
SPCleanParameter integer property: rotation angle. | |
#define | SP_ROTATE_ENABLE "SPRotateEnable" |
SPCleanParameter enable flag: rotate image. | |
Functions | |
SPINT32 __cdecl | SPImageBinarize (pSPIMAGE_T pImage, int iMethod, int iThreshold) |
Binarize the image stored in an SPImage object. | |
SPINT32 __cdecl | SPImageBrightness (pSPIMAGE_T pImage, SPDOUBLE fGray, SPDOUBLE fGreen, SPDOUBLE fBlue) |
Change the brightness of an image. | |
SPINT32 __cdecl | SPImageCleanBatch (pSPIMAGE_T pImage, const pSPCLEANPARAMETER_T pParameter) |
Clean the image stored in an SPImage object taking parameters from an SPCleanParameter object. | |
SPINT32 __cdecl | SPImageCleanDate (pSPIMAGE_T pImage, pSPRECT_T pRcl) |
Clean handwritten text in the image stored in an SPImage object. | |
SPINT32 __cdecl | SPImageCleanFrames (pSPIMAGE_T pImage, SPDOUBLE dTrust) |
Clean frames in the image stored in an SPImage object. | |
SPINT32 __cdecl | SPImageCleanLines (pSPIMAGE_T pImage) |
Clean lines in a black-and-white or a gray-scale image stored in an SPImage object. | |
SPINT32 __cdecl | SPImageCleanSignature (pSPIMAGE_T pImage, pSPRECT_T pRcl) |
Clean the signature image stored in an SPImage object. | |
SPINT32 __cdecl | SPImageClone (pSPIMAGE_T pImage, pSPIMAGE_T *ppClone) |
Create a copy of an SPImage object. | |
SPINT32 __cdecl | SPImageContrast (pSPIMAGE_T pImage, SPDOUBLE fGray, SPDOUBLE fGreen, SPDOUBLE fBlue) |
Change the contrast of an image. | |
SPINT32 __cdecl | SPImageCreate (pSPIMAGE_T *ppImage) |
Create an empty SPImage object. | |
SPINT32 __cdecl | SPImageDrawImage (pSPIMAGE_T pImage, const char *pszXMLImage) |
Draw some images on the image stored in an SPImage object. | |
SPINT32 __cdecl | SPImageDrawObject (pSPIMAGE_T pImage, const char *pszXMLObject) |
Draw some images, texts, and rectangles on the image stored in an SPImage object. | |
SPINT32 __cdecl | SPImageDrawRect (pSPIMAGE_T pImage, const char *pszXMLRect) |
Draw some rectangles on the image stored in an SPImage object. | |
SPINT32 __cdecl | SPImageDrawText (pSPIMAGE_T pImage, const char *pszXMLText) |
Draw some text on the image stored in an SPImage object. | |
SPINT32 __cdecl | SPImageFree (pSPIMAGE_T *ppImage) |
Deallocate an SPImage object. | |
SPINT32 __cdecl | SPImageGetBitsPerPixel (pSPIMAGE_T pImage, SPINT32 *piBitsPerPixel) |
Get the number of bits per pixel of the image stored in an SPImage object. | |
SPINT32 __cdecl | SPImageGetComplexity (pSPIMAGE_T pImage, SPINT32 *piComplexity) |
Get the complexity of the static signature image stored in an SPImage object. | |
SPINT32 __cdecl | SPImageGetDefaultBinarizeParams (pSPIMAGE_T pImage, SPINT32 *piMethod, SPINT32 *piThreshold) |
Get the default method and threshold for binarizing images. | |
SPINT32 __cdecl | SPImageGetFrames (pSPIMAGE_T pImage, pSP_WEIGHTED_FRAME_T *ppFrames, SPINT32 *piFrameSize) |
Get all frames of the image stored in an SPImage object. | |
SPINT32 __cdecl | SPImageGetImageData (pSPIMAGE_T pImage, SPUCHAR **ppbImageData, SPINT32 *piImageDataLen) |
Get the image data of an SPImage object. | |
SPINT32 __cdecl | SPImageGetImageData2 (pSPIMAGE_T pImage, SPVPTR *ppbImageData, SPINT32 *piImageDataLen) |
Get the image data of an SPImage object. | |
SPINT32 __cdecl | SPImageGetPixel (pSPIMAGE_T pImage, SPINT32 iX, SPINT32 iY, SPINT32 *piGray) |
Get the gray level of a pixel of the image stored in an SPImage object. | |
SPINT32 __cdecl | SPImageGetResolution (pSPIMAGE_T pImage, SPINT32 *piResolution) |
Get the resolution of the image stored in an SPImage object. | |
SPINT32 __cdecl | SPImageGetSignatureRegion (pSPIMAGE_T pImage, SPINT32 iFlags, pSPRECT_T rclRegion) |
Get the signature region within the image stored in an SPImage object. | |
SPINT32 __cdecl | SPImageGetSize (pSPIMAGE_T pImage, SPINT32 *piWidth, SPINT32 *piHeight) |
Get the size of an image stored in an SPImage object. | |
SPINT32 __cdecl | SPImageGetSplitPositions (pSPIMAGE_T pImage, SPINT32 **ppSplits, SPINT32 *piNumSplits) |
Get possible split positions of the image stored in an SPImage object. | |
SPINT32 __cdecl | SPImageInvert (pSPIMAGE_T pImage, SPINT32 iFlags) |
Invert the image stored in an SPImage object. | |
SPINT32 __cdecl | SPImageMaskImage (pSPIMAGE_T pImage, pSPIMAGE_T pMask, pSPRECT_T pRect, int iFlags) |
Mask the image of an SPImage object with the image of another SPImage object. | |
SPINT32 __cdecl | SPImageMirror (pSPIMAGE_T pImage, SPINT32 iAxes) |
Mirror the image stored in an SPImage object. | |
SPINT32 __cdecl | SPImageRegion (pSPIMAGE_T pImage, pSPRECT_T pRcl) |
Crop the image of an SPImage object. | |
SPINT32 __cdecl | SPImageResize (pSPIMAGE_T pImage, SPINT32 iResolution, SPINT32 iAlgo) |
Resize the image. | |
SPINT32 __cdecl | SPImageRotate (pSPIMAGE_T pImage, SPINT32 iAngle) |
Rotate the image stored in an SPImage object. | |
SPINT32 __cdecl | SPImageSaveInBitmap (pSPIMAGE_T pImage, SPUCHAR **ppBitmap, SPINT32 *piBitmapLen, SPINT32 iFormat) |
Create an SPBitmap object from an SPImage object. | |
SPINT32 __cdecl | SPImageSetBitmap (pSPIMAGE_T pImage, const SPUCHAR *pbBitmap, SPINT32 iBitmapLen, SPINT32 iPage) |
Copy a bitmap into an SPImage object. | |
SPINT32 __cdecl | SPImageSetBitsPerPixel (pSPIMAGE_T pImage, SPINT32 iBitsPerPixel) |
Set the number of bits per pixel of the image stored in an SPImage object. | |
SPINT32 __cdecl | SPImageSetBitsPerPixel2 (pSPIMAGE_T pImage, SPINT32 iBitsPerPixel, SPINT32 *piColorPalette) |
Set the number of bits per pixel of the image stored in an SPImage object. | |
SPINT32 __cdecl | SPImageSetDefaultBinarizeParams (pSPIMAGE_T pImage, int iMethod, int iThreshold) |
Set the default binarization method and threshold. | |
SPINT32 __cdecl | SPImageSetEmpty (pSPIMAGE_T pImage, SPINT32 iWidth, SPINT32 iHeight, SPINT32 iGray, int iResolution) |
Clear an image. | |
SPINT32 __cdecl | SPImageSetEmpty2 (pSPIMAGE_T pImage, SPINT32 iWidth, SPINT32 iHeight, SPINT32 iGray, SPINT32 iResolution, SPINT32 iBitDepth) |
Clear an image. | |
SPINT32 __cdecl | SPImageSetPixel (pSPIMAGE_T pImage, SPINT32 iX, SPINT32 iY, SPINT32 iGray) |
Set a pixel in the image stored in an SPImage object. | |
SPINT32 __cdecl | SPImageSetReference (pSPIMAGE_T pImage, pSPREFERENCE_T pReference, int iIndex) |
Copy a signature image of an SPReference object into an SPImage object. | |
SPINT32 __cdecl | SPImageSetResolution (pSPIMAGE_T pImage, int iRes) |
Overwrite the resolution of the image stored in an SPImage object. | |
SPINT32 __cdecl | SPImageSetSignature (pSPIMAGE_T pImage, pSPSIGNATURE_T pSignature) |
Copy the image of an SPSignature object into an SPImage object. | |
SPINT32 __cdecl | SPImageSetTellerImage (pSPIMAGE_T pImage, pSPTELLERIMAGE_T pTellerImage) |
Copy the image of an SPTellerImage object into an SPImage object. | |
SPINT32 __cdecl | SPImageSetTemplate (pSPIMAGE_T pImage, pSPTEMPLATE_T pTemplate) |
Copy the image of an SPTemplate object into an SPImage object. |
Define Documentation
|
SPCleanParameter enable flag: binarize image. This enable flag is used by SPImageCleanBatch, see Static Image cleaning. The following property must be set:
|
|
SPCleanParameter integer property: select the binarization method. This property is used by SPImageCleanBatch, see Static Image cleaning, and is required by SP_BINARIZE_ENABLE. See SPImageBinarize for the meaning of the value.
|
|
SPCleanParameter integer property: threshold for binarization. This property is used by SPImageCleanBatch, see Static Image cleaning, and is required by SP_BINARIZE_ENABLE. See SPImageBinarize for the meaning of the value.
|
|
SPCleanParameter enable flag: clean handwritten text. This enable flag is used by SPImageCleanBatch, see Static Image cleaning. No properties are required.
|
|
SPCleanParameter enable flag: clean signature. This enable flag is used by SPImageCleanBatch, see Static Image cleaning. No properties are required.
|
|
SPCleanParameter enable flag: clean frames. This enable flag is used by SPImageCleanBatch, see Static Image cleaning. The following property must be set:
|
|
SPCleanParameter floating-point property: trust value for cleaning frames. This property is used by SPImageCleanBatch, see Static Image cleaning, and is required by SP_CLEANFRAMES_ENABLE. The value must be in 0.0 through 1.0. All frames whose weight is smaller than this value will be deleted.
|
|
SPCleanParameter enable flag: clean lines. This enable flag is used by SPImageCleanBatch, see Static Image cleaning. No properties are required.
|
|
SPCleanParameter integer property: bottom coordinate of cut region. This property is used by SPImageCleanBatch, see Static Image cleaning, and is required by SP_CUT_REGION_ENABLE.
|
|
SPCleanParameter enable flag: crop image to signature region. This enable flag is used by SPImageCleanBatch, see Static Image cleaning. The following properties must be set:
|
|
SPCleanParameter integer property: left coordinate of cut region. This property is used by SPImageCleanBatch, see Static Image cleaning, and is required by SP_CUT_REGION_ENABLE.
|
|
SPCleanParameter integer property: right coordinate of cut region. This property is used by SPImageCleanBatch, see Static Image cleaning, and is required by SP_CUT_REGION_ENABLE.
|
|
SPCleanParameter integer property: top coordinate of cut region. This property is used by SPImageCleanBatch, see Static Image cleaning, and is required by SP_CUT_REGION_ENABLE.
|
|
Flag to crop the image to the signature region.
|
|
SPCleanParameter enable flag: crop the image to the signature region. This enable flag is used by SPImageCleanBatch, see Static Image cleaning. No properties are required.
|
|
Flag to invert images automatically. If this flag is given to SPImageInvert, the image will be inverted only if the majority of pixels is black.
|
|
SPCleanParameter enable flag: invert image. This enable flag is used by SPImageCleanBatch, see Static Image cleaning. The following property must be set:
|
|
Flag to request usage of the static cleaning engine instead of SignWare's own algorithms. If this flag is given to SPImageInvert, inverting will be delegated to the static engine. SP_PARAMERR will be returned if the image color depth is not supported by the static engine. This flag is not supported under Linux.
|
|
SPCleanParameter integer property: invert flags. This property is used by SPImageCleanBatch, see Static Image cleaning, and is required by SP_INVERT_ENABLE. The value is a bitwise combination of these flags:
|
|
Flag to cause the image not to be inverted. If this flag is given to SPImageInvert, the image won't be inverted.
|
|
Mask operation: AND. The image will be ANDed with the mask.
|
|
Mask operation: COPY. The mask will be copied to the image.
|
|
Mask operation: MAX. For each pixel, the maximum pixel value of the image and the mask will be copied to the image.
|
|
Mask operation: MIN. For each pixel, the minimum pixel value of the image and the mask will be copied to the image.
|
|
Mask operation: NOT COPY. The inverse of the mask will be copied to the image.
|
|
Mask operation: OR. The image will be ORed with the mask.
|
|
Mask operation: XOR. The image will be XORed with the mask.
|
|
SPCleanParameter integer property: mirror axes. This property is used by SPImageCleanBatch, see Static Image cleaning, and is required by SP_MIRROR_ENABLE. The value is a bitwise combination of these values:
|
|
SPCleanParameter enable flag: mirror image. This enable flag is used by SPImageCleanBatch, see Static Image cleaning. The following property must be set:
|
|
SPCleanParameter integer property: rotation angle. This property is used by SPImageCleanBatch, see Static Image cleaning, and is required by SP_ROTATE_ENABLE. The value must be 90, 180, or 270.
|
|
SPCleanParameter enable flag: rotate image. This enable flag is used by SPImageCleanBatch, see Static Image cleaning. The following property must be set:
|
Function Documentation
|
Binarize the image stored in an SPImage object. This function turns a gray-scale image into a black-and-white image. Signature images are expected to have black strokes on white background, gray level 255 being white. This function will invert the image if the majority of pixels is black. To compute the best binarization threshold, find the gray level with the most pixels in the image histogramm, then subtract 25. That is implemented in method 1 and with a threshold of 25. This function does nothing if the image is a black-and-white image.
A typical Signature Histogram shows a peak in the region of the background level, and ideally shows a second (lower) peak at the signature gray level. The background is assumed white (gray level 255) while the signature should be black (0), the second lower peak should thus have a lower gray level than the absolute peak.
|
|
Change the brightness of an image.
The algorithm recalculates each Pixel (very generic):
|
|
Clean the image stored in an SPImage object taking parameters from an SPCleanParameter object. This is a compact call to perform any combination of cleaning, please see Static Image cleaning for details.
|
|
Clean handwritten text in the image stored in an SPImage object. For an overview of image cleaning, see Static Image cleaning. This function cleans handwritten text such as a date etc. After cleaning, the image will be cropped to the signature region. The image will not be cropped if the cleaned image is empty. If the image is a gray-scale image, this function will create a black-and-white image, clean the black-and-white image, and then mask the gray-scale image with the cleaned black-and-white image.
|
|
Clean frames in the image stored in an SPImage object. For an overview of image cleaning, see Static Image cleaning. This function removes all frames that have a weight smaller than dTrust. If the image is a gray-scale image, this function will create a black-and-white image, clean the black-and-white image, and then mask the gray-scale image with the cleaned black-and-white image.
|
|
Clean lines in a black-and-white or a gray-scale image stored in an SPImage object. For an overview of image cleaning see Static Image cleaning. If the image is a gray-scale image, this function will create a black-and-white image, clean lines in the black-and-white image, and then mask the gray-scale image with the cleaned black-and-white image.
|
|
Clean the signature image stored in an SPImage object. For an overview of image cleaning, see Static Image cleaning. This function cleans horizontal Lines, printed text, and dirt not being part of a signature. After cleaning, the image will be cropped to the signature region. The image will not be cropped if the cleaned image is empty. If the image is a gray-scale image, this function will create a black-and-white image, clean the black-and-white image, and then mask the gray-scale image with the cleaned black-and-white image.
|
|
Create a copy of an SPImage object.
|
|
Change the contrast of an image.
The algorithm recalculates each Pixel (very generic):
|
|
Create an empty SPImage object.
|
|
Draw some images on the image stored in an SPImage object. The bitdepth or this object will be preserved, e.g. the resulting image will be a gray image if you draw a colored image on a gray image.
|
|
Draw some images, texts, and rectangles on the image stored in an SPImage object.
Group assignments to calculate max font sizes are valid within the object elements defined in pszXMLObject. All prior group assignments are not considered any more.
|
|
Draw some rectangles on the image stored in an SPImage object.
Group assignments to calculate max font sizes are valid within the rectangle elements defined in pszXMLRect. All prior group assignments are not considered any more.
|
|
Draw some text on the image stored in an SPImage object.
Group assignments to calculate max font sizes are valid within the text elements defined in pszXMLText. All prior group assignments are not considered any more.
|
|
Deallocate an SPImage object. The SPImage object must have been created by SPImageCreate or SPImageClone.
|
|
Get the number of bits per pixel of the image stored in an SPImage object.
|
|
Get the complexity of the static signature image stored in an SPImage object. The returned complexity is valid only if the SPImage object contains a clean signature image.
|
|
Get the default method and threshold for binarizing images. See Static Image cleaning for details. Initially, the default binarization method is 2, the default binarization threshold is 25.
|
|
Get all frames of the image stored in an SPImage object. For an overview of image cleaning, see Static Image cleaning. This function extracts all frames and their weights from the image. Frame weights are floating-point values in the range 0.0 through 1.0. The value 0.0 identifies dirt, a value of 1.0 identifies frames that are part of a signature.
|
|
Get the image data of an SPImage object. The image data always includes one byte per pixel (8 bits per pixel). The value 255 represents the color white, 0 represents the color black. The pixel at location x, y can be obtained this way: pbImageData[y * iWidth + x]
|
|
Get the image data of an SPImage object. The image data includes one byte per pixel (8 bits per pixel) or 4 bytes per pixel(24 bits per pixel or 32 bits per pixel). The value 255 (or 0xffffff for true color images) represents the color white, 0 represents the color black. The pixel at location x, y can be obtained this way: if(iBpP <=8) char agPix = ((char *)pbImageData)[(y * iWidth + x)] else int aiPix = ((int *)pbImageData)[(y * iWidth + x)]
|
|
Get the gray level of a pixel of the image stored in an SPImage object.
|
|
Get the resolution of the image stored in an SPImage object.
|
|
Get the signature region within the image stored in an SPImage object. For an overview of image cleaning, see Static Image cleaning. If the signature image is empty, the signature region will be set to a width and a height of 1.
|
|
Get the size of an image stored in an SPImage object.
|
|
Get possible split positions of the image stored in an SPImage object. For an overview of image cleaning, see Static Image cleaning. This function analyzes the image to find the X coordinates of possible word boundaries.
|
|
Invert the image stored in an SPImage object. For an overview of image cleaning, see Static Image cleaning.
|
|
Mask the image of an SPImage object with the image of another SPImage object.
|
|
Mirror the image stored in an SPImage object. For an overview of image cleaning, see Static Image cleaning.
|
|
Crop the image of an SPImage object. For an overview of image cleaning, see Static Image cleaning.
|
|
Resize the image. The image will be resized to match the new resolution iRes [dots per inch], iRes must be smaller than the current resolution of the image Algorithm 0 is optimized to resize signatures for comparing the signature image statically, see SPCompareStaticImage and SP_COMPARE_AUTOZOOM.
|
|
Rotate the image stored in an SPImage object. For an overview of image cleaning, see Static Image cleaning.
|
|
Create an SPBitmap object from an SPImage object.
|
|
Copy a bitmap into an SPImage object.
|
|
Set the number of bits per pixel of the image stored in an SPImage object.
|
|
Set the number of bits per pixel of the image stored in an SPImage object.
|
|
Set the default binarization method and threshold. The default binarization method and threshold are used to temporarily convert gray-scale images to black-and-white images. They affect these functions:
|
|
Clear an image. The image will be resized to the given width and height and all pixels will be set to the given gray scale. The created image will be a gray-scale image with 8 bit per pixel. Call SPImageSetEmpty2 if you want to create a color or a black-and-white image.
|
|
Clear an image. The image will be resized to the given width and height and all pixels will be set to the given gray scale. The created image will be a color image with 24 bits per pixel, or a gray-scale image with 8 bit per pixel or a black-and-white image with 1 bit per pixel.
|
|
Set a pixel in the image stored in an SPImage object.
|
|
Copy a signature image of an SPReference object into an SPImage object.
|
|
Overwrite the resolution of the image stored in an SPImage object. SPImageSetResolution overrules the resolution tag of the contained image, use SPImageResize() to change the resolution and to calculate the contents based on the new resolution
|
|
Copy the image of an SPSignature object into an SPImage object.
|
|
Copy the image of an SPTellerImage object into an SPImage object.
|
|
Copy the image of an SPTemplate object into an SPImage object.
|