Command Source_OpenFile
Using of command
This command is use for load picture from file to test program image structure. Command use OpenCv function cvLoadImage.
Following file formats are suported:
- Windows bitmaps - BMP, DIB
- JPEG files - JPEG, JPG, JPE
- Portable Network Graphics - PNG
- Portable image format - PBM, PGM, PPM
- Sun rasters - SR, RAS
- TIFF files - TIFF, TIF
- OpenEXR HDR images - EXR
- JPEG 2000 images - jp2
Commands parameters
Function has 3 parameters:
- Path to picture file: This parameter sets path for picture file which will be loaded.Click on this parameter line
open Open file dialog, where user can select picture file
- Load file parameter: This parameter specify colorness and depth of the loaded image.CV_LOAD_IMAGE_UNCHANGED load image in same depth and colorness as loaded file.The colorness specifies whether the loaded image is to be converted to 3 channels (CV_LOAD_IMAGE_COLOR), 1 channel (CV_LOAD_IMAGE_GRAYSCALE), or left as it was in the input file (CV_LOAD_IMAGE_ANYCOLOR).
Depth specifies whether the loaded image is to be converted to 8 bits per pixel per color channel as was customary in previous versions of OpenCV or left as they were in the input file. If CV_LOAD_IMAGE_ANYDEPTH is passed the pixel format can be 8 bit unsigned, 16 bit unsigned, 32 bit signed or 32 bit floating point.
- Load as picture. This parameter sets in which picture number file will be loaded.It can be select Picture_0 to Picture_19. This picture number will be use for work with image in test program.
-
Get undistortion chan: If you want to used real word units for get object parameter select undistortion channel for real world unit calculation. If some channel is selected set Size coeficient in the next option. If option None will be set on this option object parameters can be only in pixels unit.
-
Size coefficient: Write size coefficient which will be used for real world unit calculation in object parameters.
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
- Error code -11:File not exist. This error means that file in path selected in first parameter not exist. Check file name and file path.
- Error code -12:Bad file parameter.This error means error in second parameter. Check test program file if second parameter is select correctlly.
- Error code -13:Bad picture position number. This error means error in 3.command parameter. Check test program file if 3.parameter is select correctlly
- Error code -14:Bad undistortion channel was selected (Not from range 0 to 19)
- Error code -100:OpenCV error: This error is error inside OpenCv function cvLoadImage. Error decription is display in result window.