Conversion_Roi
Using of command
Function sets region of interest on selected picture. Region of interest is represented by rectange. If region of interest is sets on selected picture, all next operation on this picture will be execute only in this region. Operation only in region of interest save function time.
Commands parameters
Command has 10 parameters:
- Source picture: You can select picture where ROI is set or reset. You can select Picture_0 to Picture_19.
- X-coordinate: You can select from where X coordinate of the left most rectangle corner will be use. You can select Variable_0 to Variable_99 (in this case x-coordinate will be value from selected variable) or "Number". When option "NUmber" is selected, x-coordinate will be set from number in next parameter. X-coordinate is value in pixel from left corner of picture.
- X-cor Number: If option "Number" in previous parameter was select you can write x-cor number in pixeles in this line.
- Y-coordinate: You can select from where Y-coordinate of the top most rectangle corner will be use. You can select Variable_0 to Variable_99 (in this case y-coordinate will be value from selected variable) or "Number". When option "Number" is selected, y-coordinate will be set from number in next parameter. Y-coordinate is value in pixel from top corner of picture.
- Y-cor Number: If option "Number" in previous parameter was selected you can write y-cor number in pixeles in this line.
- Width: You can select from where Width of ROI will be select. You can select Variable_0 to Variable_99 (in this case width will be value from selected variable) or "Number". When option "Number" is selected, width will be set from number in next parameter. Width number is in pixels.
- Width Number: If option "Number" in previous parameter was selected you can write width number in pixels in this line.
- Height:You can select from where height of ROI will be select. You can select Variable_0 to Variable_99 (in this case height will be value from selected variable) or "Number". When option "Number" is selected, height will be set from number in next parameter. Height number is in pixels.
- Height Number: If option "Number" in previous parameter was selected you can write height number in pixels in this line.
Edit mode
You can select ROI area directly on tested picture.You need set break on line with Conversion_Roi command when option set is select. Then you need run program in debug mode. When program stop on line with Coversion_Roi command, select option Run one step from toolbar or menu. Then Edit window with tested picture will display. Red rectangle on picture show ROI are with current setup. You can change this area by left click on the one corner of new area than move cursor on the second corner of ROI area and release left button. New area will be show by red rectangle and parameter numbers will be recalculate to new values. When you press Exit button ,you can select if you want use new data in test program. If you select yes test program will use new data. This option sets all dimension parameters to "Number". So if you use variables as dimension parameters, this parameters will be rewrite to Number.
Error codes
- Error code -11: Bad position in picture array. Error means than Picture intex is not in range 0 to 19. Check test program file if command has correct format.
- Error code -12: Bad position in variable array.Error means taht variable index is not in range 0 to 99. Check test program file if command has correct format.
- Error code -13: X_cor is less than 0. X- coordinate must be more or equal than 0.
- Error code -14: X-cor is more than picture width. X-coordinate must be less than width of selected picture.
- Error code -15: Y_cor is less than 0. Y-coordinate must be more or equal than 0.
- Error code -16: Y-cor is more than picture height. Y-coordinate must be less than height of selected picture.
- Error code -17: Width is less or equal 0. Width value must be more than 0.
- Error code -18: Width is more than picture width. Width value + X-coordinate must be less or equal than picture width
- Error code -19: Height is less or equal 0. Height value must be more than 0.
- Error code -20: Height is more than picture height. Height value+ Y-coordinate must be less or equal tha picture height.
- Error code -100: OpenCv error: Error was generated by OpenCV function cvSetImageROI or cvResetImageROI. Explanation of this error
will be display in command window.