Despeckle(Int32,Int32,Int32,Int32) Method (SaneAcquiredImage)
In This Topic
Removes noise from image.
Syntax
'Declaration
Public Sub Despeckle( _
ByVal As Integer, _
ByVal As Integer, _
ByVal As Integer, _
ByVal As Integer _
)
public void Despeckle(
int ,
int ,
int ,
int
)
public: void Despeckle(
int ,
int ,
int ,
int
)
public:
void Despeckle(
int ,
int ,
int ,
int
)
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(Int32,Int32,Int32,Int32) method)
2. Deskew an image (Deskew(SaneBorderColor,Int32,Int32) method)
3. Detect image border (DetectBorder(Int32) method)
Example
Please see example here: SaneAcquiredImage.
Requirements
Target Platforms: .NET 9; .NET 8; .NET 7; .NET 6
See Also