LATEST VERSION 4.0 (10.07.2012)

Description

Very simple module based on OpenCV capture functions. It allows to get image from camera device.

Module functions

UCamera.image; - acces to UImage, you can see image in Urbi console also
UCamera.notify; - 1 if camera capture new image after read image (def. 0)
UCamera.fps; - set max image refresh in fps (def. 100)
UCamera.imgFlip; - rotate image (0 - 0 deg, 1 - 90 deg, 2 - 180 deg, 3 - 270 deg)
UCamera.width; - returns image width in pixels
UCamera.height; - returns image height in pixels
UCamera.getImage(); - capture new image, use this function to manualy capture
UCamera.getCaptureProperty(value); - get capture property
UCamera.setCaptureProperty(property_id,value); - set capture property

property_id:
CV_CAP_PROP_POS_MSEC =0,
CV_CAP_PROP_POS_FRAMES =1,
CV_CAP_PROP_POS_AVI_RATIO =2,
CV_CAP_PROP_FRAME_WIDTH =3,
CV_CAP_PROP_FRAME_HEIGHT =4,
CV_CAP_PROP_FPS =5,
CV_CAP_PROP_FOURCC =6,
CV_CAP_PROP_FRAME_COUNT =7,
CV_CAP_PROP_FORMAT =8,
CV_CAP_PROP_MODE =9,
CV_CAP_PROP_BRIGHTNESS =10,
CV_CAP_PROP_CONTRAST =11,
CV_CAP_PROP_SATURATION =12,
CV_CAP_PROP_HUE =13,
CV_CAP_PROP_GAIN =14,
CV_CAP_PROP_EXPOSURE =15,
CV_CAP_PROP_CONVERT_RGB =16,
CV_CAP_PROP_WHITE_BALANCE_BLUE_U =17,
CV_CAP_PROP_RECTIFICATION =18,
CV_CAP_PROP_MONOCROME =19,
CV_CAP_PROP_SHARPNESS =20,
CV_CAP_PROP_AUTO_EXPOSURE =21,
CV_CAP_PROP_GAMMA =22,
CV_CAP_PROP_TEMPERATURE =23,
CV_CAP_PROP_TRIGGER =24,
CV_CAP_PROP_TRIGGER_DELAY =25,
CV_CAP_PROP_WHITE_BALANCE_RED_V =26,

How to use in urbiscript

loadModule("UCamera");
var Global.Cam=UCamera.new(0); // choose device 0 
Cam.setCaptureProperty(3,1280);
Cam.setCaptureProperty(4,960);
Cam.notify=1; // Get new frame every UImage access 
Cam.fps=20; // Set max img fps 
Cam.image; // Acces to UImage variable 

Download

LINK

 

 

 

EMYS and FLASH are Open Source and distributed according to the GPL v2.0 © Rev. 0.8.0, 27.04.2016

FLASH Documentation