←Select platform

MinimumHoleCount Property

Summary
Gets or sets the minimum number of holes to detect.
Syntax
C#
C++/CLI
Java
Python
public int MinimumHoleCount { get; set; } 
public int getMinimumHoleCount(); 
public void setMinimumHoleCount( 
   int intValue 
); 
public: 
property int MinimumHoleCount { 
   int get(); 
   void set (    int ); 
} 
MinimumHoleCount # get and set (HolePunchRemoveCommand) 

Property Value

Minimum number of holes to detect. This property is valid only if the HolePunchRemoveCommandFlags.UseCount flag is set in the Flags property. This value must be at least 2.

Example
C#
using Leadtools; 
using Leadtools.Codecs; 
using Leadtools.ImageProcessing.Core; 
 
public void HolePunchRemoveCommandExample() 
{ 
   // Load an image 
   RasterCodecs codecs = new RasterCodecs(); 
   codecs.ThrowExceptionsOnInvalidImages = true; 
 
   RasterImage image = codecs.Load(Path.Combine(LEAD_VARS.ImagesDir, "Clean.tif")); 
 
   // Prepare the command 
   HolePunchRemoveCommand command = new HolePunchRemoveCommand(); 
   command.HolePunchRemove += new EventHandler<HolePunchRemoveCommandEventArgs>(HolePunchRemoveEvent_S1); 
   command.Flags = HolePunchRemoveCommandFlags.UseDpi | HolePunchRemoveCommandFlags.UseCount | HolePunchRemoveCommandFlags.UseLocation; 
   command.Location = HolePunchRemoveCommandLocation.Left; 
   command.MaximumHoleCount = 4; 
   command.MinimumHoleCount = 2; 
 
   command.Run(image); 
 
} 
 
private void HolePunchRemoveEvent_S1(object sender, HolePunchRemoveCommandEventArgs e) 
{ 
   MessageBox.Show("Size " + "( " + e.BoundingRectangle.Left + ", " + e.BoundingRectangle.Top + ") - " + "( " + e.BoundingRectangle.Right + ", " + e.BoundingRectangle.Bottom + ")" + 
      "\n Hole Index " + e.HoleIndex.ToString() + 
      "\n Holes Total Count " + e.HoleTotalCount.ToString() + 
      "\n Black Count " + e.BlackCount.ToString() + 
      "\n White Count " + e.WhiteCount.ToString()); 
   e.Status = RemoveStatus.Remove; 
} 
 
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.