Grooper.IP.LineDetection

Detects the horizontal and vertical line structure in a document image.


Inherits from: Grooper.IP.IpCommand

Constructors

Signature Description
New (Owner As ConnectedObject)
Parameters
Owner
          Type: ConnectedObject
          
New ()

Fields

Field Name Field Type Description
Database As Grooper.GrooperDb Grooper.GrooperDb
MinLineThickness As System.String System.String

Properties

Property Name Property Type Description
AngleTolerance System.Double The maximum deviation from a square angle.
BinarizationSettings Grooper.IP.Binarize Specifies the method used to binarize color and grayscale input images. Review the 'Binarized' diagnostic image when tuning this property. The objective is to generate an image where the lines to be removed are clearly defined.
CombRemoval Grooper.IP.LineDetection.CombDetectionType A comb is line segment which is shorter than the minimum line length, but is connected to a perpendicular line at one or more ends.Can be one of the following values:
  • None: Comb removal is disabled.
  • Single: Combs with single connectivity will be removed. Single connectivity indicates that the comb connects to a perpendicular line on one end, as shown below:

    │G│R│O│O│P│E│R│
    └─┴─┴─┴─┴─┴─┴─┘

    │PATIENT NAME: │ADMIT DATE:│
    │John R. Smith │06/15/2017 │
    └──────────────┴───────────┘

  • Double: Combs with double connectivity will be removed. Double connectivity indicates that the comb connects to a perpendicular line on boths ends, as shown below:

    ┌─┬─┬─┬─┬─┬─┬─┐
    │G│R│O│O│P│E│R│
    └─┴─┴─┴─┴─┴─┴─┘

    ┌──────────────┬───────────┐
    │PATIENT NAME: │ADMIT DATE:│
    │John R. Smith │06/15/2017 │
    └──────────────┴───────────┘

  • All: All combs will be removed..
CommandTypeName System.String The type of IP command.
DropoutFontSize System.String Defines the largest font size to be dropped out during image preprocessing. An empty or zero value will disable font dropout. Review the "Preprocessed" diagnostic image when tuning this property. The objective is to produce an image where as much text as possible has been removed from the image, without damaging any of the line or box structure.
HasReferenceProperties System.Boolean Returns true if the object has properties which reference Grooper Node objects.
IsEmpty System.Boolean Returns true if all properties with a ViewableAttribute are set to their default value.
IsWriteable System.Boolean Returns true if the object is writable, or false if it is not.
Level Grooper.IP.LineDetection.HoughLevel Defines the accuracy level of advanced line detection.Can be one of the following values:
  • Off: Advanced line detection is disabled.
  • Low: Low accuracy setting. Executes Hough transform at r = 0.25°, Θ = 1px.
  • Medium: Medium accuracy setting. Executes Hough transform at r = 0.25°, Θ = .5px.
  • High: High accuracy setting. Executes Hough transform at r = 0.25°, Θ = .25px.
LineTypes Grooper.IP.LineDetection.LineOrientations Specifies the orientation of lines which will be removed from the image. The Angle Tolerance property controls the allowed variance from true horizontal and vertical lines.Can be one of the following values:
  • Both: Both horizontal and vertical lines will be removed.
  • Horizontal: Only horizontal lines will be removed.
  • Vertical: Only vertical lines will be removed.
MaximumEdgeNoise System.Double The maximum amount of noise along either edge of a line.
MaximumSpeckSize System.String The maximum size of an artifact touching the edge of a line which should be considered a speck. Specks must have an aspect ratio less than or equal to 3. In the figure below, the solid black pixels outside the line (outlined in red) are artifacts that are touching the line.
MaxLineGap System.String The maximum gap which can appear in a line.
MaxLineThickness System.String The maximum thickness for a line to be removed.
MinCombFill System.Double The minimum fill percentage of a rectangle which will be considered a comb. A perfect comb "│" is a rectangular shape with a fill percentage of 100%. While few combs found on scanned images will be perfect, most will have a high fill percentage. Other shapes, such as ")" or "I", may fit the size requirements of a comb, but will have a significantly different fill percentage because they are not rectangular in shape.

For single connected combs, the fill percentage must meet or exceed the value specified here. For double-connected combs, the fill percentage must only be ½ of this value.

