Skip to content

Vision

Vision - Localize Pattern 2D

Localizes the center of a given template image inside the current camera image. It is possible to define a region of interest (ROI) within the camera image to search for the object. The pixel positions U and V and the localized pose in world coordinates are returned. The function block uses homography based on the points obtained from SIFT algorithm.

Name Data type Description
Inputs Template Image String Template image of the object to be localized. The file needs to be placed in the directory ~/.dnb/data/vision/. Several files can be stated comma-separated.
ROI: X1 Integer X value of top left corner of the ROI in pixels.
ROI: Y1 Integer Y value of top left corner of the ROI in pixels.
ROI: X2 Integer X value of bottom right corner of the ROI in pixels. A value of -1 takes the image width.
ROI: Y2 Integer Y value of bottom right corner of the ROI in pixels. A value of -1 takes the image height.
Result: Minimum Match Points Integer Minimum number of matching points to return a success.
Result: Ignore Orientation Boolean True: The orientation of the detected pattern is ignored.
ROS Camera Topic String The name of the camera image stream.
Extrinsic Calibration Name String The name of the calibration file e.g. 'default'
Image Encoding String Encoding of the camera image.
Outputs Pixel U Integer Pixel coordinate U in the image of the camera topic.
Pixel V Integer Pixel coordinate V in the image of the camera topic.
Localized Position Pose World pose of the localized object.
Success Boolean True if detection was successful. False otherwise.
Image Found String The filename of the image for the case several template images have been configured.
Exceptions CALIBRATION_EXCEPTION - The exception is raised, if the Vision Module Component is not started or the calibration saved there is not valid.
TEMPLATE_FILE_NOT_FOUND - The exception is raised, if the template image file can not be found.
SCENE_ERROR - The exception is raised, if the observed scene could not be processed.

Vision - Save Camera Image

Saves the current camera image as JPEG file.

Name Data type Description
Inputs Camera Image Topic String The name of a ROS image stream topic.
Filename String The name of the filename. The file can be found later in the directory ~/.dnb/data/vision/images_saved/
File Format Select Format of the saved image file. Available are: jpeg, png
Outputs -

Vision - Localize Rectangle 2D

Localizes the center if a given rectangle inside the current camera image. It is possible to define a region of interest (ROI) within the camera image to search for the rectangle. The pixel positions U and V and the localized pose in world coordinates are returned.

Name Data type Description
Inputs Filter: Rectangle Length Integer Length of longer side of rectangle in mm.
Filter: Rectangle Width Integer Length of shorter side of rectangle in mm.
Filter: Lenghts Tolerance Integer Tolerance of rectangle length and width in ±mm.
Vision: Bright Background Boolean True: bright background; False: dark background
Vision: Gaussian Blur Kernel Size Integer Kernel size in pixels. The kernel size needs to be positive and odd.
Vision: Binary Threshold Integer Threshold within [0..255].
ROI: X1 Integer X value of top left corner of the ROI in pixels.
ROI: Y1 Integer Y value of top left corner of the ROI in pixels.
ROI: X2 Integer X value of bottom right corner of the ROI in pixels. A value of -1 takes the image width.
ROI: Y2 Integer Y value of bottom right corner of the ROI in pixels. A value of -1 takes the image height.
Result: Orientation Alignment Boolean Should orientation/angle be parallel to long edge? true: yes; false: no/short edge
Result: Favorite Angle Integer Close to which angle in degree the returned orientation should be.
ROS Camera Topic String The name of the camera image stream.
Extrinsic Calibration Name String The name of the calibration file e.g. 'default'
Image Encoding String Encoding of the camera image.
Outputs Pixel U Integer Coordinate U in pixels in the image of the camera topic.
Pixel V Integer Coordinate V in pixels in the image of the camera topic.
Localized Position Pose World pose of the localized rectangle.
Success Boolean True if detection was successful. False otherwise.
Exceptions CALIBRATION_EXCEPTION - The exception is raised, if the Vision Module Component is not started or the calibration saved there is not valid.

Vision - QR Code Reader

Localizes and decodes the barcodes (EAN-13/UPC-A, UPC-E, EAN-8, Code 128, Code 39, Interleaved 2 of 5) and QR Codes. It is possible to define a region of interest (ROI) within the camera image to search for the code. The pixel positions U and V and the localized pose in world coordinates are returned.

Name Data type Description
Inputs ROI: X1 Integer X value of top left corner of the ROI in pixels.
ROI: Y1 Integer Y value of top left corner of the ROI in pixels.
ROI: X2 Integer X value of bottom right corner of the ROI in pixels. A value of -1 takes the image width.
ROI: Y2 Integer Y value of bottom right corner of the ROI in pixels. A value of -1 takes the image height.
ROS Camera Topic String The name of the camera image stream.
Extrinsic Calibration Name String The name of the calibration file e.g. 'default'
Image Encoding String Encoding of the camera image.
Outputs Pixel U Integer Coordinate U in pixels in the image of the camera topic.
Pixel V Integer Coordinate V in pixels in the image of the camera topic.
Localized Position Pose World pose of the localized rectangle.
Success Boolean True if detection was successful. False otherwise.
Decoded Text String The text contained in the recognized barcode or QR Code.
Code Type String Type of the recognized code.
Exceptions CALIBRATION_EXCEPTION - The exception is raised, if the Vision Module Component is not started or the calibration saved there is not valid.