SEGMENTATIONOPTIONS (Document/Medical only)

typedef struct _tagSEGMENTATIONOPTIONS
{
   L_UINT uStructSize;
   L_UINT16 uSensitivity;
   L_UINT16 uCombineFlags;
   L_UINT16 uCombineFactor;
   L_UINT16 uImageType;
} SEGMENTATIONOPTIONS, L_FAR * pSEGMENTATIONOPTIONS;

The SEGMENTATIONOPTIONS structure contains segmentation options to control the auto segmentation process using LSegment::MrcSegmentBitmap.

Member

Description

uStructSize

Size of this structure in bytes, for versioning. Use the sizeof() macro to calculate this value.

uSensitivity

Threshold value that determines the segment's type. Possible values are between 1 and 100. This is a control parameter used by the MRC engine to determine whether a certain segment should be considered as text, grayscale or an image. Higher values mean more segments are considered as text. Lower values mean more segments are considered as images.

uCombineFlags

Flag that indicates how segments will be combined. Possible values are:

 

Value

Meaning

 

COMBINE_FORCESIMILAR

[0x01] Always combine similar segments.

 

COMBINE_TRY

[0x02] Use the uCombineFactor value to determine similarity, and combine similar segments.

 

For the COMBINE_FORCESIMILAR value, the following types are considered similar and could therefore be combined:

SEGTYPE_ONECOLOR, SEGTYPE_BACKGROUND, SEGTYPE_TEXT_1BIT_BW, SEGTYPE_TEXT_2BITBW, SEGTYPE_TEXT_1BIT_COLOR, SEGTYPE_TEXT_2BIT_COLOR, or SEGTYPE_GRAYSCALE_2BIT

These types are considered similar and therefore could be combined:

SEGTYPE_GRAYSCALE_2BIT or SEGTYPE_GRAYSCALE_8BIT

These types are considered similar and therefore could be combined:

SEGTYPE_GRAYSCALE_8BIT or SEGTYPE_PICTURE

 

uCombineFactor

A percentage value that represents the acceptable difference between the two segments being combined. This is valid only when uCombineFlags is COMBINE_TRY. Possible values are between 0 and 100. A value of 0 indicates that only segments that are an exact match can be combined. A value of 100 indicates that any two segments of the same type can be combined. Large values cause very different segments to be joined, which causes considerable quality loss.

uImageType

Value that indicates the image type. Possible values are:

 

Value

Meaning

 

IMAGE_SCANNED

[0x00] The image is a scanned image. It will be cleaned before segmentation.

 

IMAGE_COMPUTERGENERATED

[0x01] The image is computer generated. It will not be cleaned before segmentation.

Comments

Please note that the LSegment::MrcSegmentBitmap function will be removed in Version 15. It is being replaced with the LSegment::MrcSegmentBitmapExt function.