Version: 1.0
Loading...
Searching...
No Matches
OCR Pre-processing Filters

Detailed Description

The functions in this section are useful for correcting artifacts from scanned documents.

Functions

OC_STATUS ocularDespeckle (unsigned char *Input, unsigned char *Output, int Width, int Height, int Stride, int maxWindowSize, int Threshold)
 Performs an adaptive median filter on an image, useful for removing salt and pepper noise from scanned documents.
 
OC_STATUS ocularDocumentDeskew (unsigned char *Input, unsigned char *Output, int Width, int Height, int Stride, bool *Skewed)
 Performs deskewing of an image, useful for scanned documents.
 

Function Documentation

◆ ocularDespeckle()

OC_STATUS ocularDespeckle ( unsigned char * Input,
unsigned char * Output,
int Width,
int Height,
int Stride,
int maxWindowSize,
int Threshold )

Performs an adaptive median filter on an image, useful for removing salt and pepper noise from scanned documents.

Parameters
InputThe image input data buffer.
OutputThe image output data buffer.
WidthThe width of the image in pixels.
HeightThe height of the image in pixels.
StrideThe number of bytes in one row of pixels.
maxWindowSizeThe filter window size (should be a scalar between 1 and 7). Window size (ws) is defined as W = 2*ws + 1 so that W = 3 is a 3x3 filter window.
ThresholdThe adaptive theshold (0 = normal median behavior). Higher values reduce the "aggresiveness" of the filter.
Returns
OC_STATUS_OK if successful, otherwise an error code (see core.h)

◆ ocularDocumentDeskew()

OC_STATUS ocularDocumentDeskew ( unsigned char * Input,
unsigned char * Output,
int Width,
int Height,
int Stride,
bool * Skewed )

Performs deskewing of an image, useful for scanned documents.

Parameters
InputThe image input data buffer.
OutputThe image output data buffer.
WidthThe width of the image in pixels.
HeightThe height of the image in pixels.
StrideThe number of bytes in one row of pixels.
SkewedTrue, if valid text image found and deskew performed. Otherwise false.
Returns
OC_STATUS_OK if successful, otherwise an error code (see core.h)