SEGMENTEXTOPTIONS

typedef struct _tag SEGMENTEXTOPTIONS
{
   L_UINT uStructSize;
   L_UINT uCleanSize;
   L_UINT uSegmentQuality;
   L_UINT uColorThreshold;
   L_UINT uBackGroundThreshold;
   L_UINT uCombineThreshold;
   L_UINT uFlags;
} SEGMENTEXTOPTIONS,  * pSEGMENTEXTOPTIONS;

The SEGMENTEXTOPTIONS 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.

uCleanSize

Value that indicates the cleaner size used to remove the noise inside the segmented image. Possible values range from 0 to 10, where 0 means to skip the cleaning stage.

uSegmentQuality

Threshold value used to determine whether the segment is a picture segment. Possible values range from 0 to 100. Use 0 to set all possible picture segments to 2-bit without loss of a lot of information. Use 100 to set all picture segments to 2 bit only if they are very close to 2-bit.

uColorThreshold

Threshold value used to combine colors. Colors that are closer together than this amount will be combined. The best value is 25. Values saturate at 443.

uBackGroundThreshold

Threshold value used to separate image objects from the background. Best values are from 5 to 35.

uCombineThreshold

Threshold value used to merge segments. Best values are from 75 to 125.

uFlags

Flags that indicate segmentation preference, whether to force segments to be 2-bit segments, and whether to search for background segments. You can use a bitwise OR (|) to specify one flag from each group:

 

The following are the flags that indicate the segmentation preference, and whether to force segments to be 2-bit segments:

 

Value

Meaning

 

SGM_FAVOR_ONEBIT

[0x0000] The preferred segment type is one bit.

 

SGM_FAVOR_TWOBIT

[0x0001] The preferred segment type is two bit.

 

SGM_FORCE_ONEBIT

[0x0002] Force all two bit segment types to be one bit segments.

 

SGM_FORCE_TWOBIT

[0x0003] Force all one bit segment types to be two bit segments.

 

The following are the flags that indicate whether to search for background segments:

 

Value

Meaning

 

SGM_WITHBKGRND

[0x0000] Search for background segments.

 

SGM_WITHOUTBKGRND

[0x0010] Do not search for background segments.

 

The following are the flags that indicate the segmentation method:

 

Value

Meaning

 

SGM_ADVANCED_FEATURE_BASED_SEGMENTATION

[0x0100] Segment based on features.

 

SGM_NORMAL_SEGMENTATION

[0x0000] Segment based on colors.