CIB image toolbox technical manual

9. Segmenters

RangesSegmenter
RDO_Segmenter
ColorQRSegmenter
SplitChannelsSegmenter

RangesSegmenter

Interface of image segmentation by color ranges.

This segmenter allows to extract from image to separated images all pixels with colors that fall within user defined ranges (or if it is required pixel that do not fall within these ranges). These ranges can be set by definition of lower and upper range boundaries:

<RangesSegmenter GetMasks="0">
<UsedColorSpace>RGB</UsedColorSpace>
<LowerBoundaries>0,0,0;130,55,80;219,200,130</LowerBoundaries>
<UpperBoundaries>128,128,128;209,190,190;255,255,191</UpperBoundaries>
</RangesSegmenter>

Property name

Description

Default value

UsedColorSpace

Colorspace of an image

RGB

LowerBoundaries

Lower boundaries of a range

0,0,0;127,127,127

UpperBoundaries

Upper boundaries of a range

128,128,128;255,255,255

GetMasks

Flag for masks

0


RDO_Segmenter

Segmenter for extracting layers from an image.

This segmentation procedure is based on article Cheng, H. and Bouman, C.A., 2001. Document compression using rate-distortion optimized segmentation. Journal of Electronic Imaging, 10(2), pp.460-475. But RDO_Segmenter is modification of algorithm from the article.

Parameters of this filter can be described in profile:

<ProcessingProfile>
...
<RDO_Segmenter>  <ImageBlockSize>8</ImageBlockSize>  <IsTextBinaryMaskRequired>true</IsTextBinaryMaskRequired> <ThreshHigh>150.0</ThreshHigh> <ThreshLow>25.0</ThreshLow> <ThreshMean>200.0</ThreshMean>  <DCTCoeff>400</DCTCoeff> <ThreshVariance>25</ThreshVariance> <IsDownsamplingRequired>false</IsDownsamplingRequired>  <RatioForeground>4.0</RatioForeground> <RatioBackground>2.0</RatioBackground>
</RDO_Segmenter>
...
</ProcessingProfile>

Property name

Description

Default value

ImageBlockSize

Size of image blocks for processing

8

IsTextBinaryMaskRequired

Flag for result layers filling

true

ThreshHigh

High threshold for the segmenter

150.0

ThreshLow

Low threshold for the segmenter

25.0

ThreshMean

Mean threshold for the segmenter

200.0

DCTCoeff

Threshold for discrete cosine transform

400

ThreshVariance

Variance threshold

25

IsDownsamplingRequired

Flag for optional background and foreground downsampling

false

RatioForeground

Scale factor for foreground downsampling

4.0

RatioBackground

Scale factor for background downsampling

2.0


ColorQRSegmenter

Segmenter for extracting layers from a QR RGB image (experimental). It only accepts 1 input image, and outputs 3 images, one per channel.

Parameters of this filter can be described in profile:

<ProcessingProfile>
...
<ColorQRSegmenter> <IsTextBinaryMaskRequired>true</IsTextBinaryMaskRequired>
</ColorQRSegmenter>
...
</ProcessingProfile>

Property name

Description

Default value

MaxSide

Longest side for rescaling

0

CleanBackground

If enabled it attempts to clean the background

false

Blur

If enabled it will execute blurring

false

Sharp

If enabled it will add a sharp filter

false

HueDiscretization

If enabled it will use HUE discretization to process the image

false

Grayscale

If enabled, final image will not be binarized

false


SplitChannelsSegmenter

This segmenter allows to separate multichannel image to few grayscale images with one channel.

There are no parameters for this segmenter.