VintaSoft Twain .NET SDK v10.2
Despeckle Method (AcquiredImage)




Vintasoft.WpfTwain Namespace > AcquiredImage Class : Despeckle Method
Maximal quantity of pixels in small noise. Possible values: 0 - 100. Default value is 8. What is "small noise" see below.
Maximal quantity of pixels in medium noise. Possible values: 0 - 100. Default value is 25. What is "medium noise" see below.
Radius of area around medium noise in which there are no "good objects". Possible values: 0 - 100. Default value is 30. What is "good objects" see below.
Maximal quantity of pixels in "border" noise. Possible values: 0 - 3000. Default value is 400. What is "border noise" see below.
Removes noise from image.
Syntax
'Declaration
 
Public Sub Despeckle( _
   ByVal level1 As Integer, _
   ByVal level2 As Integer, _
   ByVal radius As Integer, _
   ByVal level3 As Integer _
) 
'Usage
 
Dim instance As AcquiredImage
Dim level1 As Integer
Dim level2 As Integer
Dim radius As Integer
Dim level3 As Integer
 
instance.Despeckle(level1, level2, radius, level3)
public void Despeckle( 
   int level1,
   int level2,
   int radius,
   int level3
)
public: void Despeckle( 
   int level1,
   int level2,
   int radius,
   int level3
) 
public:
void Despeckle( 
   int level1,
   int level2,
   int radius,
   int level3
) 

Parameters

level1
Maximal quantity of pixels in small noise. Possible values: 0 - 100. Default value is 8. What is "small noise" see below.
level2
Maximal quantity of pixels in medium noise. Possible values: 0 - 100. Default value is 25. What is "medium noise" see below.
radius
Radius of area around medium noise in which there are no "good objects". Possible values: 0 - 100. Default value is 30. What is "good objects" see below.
level3
Maximal quantity of pixels in "border" noise. Possible values: 0 - 3000. Default value is 400. What is "border noise" see below.
Remarks
This method removes noise from image. Current algorithm removes three types of noise:

1. Small noise - a set of pixels (non background pixels) with quantity of pixels less than value of level1 parameter. This set of pixels will be replaced to background pixels.

2. Medium noise - a set of pixels (non background pixels) with quantity of pixels less than value of level2 parameter. This set of pixels will be replaced to background pixels if around this set of pixels in a region with radius of value of radius parameter there is no "good objects". "Good object" - not a noise.

3. "Border" noise - a set of pixels (non background pixels) with quantity of pixels less than value of level3 parameter. This set of pixels will be replaced to background pixels if at least one pixel from this set of pixels is located on an image border.

Here is a "good" sequence of operations for image processing:
1. Despeckle an image (Despeckle method)
2. Deskew an image (Deskew method)
3. Detect image border (DetectBorder method)
Example
Please see example here.
Requirements

Target Platforms: Windows 8, Windows 7, Windows Vista, Windows XP, Windows Server 2012, Windows Server 2008, Windows Server 2003

See Also

Reference

AcquiredImage Class
AcquiredImage Members
Deskew Method
DetectBorder Method