ClearImage .NET API
DeleteLinesAndRepair Method
Example 





Inlite.ClearImageNet Namespace > ImageEditor Class : DeleteLinesAndRepair Method
Identifies orientation of deleted lines
Deletes image lines. Restores characters intersected by deleted lines.
Syntax
'Declaration
 
Public Sub DeleteLinesAndRepair( _
   ByVal dir As LineDirection _
) 
'Usage
 
Dim instance As ImageEditor
Dim dir As LineDirection
 
instance.DeleteLinesAndRepair(dir)
public void DeleteLinesAndRepair( 
   LineDirection dir
)
public procedure DeleteLinesAndRepair( 
    dir: LineDirection
); 
public function DeleteLinesAndRepair( 
   dir : LineDirection
);
public:
void DeleteLinesAndRepair( 
   LineDirection dir
) 

Parameters

dir
Identifies orientation of deleted lines
Remarks
Lines are identified based on the values of lineCurvature, lineMinLength, lineMaxGap  and lineMaxAngle  properties. After lines are deleted the remaining lines and portions of characters at the intersection with the removed lines are reconnected.
Example
void RepairMethods(string imageFile, string imageFileOut)
{
    ImageEditor editor = new ImageEditor();
    try
    {
        // Open image file
        editor.Image.Open(imageFile, 1);
        // Do Processing
        editor.AutoDeskew();                // Use AutoDeskew before AutoRotate
        editor.AutoRotate();
        // editor.AutoCrop(10, 10, 10, 10); // Do not use AutoCrop with AutoRegister or BorderExtract
        // editor.AutoRegister(100, 100);   // Do not use AutoRegister with AutoCrop or BorderExtract
        editor.AdvancedBinarize();
        editor.BorderExtract(BorderExtractMode.deskewCrop);
        editor.RemovePunchHoles();
        editor.SmoothCharacters();
        editor.CleanNoise(3);              // Remove only black pixels.  Use CleanNoiseExt to remove white noise
        // editor.CleanNoise(CleanNoiseFlags.black | CleanNoiseFlags.white, 3, 3, 10);
        editor.lineCurvature = LineCurvature.low;
        editor.lineMaxAngle = 5;
        editor.lineMaxGap = 5;
        editor.lineMinLength = 200;
        editor.DeleteLinesAndRepair(LineDirection.horzAndVert);
        //  Save processed image
       editor.Image.SaveAs(imageFileOut, Inlite.ClearImage.EFileFormat.ciEXT);
    }
    catch (ClearImageException ex)
    { Console.WriteLine(ex.Message); }
    finally
    {editor.Dispose(); }  // ClearImage V9 and later
}
See Also

Reference

ImageEditor Class
ImageEditor Members