←Select platform

LambdaConnectednessCommand Class

Summary
Performs image segmentation using a special region-growing algorithm called Lambda Connectedness.
Syntax
C#
Objective-C
C++/CLI
Java
Python
public class LambdaConnectednessCommand : RasterCommand 
@interface LTLambdaConnectednessCommand : LTRasterCommand 
public class LambdaConnectednessCommand 
    extends RasterCommand 
public ref class LambdaConnectednessCommand : public RasterCommand   
class LambdaConnectednessCommand(RasterCommand): 
Remarks
  • Lambda-connectedness is a technique used to find the connectivity between an image's pixels and then clusters them into groups.
  • Low values for lambda can result in one region.
  • High values for lambda can result in an over-segmented image.
  • This function supports 12 and 16-bit grayscale and 48 and 64-bit color images. Support for 12 and 16-bit grayscale and 48 and 64-bit color images is available in the Document/Medical Imaging toolkits.
  • This command supports signed/unsigned images.

Lambda Connectedness Function - Before

Lambda Connectedness Function - Before

Lambda Connectedness Function - After

Lambda Connectedness Function - After

View additional platform support for this Lambda Connectedness function.

Example
C#
Java
using Leadtools; 
using Leadtools.Codecs; 
using Leadtools.ImageProcessing.Core; 
 
public void LambdaConnectednessCommandExample() 
{ 
   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 
   LambdaConnectednessCommand command = new LambdaConnectednessCommand(); 
   command.Lambda = 985; 
 
   //Apply 
   command.Run(image); 
} 
 
static class LEAD_VARS 
{ 
   public const string ImagesDir = @"C:\LEADTOOLS23\Resources\Images"; 
} 
 
import java.io.File; 
import java.io.IOException; 
 
import org.junit.*; 
import org.junit.Test; 
import org.junit.runner.JUnitCore; 
import org.junit.runner.Result; 
import org.junit.runner.notification.Failure; 
import static org.junit.Assert.*; 
 
import leadtools.*; 
import leadtools.codecs.*; 
import leadtools.imageprocessing.core.LambdaConnectednessCommand; 
 
 
public void lambdaConnectednessCommandExample() { 
   String LEAD_VARS_IMAGES_DIR = "C:\\LEADTOOLS23\\Resources\\Images"; 
 
   RasterCodecs codecs = new RasterCodecs(); 
   codecs.setThrowExceptionsOnInvalidImages(true); 
 
   // Load an image 
   RasterImage image = codecs.load(combine(LEAD_VARS_IMAGES_DIR, "NaturalFruits.jpg")); 
 
   // Prepare the command 
   LambdaConnectednessCommand command = new LambdaConnectednessCommand(); 
   command.setLambda(985); 
   assertTrue(command.getLambda() == 985); 
 
   // Apply 
   command.run(image); 
 
   // Save the image 
   String outputFileName = combine(LEAD_VARS_IMAGES_DIR, "lambda_result"); 
   codecs.save(image, outputFileName, RasterImageFormat.JPEG, 0); 
 
   assertTrue(new File(outputFileName).exists()); 
   System.out.printf("Command run, image saved to %s", outputFileName); 
} 
Requirements

Target Platforms

Help Version 23.0.2024.3.3
Products | Support | Contact Us | Intellectual Property Notices
© 1991-2024 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.