# Conversion_Smooth

## Using of command

Function smooths the image in one of several ways:

1. Blur:linear convolution with Aperture width x Aperture height box kernel (all 1) with subsequent scaling by 1/(Aperture width * Aperture height)
2. Gaussian: linear convolution with width Aperture width x Aperture height Gaussian kernel.
3. Median: Median filter width Aperture width x Aperture height square aperture.
4. Bilateral: bilateral filter with a Aperture width x Aperture height square aperture, color sigma= Standard deviation, and spatial sigma= Param4. If Aperture width =0, the aperture square side is set to cvRound(param4*1.5)*2+1()

## Commands parameters

Command has 5 parameters:

1. Source picture: You need select source picture.Source picture must be activated before use of this function. You can select Picture_0 to Picture_19.
2. Destination picture: You need select destination picture. Destination picture must be activated before use of this function. Source and destination picture can be same only in type Blur no scale, blur and Gausian. You can select Picture_0 to Picture_19.
3. Smooth type:You can select type of smooth.(Blur no scale,Blur,Gausian,Median,Bilateral).
4. Aperture width: The first parameter of the smoothing operation, the aperture width. Must be a positive odd number (1, 3, 5, ...)
5. Aperture height: The second parameter of the smoothing operation, the aperture height. Ignored by Median and Bilaterals methods. In the case of simple scaled/non-scaled and Gaussian blur if param2 is zero, it is set to param1. Otherwise it must be a positive odd number.
6. Standard deviation: In the case of a Gaussian parameter this parameter may specify Gaussian sigma (standard deviation). If it is zero, it is calculated from the kernel size:
   sigma= 0.3*(n/2-1)+0.8
   where n= Aperture width for horizontal kernel or n= Aperture height for vertical kernel
   Using standard sigma for small kernels (3x3to 7x7) gives better speed. If standard deviation is not zero, while Aperture width and Aperture height are zeros, the kernel size is calculated from the sigma (to provide accurate enough operation).
7. Param4: Spatial sigma in Bilateral smooth type.

## Error codes

1. Error code -11: Bad source picture position in picture array. Source picture is not in range 0-19. Check test program file if command has correct format.
2. Error code -12: Bad destination picture position in picture array. Destination picture is not in range 0-19. Check test program file if command has correct format.
3. Error code -13: Aperture width must be positive odd number.
4. Error code -14: Aperture height must be positive number or 0
5. Error code -100: OpenCV error. Explanation of this error will be displayed in result window.