MinCombLength System.String The minimum length of a line segment which will be considered a comb. This value must be less than the minimum line length.
MinCombWeight System.Double When a quiet zone is in use, defines how "clear" the quiet zone must be. In a region which includes the comb itself plus the quiet zone, the percentage of feature pixels belonging to the comb must be equal to or greater than the value specified here. A value of 100% will require a completely clear quiet zone.
MinimumAspectRatio System.Double The minimum aspect ratio of any object to be considered a line. For example, with a ratio of 10, a horizontal line would have to have a ratio of at least 10 pixels wide to 1 pixel tall. For a vertical line, this is reversed and the ratio must be 10 pixels tall to 1 pixel wide.
10:1 Horizontal Ratio 10:1 Vertical Ratio
MinimumLineFill System.Double Defines the percentage of pixels along a line's path which must be black. This controls how "solid" a feature must be in order to be considered a line. A value of 100% will only detect solid black lines. A value of 0% will detect all lines which meet the minimum length and maximum gap requirements.
MinimumRunLength System.String Defines the sensitivity of straight line detection. Specifies the minimum length of a horizontal or vertical run of black pixels which will be considered part of a line
MinLineLength Grooper.IP.UnitLineLength The minimum length of lines to be detected and removed.
Owner Grooper.ConnectedObject Returns the node that owns the connected object, if any.
OwnerNode Grooper.GrooperNode Returns the node that owns the connected object, if any.
QuietZoneSize System.String For single-connected combs, specifies a region on either side of the comb which must be relatively clear of feature pixels.

◄────►
───┴───

The Minimum Weight property defines how "clear" this zone must be.

Designed to prevent skinny vertical characters from being mistaken for combs. For example, a lower-case "j" printed with underline produces a feature closely resembling a comb:

adjustment

In such cases, the "j" can be distinguished from an actual comb by using a quiet zone to check the amount of whitespace on each side.

RemoveNegatedRegions System.Boolean Specifies whether negated (white on black) regions of the image will be removed prior to line detection. Negated regions can interfere with line detection, and should be removed from the image prior to line detection. If a Negative Region Removal command is already being executed prior to this command in the IP Profile, then this property should be set to false to avoid duplicate processing. Otherwise, this property should be set to true.
Root Grooper.GrooperRoot Returns the root node
SupportedFormats System.String The pixel formats supported by this command.
SupportedPixelFormats System.Collections.Generic.IEnumerable(Of T) Returns a list of supported pixel formats of images that can be processed by the IP Command.
TrimDistance System.String The distance outside of detected lines at which connected components will be trimmed. Review the diagnostic image 'Trim Mask' after making changes to this property. The trim mask includes all pixels within a radius of Trim Distance from any detected line, and represents an absolute boundary for the edge of each line.

This property should be tuned so that lines are removed with minimal damage to objects which intersect the line.

Methods

Method Name Description
Apply(Image As GrooperImage, DiagMode As Boolean) As IpCommandResult
Parameters
Image
          Type: GrooperImage
          
 
DiagMode
          Type: Boolean
          
ApplyAtalaCommand(cmd As ImageCommand, Image As GrooperImage) As AtalaIpResult
Parameters
cmd
          Type: ImageCommand
          
 
Image
          Type: GrooperImage
          
ApplyCommand(Image As GrooperImage) As IpCommandResult
Parameters
Image
          Type: GrooperImage
          
ApplyImage(Image As GrooperImage) As GrooperImage
Parameters
Image
          Type: GrooperImage
          
GetMask(BinImage As GrooperImage, OriginalImage As GrooperImage, Result As IpCommandResult) As GrooperImage
Parameters
BinImage
          Type: GrooperImage
          
 
OriginalImage
          Type: GrooperImage
          
 
Result
          Type: IpCommandResult
          
GetProperties() As PropertyDescriptorCollection
GetReferences() As List(Of GrooperNode) Returns a list of GrooperNode objects referenced in the properties of this object.
IsPropertyEnabled(PropertyName As String) As Nullable(Of Boolean) Defines whether a property is currently enabled.
Parameters
PropertyName
          Type: String
          The name of the property to determine the enabled state for.
IsPropertyVisible(PropertyName As String) As Nullable(Of Boolean) Defines whether a property is currently visible.
Parameters
PropertyName
          Type: String
          The name of the property to determine the visible state for.
IsType(Type As Type) As Boolean Returns true if the object is of the type specified, or if it derives from the type specfied.
Parameters
Type
          Type: Type
          The type to check.
Serialize() As String Serializes the object.
SetDatabase(Database As GrooperDb) Sets the database connection of the object.
Parameters
Database
          Type: GrooperDb
          
SetOwner(Owner As ConnectedObject, SkipInitialization As Boolean) Sets the owner of the connected object with another object that implements the IConnected interface.
Parameters
Owner
          Type: ConnectedObject
          
 
SkipInitialization
          Type: Boolean
          
ToString() As String Returns a string value representation of the connected object.
ValidateProperties() As ValidationErrorList Validates the properties of the object, returning a list of validation errors.