←Select platform

OtsuThresholdCommand Constructor(int)

Summary
Initializes a new OtsuThresholdCommand class object with explicit parameters.
Syntax
C#
Objective-C
C++/CLI
Java
Python
- (instancetype)initWithClusters:(NSInteger)clusters NS_DESIGNATED_INITIALIZER; 
public OtsuThresholdCommand( 
   int Clusters 
); 
public: 
OtsuThresholdCommand(  
   int Clusters 
) 
__init__(self,Clusters) # Overloaded constructor 

Parameters

Clusters
Number of colors in the output image.

Remarks

The default value is 2.

Example
C#
using Leadtools; 
using Leadtools.Codecs; 
using Leadtools.ImageProcessing.Core; 
 
 
public void OtsuThresholdConstructorExample() 
{ 
   RasterCodecs codecs = new RasterCodecs(); 
   codecs.ThrowExceptionsOnInvalidImages = true; 
 
   //Load an image 
   RasterImage image = codecs.Load(Path.Combine(LEAD_VARS.ImagesDir, @"ImageProcessingDemo\NaturalFruits.jpg")); 
 
   //Prepare the command 
   OtsuThresholdCommand command = new OtsuThresholdCommand(4); 
   command.Run(image); 
 
} 
 
static class LEAD_VARS 
{ 
   public const string ImagesDir = @"C:\LEADTOOLS22\Resources\Images"; 
} 
Requirements

Target Platforms

Help Version 22.0.2023.11.1
Products | Support | Contact Us | Intellectual Property Notices
© 1991-2023 LEAD Technologies, Inc. All Rights Reserved.

Leadtools.ImageProcessing.Core Assembly

Products | Support | Contact Us | Intellectual Property Notices
© 1991-2023 LEAD Technologies, Inc. All Rights Reserved.