Robot Raconteur Companion C++ Library
Loading...
Searching...
No Matches
ImageUtil.h File Reference

Go to the source code of this file.

Functions

static cv::Mat RobotRaconteur::Companion::Util::ImageToMat (const com::robotraconteur::image::ImagePtr &image)
 Convert a Robot Raconteur standard image to an OpenCV Mat.
static com::robotraconteur::image::ImagePtr RobotRaconteur::Companion::Util::MatToImage (const cv::Mat &mat, com::robotraconteur::image::ImageEncoding::ImageEncoding encoding)
 Convert an OpenCV Mat to a Robot Raconteur standard image.

Detailed Description

Author
John Wason, PhD
License
Software License Agreement (Apache License)
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Function Documentation

◆ ImageToMat()

cv::Mat RobotRaconteur::Companion::Util::ImageToMat ( const com::robotraconteur::image::ImagePtr & image)
static

Convert a Robot Raconteur standard image to an OpenCV Mat.

Converts a com.robotraconteur.image.Image to an OpenCV Mat

Currently supported Robot Raconteur encodings:

  • rgb888
  • rgba8888
  • bgr888
  • bgra8888
  • mono8
  • mono16, depth_u16
  • mono32, depth_u32
  • mono_f16
  • mono_f32, depth_f32
  • mono_f64, depth_f64
Parameters
imageThe com.robotraconteur.imaging.Image to convert
Returns
cv::Mat The OpenCV Mat

◆ MatToImage()

com::robotraconteur::image::ImagePtr RobotRaconteur::Companion::Util::MatToImage ( const cv::Mat & mat,
com::robotraconteur::image::ImageEncoding::ImageEncoding encoding )
static

Convert an OpenCV Mat to a Robot Raconteur standard image.

Converts an OpenCV Mat to a com.robotraconteur.image.Image

Currently supported Robot Raconteur encodings:

  • rgb888
  • rgba8888
  • bgr888
  • bgra8888
  • mono8
  • mono16, depth_u16
  • mono32, depth_u32
  • mono_f16
  • mono_f32, depth_f32
  • mono_f64, depth_f64

The format of the input Mat must match the specified encoding

Parameters
matThe OpenCV Mat to convert
encodingThe desired Robot Raconteur image encoding
Returns
com::robotraconteur::image::ImagePtr The Robot Raconteur image