Accusoft ImagXpress 13
AutoCrop Method

The percent of pixels that indicate that the inner edge of the border has been reached.

It has a minimum value of 0.0 and a maximum value of 1.0.

The IPcropPct parameter can be adjusted to compensate for noise that is typically found in scanned documents.

The left and right border size in pixels for the cropped image.

Range: 0 to max image size

The top and bottom border size in pixels for the cropped image.

Range: 0 to max image size

Description
Automatically crops the background's border space from an image.
Syntax
Visual Basic
Public Sub AutoCrop( _
   ByVal IPCropPct As Single, _
   ByVal IPBorderX As Long, _
   ByVal IPBorderY As Long _
) 
Parameters
IPCropPct

The percent of pixels that indicate that the inner edge of the border has been reached.

It has a minimum value of 0.0 and a maximum value of 1.0.

The IPcropPct parameter can be adjusted to compensate for noise that is typically found in scanned documents.

IPBorderX

The left and right border size in pixels for the cropped image.

Range: 0 to max image size

IPBorderY

The top and bottom border size in pixels for the cropped image.

Range: 0 to max image size

Remarks

This method works best with 1-bit images.

ImagXpress will examine the image to determine if the background color is black or white. For a document with a white background, beginning with the top row, each row is examined for black pixels. If the percentage of black pixels in that row is less than IPcropPct, the row is eliminated and the next row is examined. The process continues until the number of black pixels exceeds IPcropPct or until the entire image has been processed.

The same process is applied for rows from bottom to top and from the left most column to right and from the right most column to the left.

Example

In this example AutoCrop was called to remove the whitespace around the text. This image had very little noise in the borders so a low IPCropPct was used. A four pixel border was chosen in all directions.

 

ImagXpress1.AutoCrop 0.01, 4, 4

 

See Also

ImagXpress Object  | ImagXpress Members  | Cropping  | Document Image Processing  | Image Processing

 

 


©2015. Accusoft Corporation. All Rights Reserved.

Send Feedback