Previous topic

ecto opencv cells

Next topic

Highgui Cells

This Page

ecto_opencv.calib

The calib module contains cells that deal with camera calibration, fiducial pose estimation, and structure from motion.

ecto_opencv.calib

GatherPoints

Brief doc

Gather points found by multiple patterns.

Parameters

  • N   type: int    not required   default: 2

    Number of patterns to gather

Inputs

  • found_0000   type: bool   

  • found_0001   type: bool   

  • ideal_0000   type: std::vector<cv::Point3_<float>, std::allocator<cv::Point3_<float> > >   

    The ideal object points.

  • ideal_0001   type: std::vector<cv::Point3_<float>, std::allocator<cv::Point3_<float> > >   

    The ideal object points.

  • points_0000   type: std::vector<cv::Point_<float>, std::allocator<cv::Point_<float> > >   

    Image points

  • points_0001   type: std::vector<cv::Point_<float>, std::allocator<cv::Point_<float> > >   

    Image points

Outputs

  • found   type: bool   

    Found some points.

  • ideal   type: std::vector<cv::Point3_<float>, std::allocator<cv::Point3_<float> > >   

    The ideal pattern points.

  • out   type: std::vector<cv::Point_<float>, std::allocator<cv::Point_<float> > >   

    The observed pattern points.

SubrectRectifier

Brief doc

Pull a trapezoid out of an image and rectify

Parameters

  • xoffset   type: float    not required   default: 0.0

    x offset from input pose in world meters

  • xsize_pixels   type: unsigned int    not required   default: 250

    x size of extracted image in pixels

  • xsize_world   type: float    not required   default: 0.10000000149

    x size of extracted rectangle in world meters

  • yoffset   type: float    not required   default: 0.0

    y offset from input pose in world meters

  • ysize_pixels   type: unsigned int    not required   default: 250

    y size of extracted image in pixels

  • ysize_world   type: float    not required   default: 0.10000000149

    y size of extracted rectangle in world meters

  • zoffset   type: float    not required   default: 0.0

    z offset from input pose in world meters

Inputs

  • K   type: cv::Mat   

    The camera projection matrix.

  • R   type: cv::Mat   

    3x3 Rotation matrix.

  • T   type: cv::Mat   

    3x1 Translation vector.

  • image   type: cv::Mat   

    input image

Outputs

  • output   type: cv::Mat   

    Output extracted rectified rectangle

LatchMat

Brief doc

Latch a cv::Mat.

Inputs

  • input   type: cv::Mat   

    The input to copy to the output..

  • reset   type: bool   

    The latch a value.

  • set   type: bool   

    The latch a value.

Outputs

  • output   type: cv::Mat   

    A copy of the input.

  • set   type: bool   

    Is the output set.

PoseDrawer

Brief doc

Draw pose

Inputs

  • K   type: cv::Mat   

    The camera projection matrix.

  • R   type: cv::Mat   

    3x3 Rotation matrix.

  • T   type: cv::Mat   

    3x1 Translation vector.

  • image   type: cv::Mat   

    The original image to draw the pose onto.

  • trigger   type: bool   

    Should i draw.

Outputs

  • output   type: cv::Mat   

    The pose of the fiducial, drawn on an image

DepthTo3d

Brief doc

Converts depth to 3d points.

Inputs

  • K   type: cv::Mat   

    The calibration matrix

  • depth   type: cv::Mat   

    The depth image

  • mask   type: cv::Mat   

    The mask of the points to send back

Outputs

  • points3d   type: cv::Mat   

    The 3d points, height by width (or 1 by n_points if mask) with 3 channels (x, y and z)

CameraIntrinsics

Brief doc

This reads a camera calibration file and puts the results on the outputs.

Parameters

  • camera_file   type: std::string    not required   default: camera.yml

    The camera calibration file. Typically a .yml

Outputs

  • D   type: cv::Mat   

    The distortion vector.

  • K   type: cv::Mat   

    3x3 camera intrinsic matrix.

  • camera_model   type: std::string   

    The camera model. e.g pinhole,...

  • image_size   type: cv::Size_<int>   

    The image size.

LatchBool

Brief doc

Latch a bool.

