LEADTOOLS MRC (Leadtools.Mrc assembly)
LEAD Technologies, Inc

DeleteSegment Method

Example 





Segment identifier.
Deletes a segment.
Syntax
public void DeleteSegment( 
   int id
)
'Declaration
 
Public Sub DeleteSegment( _
   ByVal id As Integer _
) 
'Usage
 
Dim instance As MrcSegmenter
Dim id As Integer
 
instance.DeleteSegment(id)
public void DeleteSegment( 
   int id
)
 function Leadtools.Mrc.MrcSegmenter.DeleteSegment( 
   id 
)
public:
void DeleteSegment( 
   int id
) 

Parameters

id
Segment identifier.
Remarks
This method is used to delete a specific segment from the segmentation handle.

This method is valid with the auto and manual segmentation process. For more information, refer to Programming with LEADTOOLS MRC.
Example
 
Public Sub DeleteSegmentExample()
      ' Load an image
      Dim codecs As RasterCodecs = New RasterCodecs()
      codecs.ThrowExceptionsOnInvalidImages = True

      Dim image As RasterImage = codecs.Load(Path.Combine(LEAD_VARS.ImagesDir, "Master.jpg"))

      Dim segmenter As MrcSegmenter = New MrcSegmenter(image, RasterColor.FromKnownColor(RasterKnownColor.White), RasterColor.FromKnownColor(RasterKnownColor.Black))
      segmenter.SegmentImage(image, MrcSegmentImageOptions.Empty)

      If segmenter.EnumerateSegments(Nothing) > 0 Then
         segmenter.DeleteSegment(0)
      End If
   End Sub

Public NotInheritable Class LEAD_VARS
   Public Const ImagesDir As String = "C:\Users\Public\Documents\LEADTOOLS Images"
End Class
public void DeleteSegmentExample()
   {
      // Load an image
      RasterCodecs codecs = new RasterCodecs();
      codecs.ThrowExceptionsOnInvalidImages = true;

      RasterImage image = codecs.Load(Path.Combine(LEAD_VARS.ImagesDir, "Master.jpg"));

      MrcSegmenter segmenter = new MrcSegmenter(image, RasterColor.FromKnownColor(RasterKnownColor.White), RasterColor.FromKnownColor(RasterKnownColor.Black));
      segmenter.SegmentImage(image, MrcSegmentImageOptions.Empty);

      if (segmenter.EnumerateSegments(null) > 0)
         segmenter.DeleteSegment(0);
   }

static class LEAD_VARS
{
   public const string ImagesDir = @"C:\Users\Public\Documents\LEADTOOLS Images";
}
Requirements

Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2

See Also

Reference

MrcSegmenter Class
MrcSegmenter Members
SegmentImage Method
AddSegment Method
SetSegmentData Method
CombineSegments Method
Clone Method

 

 


Products | Support | Contact Us | Copyright Notices

© 2006-2012 All Rights Reserved. LEAD Technologies, Inc.

Leadtools.Mrc requires a Document or Medical toolkit license and unlock key. For more information, refer to: LEADTOOLS Toolkit Features