←Select platform

Threshold Property

Summary
Gets or sets a value that indicates which pixels will be changed.
Syntax
C#
C++/CLI
Python
public int Threshold { get; set; } 
public: 
property int Threshold { 
   int get(); 
   void set (    int ); 
} 
Threshold # get and set (RemoveRedEyeCommand) 

Property Value

Threshold value that indicates which pixels will be changed. All pixels with a red component value greater than this value will be changed. Pixels with a red component value less than this value will not be changed. This value is between 0 and 255.

Example
C#
using Leadtools; 
using Leadtools.Codecs; 
using Leadtools.ImageProcessing.Color; 
 
 
public void RemoveRedEyeCommandExample() 
{ 
   // Load an image 
   RasterCodecs codecs = new RasterCodecs(); 
   codecs.ThrowExceptionsOnInvalidImages = true; 
 
   RasterImage image = codecs.Load(Path.Combine(LEAD_VARS.ImagesDir, "red_eye.cmp")); 
 
   // Prepare the command 
   RemoveRedEyeCommand command = new RemoveRedEyeCommand(); 
   //Apply the redeye removal command. 
   command.NewColor = new RasterColor(5, 20, 10); 
   command.Threshold = 125; 
   command.Lightness = 100; 
   command.Run(image); 
   codecs.Save(image, Path.Combine(LEAD_VARS.ImagesDir, "Result.jpg"), RasterImageFormat.Jpeg, 24); 
 
} 
 
static class LEAD_VARS 
{ 
   public const string ImagesDir = @"C:\LEADTOOLS23\Resources\Images"; 
} 
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.Color Assembly

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