Inputs

  • input   type: bool   

    The input to copy to the output..

  • reset   type: bool   

    The latch a value.

  • set   type: bool   

    The latch a value.

Outputs

  • output   type: bool   

    A copy of the input.

  • set   type: bool   

    Is the output set.

DepthTo3dSparse

Brief doc

Converts depth to 3d points.

Inputs

  • K   type: cv::Mat   

    The calibration matrix

  • depth   type: cv::Mat   

    The depth image

  • points   type: cv::Mat   

    The 2d coordinates (matrix with 2 channels)

Outputs

  • points3d   type: cv::Mat   

    The 3d points, same dimensions as the input, 3 channels (x, y and z).

DepthValidDraw

Brief doc

DepthValidDraw q.

Inputs

  • image   type: cv::Mat   

    The image

  • mask   type: cv::Mat   

    The depth mask

Outputs

  • image   type: cv::Mat   

    Valid areas of the image.

Select3d

Brief doc

Select 3D points given 2D locations.

Inputs

  • points   type: cv::Mat   

    The 2d coordinates (matrix with 2 channels)

  • points3d   type: cv::Mat   

    The 3d points to select from.

Outputs

  • points3d   type: cv::Mat   

    The 3d points, same dimensions as the input, 3 channels (x, y and z).

CameraCalibrator

Brief doc

Accumulates observed points and ideal 3d points, and runs opencv calibration routines after some number of satisfactorily unique observations.

Parameters

  • n_obs   type: int    not required   default: 50

    Number of observations

  • output_file_name   type: std::string    not required   default: camera.yml

    The name of the camera calibration file

  • quit_when_calibrated   type: bool    not required   default: True

    return QUIT from process once calibration done

Inputs

  • found   type: bool   

  • ideal   type: std::vector<cv::Point3_<float>, std::allocator<cv::Point3_<float> > >   

    The ideal object points.

  • image   type: cv::Mat   

    The image that is being used for calibration

  • points   type: std::vector<cv::Point_<float>, std::allocator<cv::Point_<float> > >   

    Image points

Outputs

  • calibrated   type: bool   

    Done calibration

  • norm   type: float   

    Norm of the input points to all previous points observed.

PointsTo3d

Brief doc

Converts depth to 3d points.

Parameters

  • scale   type: double    not required   default: 1.0

    Pixel to metric scale factor. u * scale = x, v * scale = y

  • transpose   type: bool    not required   default: False

    Transpose the input, to accept a 2xN matrix.

Inputs

  • points   type: cv::Mat   

    A Nx2 matrix, of real values.

Outputs

  • points3d   type: cv::Mat   

    The 3d points, same dimensions as the input, 3 channels (x, y and z).

CircleDrawer

Brief doc

Draw circles...

Inputs

  • circles   type: std::vector<cv::Vec<float, 3>, std::allocator<cv::Vec<float, 3> > >   

    Circles to draw, (x,y,radius).

  • image   type: cv::Mat   

    The image to draw to.

Outputs

  • image   type: cv::Mat   

    The image to draw to.

PatternDetector

Brief doc

Detect chessboards, circles, acircles

Parameters

  • cols   type: int    not required   default: 11

    Number of dots in col direction

  • offset_x   type: float    not required   default: 0.0

    Offset in x.

  • offset_y   type: float    not required   default: 0.0

    Offset in y.

  • offset_z   type: float    not required   default: 0.0

    Offset in z.

  • pattern_type   type: calib::Pattern    not required   default: ASYMMETRIC_CIRCLES_GRID

    Legal Values: CHESSBOARD (0)   CIRCLES_GRID (1)   ASYMMETRIC_CIRCLES_GRID (2)  

    The pattern type

  • rows   type: int    not required   default: 4

    Number of dots in row direction

  • square_size   type: float    not required   default: 1.0

    The dimensions of each square

Inputs

  • input   type: cv::Mat   

    The grayscale image to search for a calibration pattern in.

Outputs

  • found   type: bool   

    Whether or not a pattern was found...

  • ideal   type: std::vector<cv::Point3_<float>, std::allocator<cv::Point3_<float> > >   

    The ideal pattern points.

  • out   type: std::vector<cv::Point_<float>, std::allocator<cv::Point_<float> > >   

    The observed pattern points.

PatternDrawer

Brief doc

draw pattern

