The functions in this section are useful for correcting artifacts from scanned documents.
|
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.
|
|
◆ 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
-
Input | The image input data buffer. |
Output | The image output data buffer. |
Width | The width of the image in pixels. |
Height | The height of the image in pixels. |
Stride | The number of bytes in one row of pixels. |
maxWindowSize | The 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. |
Threshold | The 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
-
Input | The image input data buffer. |
Output | The image output data buffer. |
Width | The width of the image in pixels. |
Height | The height of the image in pixels. |
Stride | The number of bytes in one row of pixels. |
Skewed | True, if valid text image found and deskew performed. Otherwise false. |
- Returns
- OC_STATUS_OK if successful, otherwise an error code (see core.h)