.. _alvisiontoolbox-api: ALVisionToolbox API =================== :ref:`Overview ` | API | :ref:`Tutorial ` Namespace : **AL** .. code-block:: cpp #include Method list ----------- .. cpp:class:: ALVisionToolboxProxy * Methods: * :cpp:func:`ALVisionToolboxProxy::backlighting` * :cpp:func:`ALVisionToolboxProxy::halfPress` * :cpp:func:`ALVisionToolboxProxy::isItDark` * :cpp:func:`ALVisionToolboxProxy::isVideoRecording` * :cpp:func:`ALVisionToolboxProxy::logTPRInstanceInfo` * :cpp:func:`ALVisionToolboxProxy::setWhiteBalance` * :cpp:func:`ALVisionToolboxProxy::startVideoRecord` * :cpp:func:`ALVisionToolboxProxy::startVideoRecord_adv` * :cpp:func:`ALVisionToolboxProxy::stopTPR` * :cpp:func:`ALVisionToolboxProxy::stopVideoRecord` * :cpp:func:`ALVisionToolboxProxy::takePicture` * :cpp:func:`ALVisionToolboxProxy::takePictureRegularly` .. seealso:: * :ref:`Methods inherited from ALModule ` Methods ------- .. cpp:function:: int ALVisionToolboxProxy::backlighting() Indicates if NAO's active camera is in backlighting conditions. :return: - 0: no backlight - 1: possible backlight - 2: backlight identified .. cpp:function:: void ALVisionToolboxProxy::halfPress() Optional : prepares camera for shooting (like the auto-focus on standard and digital cameras) .. cpp:function:: int ALVisionToolboxProxy::isItDark() Tell if NAO's is in a dark environment. :return: - [0;4] outdoor - [5;100] indoor bright - [101;127] indoor artificial light - [128;210] indoor weak lights - [211;255] dark place .. cpp:function:: bool ALVisionToolboxProxy::isVideoRecording() :return: - True if the robot is currently recording a video with :cpp:func:`ALVisionToolboxProxy::startVideoRecord` or :cpp:func:`ALVisionToolboxProxy::startVideoRecord_adv` - False if not. .. cpp:function:: void ALVisionToolboxProxy::logTPRInstanceInfo(const int& instanceNumber) Shows logs related to :cpp:func:`ALVisionToolboxProxy::takePictureRegularly`. :param instanceNumber: number of the instance we want to get info on .. cpp:function:: void ALVisionToolboxProxy::setWhiteBalance(const int& camera) Set white balance by using NAO's white hands as reference. A call to this method makes NAO move his arm. :param camera: Camera we want to set white balance to : - [0] top - [1] bottom - [2] both .. cpp:function:: void ALVisionToolboxProxy::startVideoRecord(const std::string& videoName) Start recording a video. The .avi video is stored on the robot in the "/home/nao/.local/share/naoqi/share/naoqi/vision" folder. The record should be stopped by calling :cpp:func:`ALVisionToolboxProxy::stopVideoRecord`. Resolution: 320*240, MJPG format, frame rate ~10-15 fps. .. note:: Only one record at a time can be made. :param videoName: Name of the video file to be recorded .. cpp:function:: void ALVisionToolboxProxy::startVideoRecord_adv(const std::string& videoName, const float& framerate, const std::string& format, const int& resIndex, const int& numFrames) Start recording a video, with advanced options. Please note that only one record at a time can be made. :param videoName: Name of the video file to be recorded. :param framerate: Record frame rate [0.1-50.0]. Warning: MJPG format requires framerate greater than 2.0. :param format: - ARV (raw YUV422 format) - IYUV (raw avi) - MJPG (compressed avi) :param resIndex: Resolution index (e.g. kQQVGA, kQVGA, kVGA, k4VGA) :param numFrames: Number of frames to record. If less than 0, it records until stopVideoRecord() is called. .. cpp:function:: void ALVisionToolboxProxy::stopTPR(const std::string& pathAndNameRoot, const std::string& imageRecordFormat) Stop an instance of :cpp:func:`ALVisionToolboxProxy::takePictureRegularly`. :param pathAndNameRoot: path and name root of the file we want to stop recording :param imageRecordFormat: formats of the file we want to stop recording .. cpp:function:: AL::ALValue ALVisionToolboxProxy::stopVideoRecord() Stop a video record that was launched with :cpp:func:`ALVisionToolboxProxy::startVideoRecord` or :cpp:func:`ALVisionToolboxProxy::startVideoRecord_adv`. The function returns the number of frames that were recorded, as well as the video absolute path. :return: Array of two elements [numRecordedFrames, recordAbsolutePath] .. cpp:function:: void ALVisionToolboxProxy::takePicture() Shoot 3 successives pictures and place them in the "/home/nao/.local/share/naoqi/share/naoqi/vision" folder. .. note:: The call to this method can be shortened by calling :cpp:func:`ALVisionToolboxProxy::halfPress` before. .. cpp:function:: void ALVisionToolboxProxy::takePictureRegularly(const float& secondsBetweenTwoShots, const std::string& pathAndNameRoot, const bool& overwriteImage, const std::string& imageRecordFormat, const int& resolution) Shoot regularly a picture to follow NAO's evolution in his environment. Up to 8 instances for this blocking function can be launched, as long as pathAndNameRoot and/or imageRecordFormat parameters are different between two instances. :param secondsBetweenTwoShots: Time in seconds between two pictures :param pathAndNameRoot: path and the root of the name for the picture :param overwriteImage: - if True, one image will be regularly overwritten, - if False, new images will be regularly created (each being appended by a timestamp) :param imageRecordFormat: jpeg, bmp, png :param resolution: image resolution (e.g. kQQVGA, kQVGA)