Combines two segments.
Syntax
Parameters
- id1
- ID of the first segment to be combined.
- id2
- ID of the second segment to be combined.
- flags
- Flag that indicates how segments will be combined.
For the MrcCombineSegmentFlags.ForeSimilar
value, the following types are considered similar and could therefore
be combined:
OneColor,
Background,
Text1BitBw,
Text2BitBw,
Text1BitColor,
Text2BitColor,
Grayscale2Bit.
These types are considered similar and therefore could be combined:
Grayscale2Bit,
Grayscale8Bit.
These types are considered similar and therefore could be combined:
Grayscale8Bit,
Picture.
refer to MrcCombineSegmentFlags
- factor
- A percentage value that represents the
acceptable difference between the two segments being combined.
This is valid only when flags is set to TryFactor. 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.
Example
| Visual Basic | Copy Code |
|---|
<Test> _
Public Sub CombineSegmentsExample()
RasterCodecs.Startup()
Dim codecs As RasterCodecs = New RasterCodecs()
codecs.ThrowExceptionsOnInvalidImages = True
Dim image As RasterImage = codecs.Load("C:\Program Files\LEAD Technologies\LEADTOOLS 15\Images\MRCSegmentation.mrc")
Dim segmenter As MrcSegmenter = New MrcSegmenter(image, "C:\Program Files\LEAD Technologies\LEADTOOLS 15\Images\MRCSegmentation.sgm")
segmenter.CombineSegments(0, 1, MrcCombineSegmentFlags.CombineForce, 20)
End Sub |
| C# | Copy Code |
|---|
public void CombineSegmentsExample() { // Load an image RasterCodecs.Startup(); RasterCodecs codecs = new RasterCodecs(); codecs.ThrowExceptionsOnInvalidImages = true; RasterImage image = codecs.Load(@"C:\Program Files\LEAD Technologies\LEADTOOLS 15\Images\MRCSegmentation.mrc"); MrcSegmenter segmenter = new MrcSegmenter(image, @"C:\Program Files\LEAD Technologies\LEADTOOLS 15\Images\MRCSegmentation.sgm"); segmenter.CombineSegments(0, 1, MrcCombineSegmentFlags.CombineForce, 20); } |
Remarks
Requirements
Target Platforms: Microsoft .NET Framework 2.0, Windows 98, Windows NT 4.0, Windows Millennium Edition, Windows 2000, Windows XP Home Edition, Windows XP Professional, Windows Server 2003 family
See Also