saltPepper
|
integer Type =0 ] )
|
|
Input
|
|
An integer between 0 and 116 specifying the input image frame number. A value of 0 represents the DMA memory buffer of the video device. Values in the range of 100-116 correspond to hidden frames.
|
|
Output
|
|
An integer between 1 and 116 specifying the output image frame number. Values in the range of 100-116 correspond to hidden frames.
|
|
Size
|
|
An integer between 1 and 3 specifying the radius of the "hat" used in the function.
|
|
Level
|
|
A floating variable or constant specifying the height of the "hat's crown". Any pixel that differs from the pixels under the "brim" by more than this value is considered to be noise.
|
|
Mode
|
|
An enumerated integer specifying whether the noise should be removed or extracted. Must be one of the following values:
|
|
M_REMOVE=0 removes salt & pepper noise from the image.
|
M_SELECT=1 extracts salt & pepper noise from the image.
|
Default value: M_REMOVE
|
|
Type
|
|
An enumerated integer specifying the type of noise to be processed. Must be one of the following values:
|
|
M_SALT=0 removes or extracts the bright noise.
|
M_PEPPER=1 remove or extracts the dark noise.
|
Default value: M_SALT
|
|
This set of statements applies an impulse noise to a sample image and then suppresses the noise by applying the salt&pepper filter two times:
|
|
setCurDir("samples")
|
loadIm (1,"sample14.iwd")
|
genImpulse (1,1,50)
|
saltPepper (1,2,1,0,M_SALT)
|
saltPepper (2,2,1,0,M_PEPPER)
|
|