Parameters

  • cols   type: int    not required   default: 11

    Number of dots in col direction

  • rows   type: int    not required   default: 4

    Number of dots in row direction

Inputs

  • found   type: bool   

    Found the pattern

  • input   type: cv::Mat   

    The image to to find a vertical lazer line in.

  • points   type: std::vector<cv::Point_<float>, std::allocator<cv::Point_<float> > >   

    Circle pattern points.

Outputs

  • out   type: cv::Mat   

    Pattern Image

TransformCompose

Brief doc

Compose to transforms.

Inputs

  • R1   type: cv::Mat   

    3x3 Rotation matrix.

  • R2   type: cv::Mat   

    3x3 Rotation matrix.

  • T1   type: cv::Mat   

    3x1 Translation vector.

  • T2   type: cv::Mat   

    3x1 Translation vector.

Outputs

  • R   type: cv::Mat   

    3x3 Rotation matrix.

  • T   type: cv::Mat   

    3x1 Translation vector.

PosesDrawer

Brief doc

Draw poses

Inputs

  • K   type: cv::Mat   

    The camera projection matrix.

  • Rs   type: std::vector<cv::Mat, std::allocator<cv::Mat> >   

    3x3 Rotation matrix.

  • Ts   type: std::vector<cv::Mat, std::allocator<cv::Mat> >   

    3x1 Translation vector.

  • image   type: cv::Mat   

    The original image to draw the pose onto.

  • trigger   type: bool   

    Should i draw.

Outputs

  • output   type: cv::Mat   

    The pose of the fiducial, drawn on an image

FiducialPoseFinder

Brief doc

Given 2D observations and their 3d corresponding points, estimate a 6 DOF pose.

Inputs

  • K   type: cv::Mat   

    The camera projection matrix.

  • found   type: bool   

  • ideal   type: std::vector<cv::Point3_<float>, std::allocator<cv::Point3_<float> > >   

    The ideal object points.

  • points   type: std::vector<cv::Point_<float>, std::allocator<cv::Point_<float> > >   

    Image points

Outputs

  • R   type: cv::Mat   

    3x3 Rotation matrix.

  • T   type: cv::Mat   

    3x1 Translation vector.

CropBox

Brief doc

Given an rgb, a depth image and a points3d matrix, returns only what is inside a bounding box.

Parameters

  • crop_enabled   type: bool    not required   default: True

    If the cropper cell is enabled

  • x_max   type: float    not required   default: 3.40282346639e+38

    The maximum x value (in the camera reference frame)

  • x_min   type: float    not required   default: -3.40282346639e+38

    The minimum x value (in the camera reference frame)

  • y_max   type: float    not required   default: 3.40282346639e+38

    The maximum y value (in the camera reference frame)

  • y_min   type: float    not required   default: -3.40282346639e+38

    The minimum y value (in the camera reference frame)

  • z_max   type: float    not required   default: 3.40282346639e+38

    The maximum z value (in the camera reference frame)

  • z_min   type: float    not required   default: -3.40282346639e+38

    The minimum z value (in the camera reference frame)

Inputs

  • depth   type: cv::Mat   

    The depth image

  • points3d   type: cv::Mat   

    The 3d points: width by height by 3 channels

  • rgb   type: cv::Mat   

    The rgb image

Outputs

  • depth   type: cv::Mat   

    The depth image

  • mask   type: cv::Mat   

    The mask of what is within the depth range in the image

  • points3d   type: cv::Mat   

    The 3d points: width by height by 3 channels

  • rgb   type: cv::Mat   

    The rgb image

Select3dRegion

Brief doc

Select 3D points given a radius in the center of the image.

Parameters

  • radius   type: float    not required   default: 0.0

    A radius, in pixel with which to select a plane, from the center.

Inputs

  • image   type: cv::Mat   

    To base the size off of.

  • points3d   type: cv::Mat   

    The 3d points to select from.

Outputs

  • points3d   type: cv::Mat   

    The 3d points, same dimensions as the input, 3 channels (x, y and z).

DepthMask

Brief doc

Converts depth map to a mask, assuming that invalid points are == 0.

Inputs

  • depth   type: cv::Mat   

    The depth image

Outputs

  • mask   type: cv::Mat   

    Valid points