ClearImage COM API
CleanNoiseExt Method
CiRepair Object : CleanNoiseExt Method
Maximum width of noise object in pixels
Maximum height of noise object in pixels
Maximum distance of noise object from an object that is large than maxNoiseSizeHorz or maxNoiseSizeVert
Set to 0
Description
Remove noise objects (extended)
Syntax
Visual Basic
Public Sub CleanNoiseExt( _
   ByVal Flags As ECleanNoiseFlags, _
   ByVal maxNoiseSizeHorz As Long, _
   ByVal maxNoiseSizeVert As Long, _
   ByVal minObjectDistance As Long, _
   ByVal reserved0 As Long _
) 
Parameters
Flags
ValueDescription
ciCnxBlackNoiseRemove black-on-white noise
ciCnxMarginsNoiseRemove black-on-white noise in margins area only
ciCnxWhiteNoiseRemove white-on-black noise
maxNoiseSizeHorz
Maximum width of noise object in pixels
maxNoiseSizeVert
Maximum height of noise object in pixels
minObjectDistance
Maximum distance of noise object from an object that is large than maxNoiseSizeHorz or maxNoiseSizeVert
reserved0
Set to 0
Remarks
If Flags has ciCnxMarginsNoise set, then black noise is removed in margins only.  Margins are areas adjacent to the edges of the image containing no objects larger than noise objects to be removed.
Example
Sub RepairMethods(imageFile As String, imageFileOut As String)
    ' Create objects and open input images
  Dim Ci As New CiServer
  Dim Repair As CiRepair: Set Repair = Ci.CreateRepair
  Repair.Image.Open imageFile
    ' Do Processing
  Repair.AutoDeskew                  ' Use AutoDeskew before AutoRotate
  Repair.AutoRotate
  '  Repair.AutoCrop 10, 10, 10, 10  ' Do not use AutoCrop with AutoRegister or BorderExtract
  '  Repair.AutoRegister 100, 100    ' Do not use AutoRegister with AutoCrop or BorderExtract
  Repair.AdvancedBinarize 0, 0, 0
  Repair.BorderExtract ciBexBorderDeskewCrop, ciBeaCleaner
  Repair.RemovePunchHoles
  Repair.SmoothCharacters ciSmoothDarkenEdges
  Repair.CleanNoise 3                ' Use CleanNoiseExt to remove white noise
  '  Repair.CleanNoiseExt (ciCnxBlackNoise + ciCnxWhiteNoise), 3, 3, 10, 0
  Repair.pLineCurvature = ciCurvLow
  Repair.pMaxLineAngle = 5
  Repair.pMaxLineGap = 5
  Repair.pMinLineLength = 200
  Repair.DeleteLines ciLineVertAndHorz, ciTrue
  Repair.Image.SaveAs imageFileOut, ciEXT
End Sub
See Also

CiRepair Object  | CiRepair Members