NDEVR
API Documentation
OpenCVImageRaster

A MaterialRasterBase implementation that uses OpenCV for image stitching and raster compositing. More...

Inheritance diagram for OpenCVImageRaster:
[legend]
Collaboration diagram for OpenCVImageRaster:
[legend]

Public Member Functions

 OpenCVImageRaster (const String &image_id, const Vector< 2, uint04 > &size)
 Constructs an OpenCVImageRaster with the given image ID and size.
 OpenCVImageRaster (const String &image_id, const Vector< 2, uint04 > &size, const RGBColor &background_color)
 Constructs an OpenCVImageRaster with a background color.
void addImageBuffer (const Buffer< uint01 > &pixels, const Vector< 2, uint04 > &size, const Matrix< fltp08 > &camera_matrix) override
 Adds an image buffer to the stitching queue.
void clearRaster ()
 Clears all accumulated images from the stitching buffer.
const StringimageID () const override
 Gets the unique image identifier for this raster.
void setUnsetColor (RGBColor color)
 Sets the color used for unset pixels.
void setup ()
 Initializes the stitcher and creates the initial blank image.
void updateImage () override
 Stitches all accumulated images and updates the raster output.
Public Member Functions inherited from MaterialRasterBase
 MaterialRasterBase (const RasterInfo &raster_info)
 Constructs the base raster with the given raster configuration.
virtual void addPixelInfo (const RGBColor &pixel, const Vector< 2, fltp08 > &location, uint04 weight)=0
 Adds a single pixel color at a normalized floating-point location with a weight.
virtual void addPixelInfo (const RGBColor &pixel, const Vector< 2, uint04 > &location, uint08 weight)=0
 Adds a single pixel color at an integer pixel location with a weight.
virtual void addPixelInfo (const Vector< 4, fltp04 > &pixel, const Vector< 2, fltp08 > &location, uint08 weight)=0
 Adds a single pixel as a normalized float RGBA vector at a normalized location with a weight.
virtual void addPixelInfo (const Vector< 4, fltp04 > &pixel, const Vector< 2, uint04 > &location, uint08 weight)=0
 Adds a single pixel as a normalized float RGBA vector at an integer pixel location with a weight.

Protected Attributes

std::vector< cv::Mat > imgs
 Accumulated images awaiting stitching.
String m_image_id
 The unique image identifier.
Vector< 2, uint04m_size
 The pixel dimensions of the output raster.
cv::Ptr< cv::Stitcher > m_stitcher
 The OpenCV stitcher instance.
Protected Attributes inherited from MaterialRasterBase
RasterInfo m_raster_info
 The raster configuration settings.

Detailed Description

A MaterialRasterBase implementation that uses OpenCV for image stitching and raster compositing.


Definition at line 16 of file OpenCVImageRaster.h.

Constructor & Destructor Documentation

◆ OpenCVImageRaster() [1/2]

OpenCVImageRaster::OpenCVImageRaster ( const String & image_id,
const Vector< 2, uint04 > & size )
inline

Constructs an OpenCVImageRaster with the given image ID and size.

Parameters
[in]image_idThe unique identifier for this raster image.
[in]sizeThe pixel dimensions (width, height) of the raster.

Definition at line 23 of file OpenCVImageRaster.h.

References m_image_id, m_size, m_stitcher, and setup().

◆ OpenCVImageRaster() [2/2]

OpenCVImageRaster::OpenCVImageRaster ( const String & image_id,
const Vector< 2, uint04 > & size,
const RGBColor & background_color )
inline

Constructs an OpenCVImageRaster with a background color.

Parameters
[in]image_idThe unique identifier for this raster image.
[in]sizeThe pixel dimensions (width, height) of the raster.
[in]background_colorThe background fill color for unset pixels.

Definition at line 35 of file OpenCVImageRaster.h.

References m_image_id, m_size, m_stitcher, setUnsetColor(), and setup().

Member Function Documentation

◆ addImageBuffer()

void OpenCVImageRaster::addImageBuffer ( const Buffer< uint01 > & pixels,
const Vector< 2, uint04 > & size,
const Matrix< fltp08 > & camera_matrix )
inlineoverridevirtual

Adds an image buffer to the stitching queue.

Parameters
[in]pixelsThe raw pixel data in RGBA format.
[in]sizeThe pixel dimensions of the image.
[in]camera_matrixThe camera transform matrix for this image.

Implements MaterialRasterBase.

Definition at line 107 of file OpenCVImageRaster.h.

References imgs.

◆ imageID()

const String & OpenCVImageRaster::imageID ( ) const
inlineoverridevirtual

Gets the unique image identifier for this raster.

Returns
A reference to the image ID string.

Implements MaterialRasterBase.

Definition at line 63 of file OpenCVImageRaster.h.

References m_image_id.

◆ setUnsetColor()

void OpenCVImageRaster::setUnsetColor ( RGBColor color)
inline

Sets the color used for unset pixels.

Parameters
[in]colorThe fill color for unset regions.

Definition at line 75 of file OpenCVImageRaster.h.

Referenced by OpenCVImageRaster().


The documentation for this class was generated from the following file: