# Conversion_Edge

## Using of command

Commands is use for edge finding on selected image. Edge algoritms use Laplace or Sobel algoritm. Sobel algoritm calculates the first, second, third or mixed derivatives using an extended Sobel operator. Size of the extended Sobel kernel, must be 1, 3, 5 or 7. In all cases except 1, an apertureSize x apertureSize separable kernel will be use to calculate the derivate.
The function calculates the image derivative by convolving the image with the appropriate kernel:
The Sobel operators combine Gaussian smoothing and differentiation so the result is more or less resistant to the noise. Most often, the function is called with (xorder = 1, yorder = 0, apertureSize = 3) or (xorder = 0, yorder = 1, apertureSize = 3) to calculate the first x- or y- image derivative. The first case corresponds to a kernel of:
and the second one corresponds to a kernel of:
or a kernel of:
Laplace algoritm calculates the Laplacian of the source image by adding up the second x and y derivatives calculated using the Sobel operator:

## 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. You can select Picture_0 to Picture_19.
3. Edge method: You can select type of edge function. You can choose Sobel (Sobel algoritm will be aplied) or Laplace (Laplace algoritm will be aplied
4. Aperture size: You can select size of kernel. You can choose size 1,3,5,7.
5. Xorder: This parameter is use only when Sobel method is use. Parameter sets order of the derivative x
6. Yorder: This parameter is use only when Sobel method is use. Parameter sets order of the derivative y

## 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: Bad aperture size number. Aperture size is not 1,3,5 or 7. Check test program file if command has correct format.
4. Error code -14: Xorder is less than 0. Xorder number must be more or equal 0.
5. Error code -15: Yorder is less than 0. Yorder number must be more or equal 0.
6. Error code -100: OpenCV error. Explanation of this error will be displayed in result window.