ImageEn, unit IEVision

TIEVisionImage.removeSpeckles

TIEVisionImage.removeSpeckles

Declaration

function removeSpeckles(maxSize: int32_t = 2; connectivity: int32_t = 8): TIEVisionImage; safecall;

Description

Removes small dark specks (noise) from a document image (via Leptonica connected components).
Every dark component whose width and height are both maxSize pixels or less is removed.
The image is binarized with Otsu first. Returns a new black and white 8-bit gray image (0 = black, 255 = white). The current image is not changed.
Parameter Description
maxSize Largest speck to remove, in pixels (at least 1). Keep it smaller than punctuation, e.g. 1/10 of the text height
connectivity 4 or 8

Example

// Remove small dark specks from a document
ImageEnView1.IEBitmap.AssignIEVisionImage( ImageEnView1.IEBitmap.GetIEVisionImage().removeSpeckles( 2, 8 ));
ImageEnView1.Update(); // Show changes in our viewer

See Also

◼removeBorderComponents
◼getConnectedComponents
◼RemoveIsolatedPixels
◼RemoveNoise