# Command Source_ReadCamera

## Using of command

This command is use for read video stream from camera. Function open selected camera and save capture to one of selected capture array. Command use OpenCv function cvCaptureFromCAM for read camera.

## Commands parameters

Function has 2 parameters:

1. Select camera: This parameter is use for selection of camera.It can be select camera number from 0 to 19. Camera number is according your operating system.
2. Select capture: This parameter is use for select capture array where video stream from camera will be save. It can be select Capture_0 to Capture_9.
3. Get undistortion chan: This parameter sets if we want to use undistortion image according calibration file. It can be used 20 channels for undistortion file.If you select option none, calibration file will not be used and real image from camera will be used
4. Calibration file: This parameter is for select calibration file if you select some channel in previous option.
5. Size coefficient: Write size coefficient which will be used for real world unit calculation in object parameters. It must be used some undistorion channel in parameter Get undistortion chan.
   How to find size coeficient:
   - Find object dimmension in pixels
   - Measure real object dimension in real world unit (for example mm)
   - Calculate Size coeficient: Object dimension in pixels / real object dimension

## Error codes

1. Error code -11: Bad camera index. Error means that camera index in eli file is not correct. Check eli file.
2. Error code -12: Bad capture index. Capture index in eli file is not correct. It must be Capture_0 to Capture_9. Check eli file
3. Error code -13: Cameras is not open. Selected camera was not found. Check if camera is connected or camera driver.
4. Error code -14: Bad undistortion channel. There are channels number more than 19
5. Error code -15: Can not open calibration file
6. Error code -100: OpenCv error. Error is generated in OpenCv function cvCaptureFromCAM.Explanation of this error is in result window.