Error processing SSI file
LEADTOOLS Image Processing (Leadtools.ImageProcessing.Core assembly)

Show in webframe

KMeansCommand Class








Members 
Performs image segmentation and color reduction using the K-means algorithm.
Object Model
Syntax
'Declaration
 
Public Class KMeansCommand 
   Inherits Leadtools.ImageProcessing.RasterCommand
   Implements Leadtools.ImageProcessing.IRasterCommand 
'Usage
 
Dim instance As KMeansCommand
public sealed class KMeansCommand : Leadtools.ImageProcessing.IRasterCommand  
@interface LTKMeansCommand : LTRasterCommand
public class KMeansCommand extends RasterCommand
function Leadtools.ImageProcessing.Core.KMeansCommand()
Remarks
Example
Copy Code  
Imports Leadtools
Imports Leadtools.Codecs
Imports Leadtools.ImageProcessing.Core

   
Public Sub KMeansCommandExample()
   Dim codecs As RasterCodecs = New RasterCodecs()
   codecs.ThrowExceptionsOnInvalidImages = True
   'Load an image
   Dim image As RasterImage = codecs.Load(Path.Combine(LEAD_VARS.ImagesDir, "cannon.jpg"))

   'Prepare the command
   Dim command As KMeansCommand = New KMeansCommand()

   'Apply 
   command.Clusters = 7
   command.Type = KMeansCommandFlags.KMeans_Random
   command.Run(image)
End Sub

Public NotInheritable Class LEAD_VARS
Public Const ImagesDir As String = "C:\Users\Public\Documents\LEADTOOLS Images"
End Class
using Leadtools;
using Leadtools.Codecs;
using Leadtools.ImageProcessing.Core;

      
public void KMeansCommandExample()
{
    RasterCodecs codecs = new RasterCodecs();
    codecs.ThrowExceptionsOnInvalidImages = true;
    //Load an image
    RasterImage image = codecs.Load(Path.Combine(LEAD_VARS.ImagesDir, "cannon.jpg"));

    //Prepare the command
    KMeansCommand command = new KMeansCommand();

    command.Clusters = 7;
    command.Type = KMeansCommandFlags.KMeans_Random;

    //Apply 
    command.Run(image);
}

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

Target Platforms

See Also

Reference

KMeansCommand Members
Leadtools.ImageProcessing.Core Namespace
OtsuThresholdCommand Class
LambdaConnectednessCommand Class
ShrinkWrapCommand Class
WatershedCommand Class
GWireCommand Class

Error processing SSI file