Leadtools.ImageProcessing.Color Send comments on this topic. | Back to Introduction - All Topics | Help Version 15.12.10
SegmentCommand Constructor(Int32,SegmentCommandFlags)
See Also  Example




threshold
The tolerance value of each segment. Valid values for this parameter are: 0 to 255 for 1, 2, 3, 4, 5, 6, 7, 8, 24, and 32-bit images, 0 to 4095 for 12-bit images and 0 to 65535 for 16, 48, and 64-bit images.
flags
Flag that indicates the color space used in the segmentation. For a list of possible values, refer to SegmentCommandFlags.
Initializes a new SegmentCommand class object with explicit parameters.

Syntax

Visual Basic (Declaration) 
Public Function New( _
   ByVal threshold As Integer, _
   ByVal flags As SegmentCommandFlags _
)
Visual Basic (Usage)Copy Code
Dim threshold As Integer
Dim flags As SegmentCommandFlags
 
Dim instance As SegmentCommand(threshold, flags)
C# 
public SegmentCommand( 
   int threshold,
   SegmentCommandFlags flags
)
Managed Extensions for C++ 
public: SegmentCommand( 
   int threshold,
   SegmentCommandFlags flags
)
C++/CLI 
public:
SegmentCommand( 
   int threshold,
   SegmentCommandFlags flags
)

Parameters

threshold
The tolerance value of each segment. Valid values for this parameter are: 0 to 255 for 1, 2, 3, 4, 5, 6, 7, 8, 24, and 32-bit images, 0 to 4095 for 12-bit images and 0 to 65535 for 16, 48, and 64-bit images.
flags
Flag that indicates the color space used in the segmentation. For a list of possible values, refer to SegmentCommandFlags.

Example

Visual BasicCopy Code
ImageProcessing.SpecialEffects.SegmentCommand.SegmentConstructor
   Public Sub SegmentConstructorExample()
      RasterCodecs.Startup()
      Dim codecs As New RasterCodecs()
      codecs.ThrowExceptionsOnInvalidImages = True

      Dim leadImage As RasterImage = codecs.Load("C:\Program Files\LEAD Technologies\LEADTOOLS 15\Images\Master.jpg")

      ' Prepare the command
      Dim command As SegmentCommand = New SegmentCommand(20, SegmentCommandFlags.Rgb)
      ' segment the image.
      command.Run(leadImage)
      codecs.Save(leadImage, "C:\Program Files\LEAD Technologies\LEADTOOLS 15\Images\Result.jpg", RasterImageFormat.Jpeg, 24)

      RasterCodecs.Shutdown()
   End Sub
C#Copy Code
ImageProcessing.SpecialEffects.SegmentCommand.SegmentConstructor 
      public void SegmentConstructorExample() 
      { 
         // Load an image 
         RasterCodecs.Startup(); 
         RasterCodecs codecs = new RasterCodecs(); 
         codecs.ThrowExceptionsOnInvalidImages = true; 
 
         RasterImage image = codecs.Load(@"C:\Program Files\LEAD Technologies\LEADTOOLS 15\Images\Master.jpg"); 
 
         // Prepare the command 
         SegmentCommand command = new SegmentCommand(20, SegmentCommandFlags.Rgb); 
         // segment the image. 
         command.Run(image); 
         codecs.Save(image, @"C:\Program Files\LEAD Technologies\LEADTOOLS 15\Images\Result.jpg", RasterImageFormat.Jpeg, 24); 
 
         RasterCodecs.Shutdown(); 
      }

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