# Source_QueryFrame

## Using of command

This command is use for read picture frame from video(camera) capture.Frame is store in picture array and you can work with this picture. Capture must be open before call this command. After call this command capture pointer is move to the next frame. So the first call of this command read first frame (or actual frame from camera), second call of this command call second frame and so on.. If you want read all frames from video file, number of call of this command is same as frame number in video file.

## Commands parameters

Command has 2 parameters:

1. Select capture: This option is use for select capture from which we want read frame. Click on line with this parameter display combobox with all possible captures. You can select Capture_0 to Capture_9. Selected capture must be open with command Source_ReadCamera or Source_ReadVideo before read of this command.
2. Frame as picture: This option select picture from picture array. Selected picture could be modified in the next program steps. You can select Picture_0 to Picture_19.
3. Get undistortion chan:Select undistortion channel where calibration data is stored. Use this option only if command Source_ReadCamera is used as a capture source!!! Selected channel must be same as channel selected in Source_ReadCamera command. Output picture will be calculated with undistortion matrix in selected channel. If commands Source_ReadVideo is used as a capture source, select None channel even if Real word units will be used for objects parameters. Command Source_ReadVideo does not provide calibration file and select undistortion channel on this option will return error code -15.

## Error codes

1. Error code -11:Bad capture index.This error means that selected capture has bad index (not in range 0 to 9). Check test program file if command Source_QueryFrame has correct format.
2. Error code -12:Bad picture index. This error means that selected picture has bad index (not in range 0 to 19). Check test program file if this command has correct format.
3. Error code -13: Input capture is not opened.
4. Error code -14: Bad undistortion channel. Channel number is more than 19
5. Error code -15: Error get undistortion image
6. Error code -100: OpenCV error. This error means OpenCV error in OPenCV function in this command. Command use OpenCV function: cvQueryFrame and cvCloneImage. Explanation of this error is in Result window.