OpenCV for Unity 3.0.5
Enox Software / Please refer to OpenCV official document ( http://docs.opencv.org/5.0/index.html ) for the details of the argument of the method.
Loading...
Searching...
No Matches
OpenCVForUnity.PtcloudModule.Ptcloud Class Reference

Static Public Member Functions

static double approxEnclosingSphere3D (Mat inputCloud, Mat center)
 Computes an approximate minimum enclosing sphere of a point cloud (Ritter's algorithm).
 
static void boundingBox3D (Mat inputCloud, Mat minBound, Mat maxBound)
 Computes the axis-aligned bounding box (AABB) of a point cloud.
 
static void createMeshBPA (Mat inputCloud, Mat normals, Mat vertices, Mat triangles)
 Reconstructs a triangle mesh from an oriented point cloud using Ball-Pivoting.
 
static void createMeshBPA (Mat inputCloud, Mat normals, Mat vertices, Mat triangles, Mat radii)
 Reconstructs a triangle mesh from an oriented point cloud using Ball-Pivoting.
 
static void decodeGaussianSplats (Mat attributes, Mat splats)
 Decodes 3D Gaussian Splatting attributes into a renderable scene.
 
static void decodeGaussianSplatsPacked (Mat buf, Mat splats)
 Decodes the contents of a .splat file into a renderable scene.
 
static void depthTo3d (Mat depth, Mat K, Mat points3d)
 
static void depthTo3d (Mat depth, Mat K, Mat points3d, Mat mask)
 
static void depthTo3dSparse (Mat depth, Mat in_K, Mat in_points, Mat points3d)
 
static void destroyObject (string win_name, string obj_name)
 Destroys an object created with cv::viz3d::showMesh or cv::viz3d::showPoints.
 
static float estimateMedianSpacing (Mat inputCloud)
 Estimates the median spacing between neighboring points of a point cloud.
 
static void findPlanes (Mat points3d, Mat normals, Mat mask, Mat plane_coefficients)
 
static void findPlanes (Mat points3d, Mat normals, Mat mask, Mat plane_coefficients, int block_size)
 
static void findPlanes (Mat points3d, Mat normals, Mat mask, Mat plane_coefficients, int block_size, int min_size)
 
static void findPlanes (Mat points3d, Mat normals, Mat mask, Mat plane_coefficients, int block_size, int min_size, double threshold)
 
static void findPlanes (Mat points3d, Mat normals, Mat mask, Mat plane_coefficients, int block_size, int min_size, double threshold, double sensor_error_a)
 
static void findPlanes (Mat points3d, Mat normals, Mat mask, Mat plane_coefficients, int block_size, int min_size, double threshold, double sensor_error_a, double sensor_error_b)
 
static void findPlanes (Mat points3d, Mat normals, Mat mask, Mat plane_coefficients, int block_size, int min_size, double threshold, double sensor_error_a, double sensor_error_b, double sensor_error_c)
 
static void findPlanes (Mat points3d, Mat normals, Mat mask, Mat plane_coefficients, int block_size, int min_size, double threshold, double sensor_error_a, double sensor_error_b, double sensor_error_c, int method)
 
static List< string > getGaussianSplatPlyPropNames ()
 Returns the PLY vertex property names cv::loadGaussianSplats reads by default.
 
static void loadGaussianSplats (string filename, Mat splats)
 Loads a 3D Gaussian Splatting scene from a PLY or .splat file.
 
static void loadGaussianSplats (string filename, Mat splats, List< string > ply_properties)
 Loads a 3D Gaussian Splatting scene from a PLY or .splat file.
 
static void loadMesh (string filename, Mat vertices, List< Mat > indices)
 Loads a mesh from a file.
 
static void loadMesh (string filename, Mat vertices, List< Mat > indices, Mat normals)
 Loads a mesh from a file.
 
static void loadMesh (string filename, Mat vertices, List< Mat > indices, Mat normals, Mat colors)
 Loads a mesh from a file.
 
static void loadMesh (string filename, Mat vertices, List< Mat > indices, Mat normals, Mat colors, Mat texCoords)
 Loads a mesh from a file.
 
static void loadPointCloud (string filename, Mat vertices)
 Loads a point cloud from a file.
 
static void loadPointCloud (string filename, Mat vertices, Mat normals)
 Loads a point cloud from a file.
 
static void loadPointCloud (string filename, Mat vertices, Mat normals, Mat rgb)
 Loads a point cloud from a file.
 
static void orientedBoundingBox3D (Mat inputCloud, Mat center, Mat axes, Mat halfExtents)
 Computes a PCA-based oriented bounding box (OBB) of a point cloud.
 
static void orientNormals (Mat inputCloud, Mat normals, in Vec3d viewpoint)
 Flips point-cloud normals so that they face a given viewpoint.
 
static void orientNormals (Mat inputCloud, Mat normals, in(double x, double y, double z) viewpoint)
 Flips point-cloud normals so that they face a given viewpoint.
 
static void orientNormals (Mat inputCloud, Mat normals, Point3 viewpoint)
 Flips point-cloud normals so that they face a given viewpoint.
 
static void orientNormalsConsistent (Mat inputCloud, Mat normals)
 Orients point-cloud normals consistently across the whole cloud.
 
static void orientNormalsConsistent (Mat inputCloud, Mat normals, int k)
 Orients point-cloud normals consistently across the whole cloud.
 
static void registerDepth (Mat unregisteredCameraMatrix, Mat registeredCameraMatrix, Mat registeredDistCoeffs, Mat Rt, Mat unregisteredDepth, in Vec2d outputImagePlaneSize, Mat registeredDepth)
 
static void registerDepth (Mat unregisteredCameraMatrix, Mat registeredCameraMatrix, Mat registeredDistCoeffs, Mat Rt, Mat unregisteredDepth, in Vec2d outputImagePlaneSize, Mat registeredDepth, bool depthDilation)
 
static void registerDepth (Mat unregisteredCameraMatrix, Mat registeredCameraMatrix, Mat registeredDistCoeffs, Mat Rt, Mat unregisteredDepth, in(double width, double height) outputImagePlaneSize, Mat registeredDepth)
 
static void registerDepth (Mat unregisteredCameraMatrix, Mat registeredCameraMatrix, Mat registeredDistCoeffs, Mat Rt, Mat unregisteredDepth, in(double width, double height) outputImagePlaneSize, Mat registeredDepth, bool depthDilation)
 
static void registerDepth (Mat unregisteredCameraMatrix, Mat registeredCameraMatrix, Mat registeredDistCoeffs, Mat Rt, Mat unregisteredDepth, Size outputImagePlaneSize, Mat registeredDepth)
 
static void registerDepth (Mat unregisteredCameraMatrix, Mat registeredCameraMatrix, Mat registeredDistCoeffs, Mat Rt, Mat unregisteredDepth, Size outputImagePlaneSize, Mat registeredDepth, bool depthDilation)
 
static void removeRadiusOutliers (Mat inputCloud, Mat outputCloud, double radius)
 Removes radius outliers from a point cloud.
 
static void removeRadiusOutliers (Mat inputCloud, Mat outputCloud, double radius, int minNeighbors)
 Removes radius outliers from a point cloud.
 
static void removeRadiusOutliers (Mat inputCloud, Mat outputCloud, double radius, int minNeighbors, Mat keptIndices)
 Removes radius outliers from a point cloud.
 
static void removeStatisticalOutliers (Mat inputCloud, Mat outputCloud)
 Removes statistical outliers from a point cloud.
 
static void removeStatisticalOutliers (Mat inputCloud, Mat outputCloud, int meanK)
 Removes statistical outliers from a point cloud.
 
static void removeStatisticalOutliers (Mat inputCloud, Mat outputCloud, int meanK, double stddevMulThresh)
 Removes statistical outliers from a point cloud.
 
static void removeStatisticalOutliers (Mat inputCloud, Mat outputCloud, int meanK, double stddevMulThresh, Mat keptIndices)
 Removes statistical outliers from a point cloud.
 
static void rescaleDepth (Mat _in, int type, Mat _out)
 
static void rescaleDepth (Mat _in, int type, Mat _out, double depth_factor)
 
static void saveMesh (string filename, Mat vertices, List< Mat > indices)
 Saves a mesh to a specified file.
 
static void saveMesh (string filename, Mat vertices, List< Mat > indices, Mat normals)
 Saves a mesh to a specified file.
 
static void saveMesh (string filename, Mat vertices, List< Mat > indices, Mat normals, Mat colors)
 Saves a mesh to a specified file.
 
static void saveMesh (string filename, Mat vertices, List< Mat > indices, Mat normals, Mat colors, Mat texCoords)
 Saves a mesh to a specified file.
 
static void savePointCloud (string filename, Mat vertices)
 Saves a point cloud to a specified file.
 
static void savePointCloud (string filename, Mat vertices, Mat normals)
 Saves a point cloud to a specified file.
 
static void savePointCloud (string filename, Mat vertices, Mat normals, Mat rgb)
 Saves a point cloud to a specified file.
 
static void setGridVisible (string win_name, bool visible)
 Hides or shows the grid on a viz3d window.
 
static void setPerspective (string win_name, float fov, float z_near, float z_far)
 Sets the view's perspective on a viz3d window.
 
static void showGaussianSplats (string win_name, string obj_name, Mat splats)
 Shows a 3D Gaussian Splatting scene in the specified viz3d window. See cv::viz3d::destroyObject.
 
static void showLines (string win_name, string obj_name, Mat points)
 Shows a lines object in the specified viz3d window. See cv::viz3d::destroyObject.
 
static void showMesh2 (string win_name, string obj_name, Mat verts)
 
static void showPoints (string win_name, string obj_name, Mat points)
 Shows a point cloud object in the specified viz3d window. See cv::viz3d::destroyObject.
 
static void triangleRasterize (Mat vertices, Mat indices, Mat colors, Mat colorBuf, Mat depthBuf, Mat world2cam, double fovY, double zNear, double zFar)
 Renders a set of triangles on a depth and color image.
 
static void triangleRasterize (Mat vertices, Mat indices, Mat colors, Mat colorBuf, Mat depthBuf, Mat world2cam, double fovY, double zNear, double zFar, TriangleRasterizeSettings settings)
 Renders a set of triangles on a depth and color image.
 
static void triangleRasterizeColor (Mat vertices, Mat indices, Mat colors, Mat colorBuf, Mat world2cam, double fovY, double zNear, double zFar)
 Overloaded version of triangleRasterize() with color-only rendering.
 
static void triangleRasterizeColor (Mat vertices, Mat indices, Mat colors, Mat colorBuf, Mat world2cam, double fovY, double zNear, double zFar, TriangleRasterizeSettings settings)
 Overloaded version of triangleRasterize() with color-only rendering.
 
static void triangleRasterizeDepth (Mat vertices, Mat indices, Mat depthBuf, Mat world2cam, double fovY, double zNear, double zFar)
 Overloaded version of triangleRasterize() with depth-only rendering.
 
static void triangleRasterizeDepth (Mat vertices, Mat indices, Mat depthBuf, Mat world2cam, double fovY, double zNear, double zFar, TriangleRasterizeSettings settings)
 Overloaded version of triangleRasterize() with depth-only rendering.
 
static void warpFrame (Mat depth, Mat image, Mat mask, Mat Rt, Mat cameraMatrix)
 
static void warpFrame (Mat depth, Mat image, Mat mask, Mat Rt, Mat cameraMatrix, Mat warpedDepth)
 
static void warpFrame (Mat depth, Mat image, Mat mask, Mat Rt, Mat cameraMatrix, Mat warpedDepth, Mat warpedImage)
 
static void warpFrame (Mat depth, Mat image, Mat mask, Mat Rt, Mat cameraMatrix, Mat warpedDepth, Mat warpedImage, Mat warpedMask)
 

Static Public Attributes

const int GAUSSIAN_SPLAT_ALPHA = 12
 C++: enum GaussianSplatLayout (cv.GaussianSplatLayout)
 
const int GAUSSIAN_SPLAT_COV = 3
 C++: enum GaussianSplatLayout (cv.GaussianSplatLayout)
 
const int GAUSSIAN_SPLAT_POS = 0
 C++: enum GaussianSplatLayout (cv.GaussianSplatLayout)
 
const int GAUSSIAN_SPLAT_RGB = 9
 C++: enum GaussianSplatLayout (cv.GaussianSplatLayout)
 
const int GAUSSIAN_SPLAT_STRIDE = 13
 C++: enum GaussianSplatLayout (cv.GaussianSplatLayout)
 
const int INITIALIZING = 1
 C++: enum OdometryState (cv.slam.OdometryState)
 
const int N_PYRAMIDS = 8 + 1
 C++: enum OdometryFramePyramidType (cv.OdometryFramePyramidType)
 
const int NOT_INITIALIZED = 0
 C++: enum OdometryState (cv.slam.OdometryState)
 
const int OdometryAlgoType_COMMON = 0
 C++: enum OdometryAlgoType (cv.OdometryAlgoType)
 
const int OdometryAlgoType_FAST = 1
 C++: enum OdometryAlgoType (cv.OdometryAlgoType)
 
const int OdometryType_DEPTH = 0
 C++: enum OdometryType (cv.OdometryType)
 
const int OdometryType_RGB = 1
 C++: enum OdometryType (cv.OdometryType)
 
const int OdometryType_RGB_DEPTH = 2
 C++: enum OdometryType (cv.OdometryType)
 
const int PYR_CLOUD = 3
 C++: enum OdometryFramePyramidType (cv.OdometryFramePyramidType)
 
const int PYR_DEPTH = 1
 C++: enum OdometryFramePyramidType (cv.OdometryFramePyramidType)
 
const int PYR_DIX = 4
 C++: enum OdometryFramePyramidType (cv.OdometryFramePyramidType)
 
const int PYR_DIY = 5
 C++: enum OdometryFramePyramidType (cv.OdometryFramePyramidType)
 
const int PYR_IMAGE = 0
 C++: enum OdometryFramePyramidType (cv.OdometryFramePyramidType)
 
const int PYR_MASK = 2
 C++: enum OdometryFramePyramidType (cv.OdometryFramePyramidType)
 
const int PYR_NORM = 7
 C++: enum OdometryFramePyramidType (cv.OdometryFramePyramidType)
 
const int PYR_NORMMASK = 8
 C++: enum OdometryFramePyramidType (cv.OdometryFramePyramidType)
 
const int PYR_TEXMASK = 6
 C++: enum OdometryFramePyramidType (cv.OdometryFramePyramidType)
 
const int RASTERIZE_COMPAT_DISABLED = 0
 C++: enum TriangleGlCompatibleMode (cv.TriangleGlCompatibleMode)
 
const int RASTERIZE_COMPAT_INVDEPTH = 1
 C++: enum TriangleGlCompatibleMode (cv.TriangleGlCompatibleMode)
 
const int RASTERIZE_CULLING_CCW = 2
 C++: enum TriangleCullingMode (cv.TriangleCullingMode)
 
const int RASTERIZE_CULLING_CW = 1
 C++: enum TriangleCullingMode (cv.TriangleCullingMode)
 
const int RASTERIZE_CULLING_NONE = 0
 C++: enum TriangleCullingMode (cv.TriangleCullingMode)
 
const int RASTERIZE_SHADING_FLAT = 1
 C++: enum TriangleShadingType (cv.TriangleShadingType)
 
const int RASTERIZE_SHADING_SHADED = 2
 C++: enum TriangleShadingType (cv.TriangleShadingType)
 
const int RASTERIZE_SHADING_WHITE = 0
 C++: enum TriangleShadingType (cv.TriangleShadingType)
 
const int RENDER_SHADING = 1
 C++: enum RenderMode (cv.viz3d.RenderMode)
 
const int RENDER_SIMPLE = 0
 C++: enum RenderMode (cv.viz3d.RenderMode)
 
const int RENDER_WIREFRAME = 2
 C++: enum RenderMode (cv.viz3d.RenderMode)
 
const int RGBD_PLANE_METHOD_DEFAULT = 0
 C++: enum RgbdPlaneMethod (cv.RgbdPlaneMethod)
 
const int TRACKING = 2
 C++: enum OdometryState (cv.slam.OdometryState)
 
const int VolumeType_ColorHashTSDF = 3
 C++: enum VolumeType (cv.VolumeType)
 
const int VolumeType_ColorTSDF = 2
 C++: enum VolumeType (cv.VolumeType)
 
const int VolumeType_HashTSDF = 1
 C++: enum VolumeType (cv.VolumeType)
 
const int VolumeType_TSDF = 0
 C++: enum VolumeType (cv.VolumeType)
 

Member Function Documentation

◆ approxEnclosingSphere3D()

static double OpenCVForUnity.PtcloudModule.Ptcloud.approxEnclosingSphere3D ( Mat inputCloud,
Mat center )
static

Computes an approximate minimum enclosing sphere of a point cloud (Ritter's algorithm).

Parameters
inputCloudInput point cloud, 3-channel float array (CV_32FC3), or an Nx3 / 3xN CV_32F matrix.
centerOutput sphere center (x,y,z), 3x1 CV_32F.
Returns
Sphere radius, or 0 if the cloud is empty.

◆ boundingBox3D()

static void OpenCVForUnity.PtcloudModule.Ptcloud.boundingBox3D ( Mat inputCloud,
Mat minBound,
Mat maxBound )
static

Computes the axis-aligned bounding box (AABB) of a point cloud.

Parameters
inputCloudInput point cloud, 3-channel float array (CV_32FC3), or an Nx3 / 3xN CV_32F matrix.
minBoundOutput minimum corner (x,y,z), 3x1 CV_32F.
maxBoundOutput maximum corner (x,y,z), 3x1 CV_32F.

◆ createMeshBPA() [1/2]

static void OpenCVForUnity.PtcloudModule.Ptcloud.createMeshBPA ( Mat inputCloud,
Mat normals,
Mat vertices,
Mat triangles )
static

Reconstructs a triangle mesh from an oriented point cloud using Ball-Pivoting.

Implements the Ball-Pivoting Algorithm [Bernardini1999] : a ball of a given radius is rolled over the points; whenever it rests on three points without containing any other, those points form a triangle. Several radii are used in ascending order so larger balls bridge the gaps left by smaller ones. The algorithm is interpolating — the mesh vertices are the input points — so estimate and orient the normals first (cv::normalEstimate, cv::orientNormalsConsistent).

Parameters
inputCloudInput point cloud, 3-channel float array (CV_32FC3), or an Nx3 / 3xN CV_32F matrix.
normalsPer-point normals, Nx1 CV_32FC3 (same count as the cloud).
verticesOutput mesh vertices (a copy of the input points), Nx1 CV_32FC3.
trianglesOutput triangle vertex indices, Mx3 CV_32S.
radiiOptional ball radii (1D CV_32F/CV_64F). If empty, radii are derived from cv::estimateMedianSpacing as {1x, 2x, 4x} the median spacing.

◆ createMeshBPA() [2/2]

static void OpenCVForUnity.PtcloudModule.Ptcloud.createMeshBPA ( Mat inputCloud,
Mat normals,
Mat vertices,
Mat triangles,
Mat radii )
static

Reconstructs a triangle mesh from an oriented point cloud using Ball-Pivoting.

Implements the Ball-Pivoting Algorithm [Bernardini1999] : a ball of a given radius is rolled over the points; whenever it rests on three points without containing any other, those points form a triangle. Several radii are used in ascending order so larger balls bridge the gaps left by smaller ones. The algorithm is interpolating — the mesh vertices are the input points — so estimate and orient the normals first (cv::normalEstimate, cv::orientNormalsConsistent).

Parameters
inputCloudInput point cloud, 3-channel float array (CV_32FC3), or an Nx3 / 3xN CV_32F matrix.
normalsPer-point normals, Nx1 CV_32FC3 (same count as the cloud).
verticesOutput mesh vertices (a copy of the input points), Nx1 CV_32FC3.
trianglesOutput triangle vertex indices, Mx3 CV_32S.
radiiOptional ball radii (1D CV_32F/CV_64F). If empty, radii are derived from cv::estimateMedianSpacing as {1x, 2x, 4x} the median spacing.

◆ decodeGaussianSplats()

static void OpenCVForUnity.PtcloudModule.Ptcloud.decodeGaussianSplats ( Mat attributes,
Mat splats )
static

Decodes 3D Gaussian Splatting attributes into a renderable scene.

Scales are exponentiated, opacity is put through a sigmoid, the quaternion and scales are combined into a 3D covariance, and the zeroth order harmonic is evaluated to an RGB color.

Use this when the attributes do not come from a file cv::loadGaussianSplats can open, for instance when they are held in memory, arrive from a training run, or are read from a resource on a platform without filesystem access.

Parameters
attributesCV_32F matrix with one row per Gaussian and one column per name of cv::getGaussianSplatPlyPropNames, in that order.
splatsDecoded scene, see #GaussianSplatLayout.

◆ decodeGaussianSplatsPacked()

static void OpenCVForUnity.PtcloudModule.Ptcloud.decodeGaussianSplatsPacked ( Mat buf,
Mat splats )
static

Decodes the contents of a .splat file into a renderable scene.

A .splat file is a headerless array of 32 byte records, one per Gaussian, holding position, scale, color and rotation. The values are already activated, so only the covariance is built. Being headerless makes this the in memory counterpart of cv::loadGaussianSplats for platforms without filesystem access, or for scenes shipped as application resources.

Parameters
bufCV_8U buffer holding the bytes of a .splat file.
splatsDecoded scene, see #GaussianSplatLayout.

◆ depthTo3d() [1/2]

static void OpenCVForUnity.PtcloudModule.Ptcloud.depthTo3d ( Mat depth,
Mat K,
Mat points3d )
static

Converts a depth image to 3d points. If the mask is empty then the resulting array has the same dimensions as depth, otherwise it is 1d vector containing mask-enabled values only. The coordinate system is x pointing left, y down and z away from the camera

Parameters
depththe depth image (if given as short int CV_U, it is assumed to be the depth in millimeters (as done with the Microsoft Kinect), otherwise, if given as CV_32F or CV_64F, it is assumed in meters)
KThe calibration matrix
points3dthe resulting 3d points (point is represented by 4 channels value [x, y, z, 0]). They are of the same depth as depth if it is CV_32F or CV_64F, and the depth of K if depth is of depth CV_16U or CV_16S
maskthe mask of the points to consider (can be empty)

◆ depthTo3d() [2/2]

static void OpenCVForUnity.PtcloudModule.Ptcloud.depthTo3d ( Mat depth,
Mat K,
Mat points3d,
Mat mask )
static

Converts a depth image to 3d points. If the mask is empty then the resulting array has the same dimensions as depth, otherwise it is 1d vector containing mask-enabled values only. The coordinate system is x pointing left, y down and z away from the camera

Parameters
depththe depth image (if given as short int CV_U, it is assumed to be the depth in millimeters (as done with the Microsoft Kinect), otherwise, if given as CV_32F or CV_64F, it is assumed in meters)
KThe calibration matrix
points3dthe resulting 3d points (point is represented by 4 channels value [x, y, z, 0]). They are of the same depth as depth if it is CV_32F or CV_64F, and the depth of K if depth is of depth CV_16U or CV_16S
maskthe mask of the points to consider (can be empty)

◆ depthTo3dSparse()

static void OpenCVForUnity.PtcloudModule.Ptcloud.depthTo3dSparse ( Mat depth,
Mat in_K,
Mat in_points,
Mat points3d )
static
Parameters
depththe depth image
in_K
Parameters
in_pointsthe list of xy coordinates
points3dthe resulting 3d points (point is represented by 4 chanels value [x, y, z, 0])

◆ destroyObject()

static void OpenCVForUnity.PtcloudModule.Ptcloud.destroyObject ( string win_name,
string obj_name )
static

Destroys an object created with cv::viz3d::showMesh or cv::viz3d::showPoints.

Parameters
win_nameName of the viz3d window.
obj_nameName of the object.

◆ estimateMedianSpacing()

static float OpenCVForUnity.PtcloudModule.Ptcloud.estimateMedianSpacing ( Mat inputCloud)
static

Estimates the median spacing between neighboring points of a point cloud.

Returns the median distance from a sampled set of points to their nearest neighbor. Useful for picking a ball radius for cv::createMeshBPA.

Parameters
inputCloudInput point cloud, 3-channel float array (CV_32FC3), or an Nx3 / 3xN CV_32F matrix.
Returns
Median nearest-neighbor distance, or 0 if the cloud has fewer than 2 points.

◆ findPlanes() [1/8]

static void OpenCVForUnity.PtcloudModule.Ptcloud.findPlanes ( Mat points3d,
Mat normals,
Mat mask,
Mat plane_coefficients )
static

Find the planes in a depth image

Parameters
points3dthe 3d points organized like the depth image: rows x cols with 3 channels
normalsthe normals for every point in the depth image; optional, can be empty
maskAn image where each pixel is labeled with the plane it belongs to and 255 if it does not belong to any plane
plane_coefficientsthe coefficients of the corresponding planes (a,b,c,d) such that ax+by+cz+d=0, norm(a,b,c)=1 and c < 0 (so that the normal points towards the camera)
block_sizeThe size of the blocks to look at for a stable MSE
min_sizeThe minimum size of a cluster to be considered a plane
thresholdThe maximum distance of a point from a plane to belong to it (in meters)
sensor_error_acoefficient of the sensor error. 0 by default, use 0.0075 for a Kinect
sensor_error_bcoefficient of the sensor error. 0 by default
sensor_error_ccoefficient of the sensor error. 0 by default
methodThe method to use to compute the planes.

◆ findPlanes() [2/8]

static void OpenCVForUnity.PtcloudModule.Ptcloud.findPlanes ( Mat points3d,
Mat normals,
Mat mask,
Mat plane_coefficients,
int block_size )
static

Find the planes in a depth image

Parameters
points3dthe 3d points organized like the depth image: rows x cols with 3 channels
normalsthe normals for every point in the depth image; optional, can be empty
maskAn image where each pixel is labeled with the plane it belongs to and 255 if it does not belong to any plane
plane_coefficientsthe coefficients of the corresponding planes (a,b,c,d) such that ax+by+cz+d=0, norm(a,b,c)=1 and c < 0 (so that the normal points towards the camera)
block_sizeThe size of the blocks to look at for a stable MSE
min_sizeThe minimum size of a cluster to be considered a plane
thresholdThe maximum distance of a point from a plane to belong to it (in meters)
sensor_error_acoefficient of the sensor error. 0 by default, use 0.0075 for a Kinect
sensor_error_bcoefficient of the sensor error. 0 by default
sensor_error_ccoefficient of the sensor error. 0 by default
methodThe method to use to compute the planes.

◆ findPlanes() [3/8]

static void OpenCVForUnity.PtcloudModule.Ptcloud.findPlanes ( Mat points3d,
Mat normals,
Mat mask,
Mat plane_coefficients,
int block_size,
int min_size )
static

Find the planes in a depth image

Parameters
points3dthe 3d points organized like the depth image: rows x cols with 3 channels
normalsthe normals for every point in the depth image; optional, can be empty
maskAn image where each pixel is labeled with the plane it belongs to and 255 if it does not belong to any plane
plane_coefficientsthe coefficients of the corresponding planes (a,b,c,d) such that ax+by+cz+d=0, norm(a,b,c)=1 and c < 0 (so that the normal points towards the camera)
block_sizeThe size of the blocks to look at for a stable MSE
min_sizeThe minimum size of a cluster to be considered a plane
thresholdThe maximum distance of a point from a plane to belong to it (in meters)
sensor_error_acoefficient of the sensor error. 0 by default, use 0.0075 for a Kinect
sensor_error_bcoefficient of the sensor error. 0 by default
sensor_error_ccoefficient of the sensor error. 0 by default
methodThe method to use to compute the planes.

◆ findPlanes() [4/8]

static void OpenCVForUnity.PtcloudModule.Ptcloud.findPlanes ( Mat points3d,
Mat normals,
Mat mask,
Mat plane_coefficients,
int block_size,
int min_size,
double threshold )
static

Find the planes in a depth image

Parameters
points3dthe 3d points organized like the depth image: rows x cols with 3 channels
normalsthe normals for every point in the depth image; optional, can be empty
maskAn image where each pixel is labeled with the plane it belongs to and 255 if it does not belong to any plane
plane_coefficientsthe coefficients of the corresponding planes (a,b,c,d) such that ax+by+cz+d=0, norm(a,b,c)=1 and c < 0 (so that the normal points towards the camera)
block_sizeThe size of the blocks to look at for a stable MSE
min_sizeThe minimum size of a cluster to be considered a plane
thresholdThe maximum distance of a point from a plane to belong to it (in meters)
sensor_error_acoefficient of the sensor error. 0 by default, use 0.0075 for a Kinect
sensor_error_bcoefficient of the sensor error. 0 by default
sensor_error_ccoefficient of the sensor error. 0 by default
methodThe method to use to compute the planes.

◆ findPlanes() [5/8]

static void OpenCVForUnity.PtcloudModule.Ptcloud.findPlanes ( Mat points3d,
Mat normals,
Mat mask,
Mat plane_coefficients,
int block_size,
int min_size,
double threshold,
double sensor_error_a )
static

Find the planes in a depth image

Parameters
points3dthe 3d points organized like the depth image: rows x cols with 3 channels
normalsthe normals for every point in the depth image; optional, can be empty
maskAn image where each pixel is labeled with the plane it belongs to and 255 if it does not belong to any plane
plane_coefficientsthe coefficients of the corresponding planes (a,b,c,d) such that ax+by+cz+d=0, norm(a,b,c)=1 and c < 0 (so that the normal points towards the camera)
block_sizeThe size of the blocks to look at for a stable MSE
min_sizeThe minimum size of a cluster to be considered a plane
thresholdThe maximum distance of a point from a plane to belong to it (in meters)
sensor_error_acoefficient of the sensor error. 0 by default, use 0.0075 for a Kinect
sensor_error_bcoefficient of the sensor error. 0 by default
sensor_error_ccoefficient of the sensor error. 0 by default
methodThe method to use to compute the planes.

◆ findPlanes() [6/8]

static void OpenCVForUnity.PtcloudModule.Ptcloud.findPlanes ( Mat points3d,
Mat normals,
Mat mask,
Mat plane_coefficients,
int block_size,
int min_size,
double threshold,
double sensor_error_a,
double sensor_error_b )
static

Find the planes in a depth image

Parameters
points3dthe 3d points organized like the depth image: rows x cols with 3 channels
normalsthe normals for every point in the depth image; optional, can be empty
maskAn image where each pixel is labeled with the plane it belongs to and 255 if it does not belong to any plane
plane_coefficientsthe coefficients of the corresponding planes (a,b,c,d) such that ax+by+cz+d=0, norm(a,b,c)=1 and c < 0 (so that the normal points towards the camera)
block_sizeThe size of the blocks to look at for a stable MSE
min_sizeThe minimum size of a cluster to be considered a plane
thresholdThe maximum distance of a point from a plane to belong to it (in meters)
sensor_error_acoefficient of the sensor error. 0 by default, use 0.0075 for a Kinect
sensor_error_bcoefficient of the sensor error. 0 by default
sensor_error_ccoefficient of the sensor error. 0 by default
methodThe method to use to compute the planes.

◆ findPlanes() [7/8]

static void OpenCVForUnity.PtcloudModule.Ptcloud.findPlanes ( Mat points3d,
Mat normals,
Mat mask,
Mat plane_coefficients,
int block_size,
int min_size,
double threshold,
double sensor_error_a,
double sensor_error_b,
double sensor_error_c )
static

Find the planes in a depth image

Parameters
points3dthe 3d points organized like the depth image: rows x cols with 3 channels
normalsthe normals for every point in the depth image; optional, can be empty
maskAn image where each pixel is labeled with the plane it belongs to and 255 if it does not belong to any plane
plane_coefficientsthe coefficients of the corresponding planes (a,b,c,d) such that ax+by+cz+d=0, norm(a,b,c)=1 and c < 0 (so that the normal points towards the camera)
block_sizeThe size of the blocks to look at for a stable MSE
min_sizeThe minimum size of a cluster to be considered a plane
thresholdThe maximum distance of a point from a plane to belong to it (in meters)
sensor_error_acoefficient of the sensor error. 0 by default, use 0.0075 for a Kinect
sensor_error_bcoefficient of the sensor error. 0 by default
sensor_error_ccoefficient of the sensor error. 0 by default
methodThe method to use to compute the planes.

◆ findPlanes() [8/8]

static void OpenCVForUnity.PtcloudModule.Ptcloud.findPlanes ( Mat points3d,
Mat normals,
Mat mask,
Mat plane_coefficients,
int block_size,
int min_size,
double threshold,
double sensor_error_a,
double sensor_error_b,
double sensor_error_c,
int method )
static

Find the planes in a depth image

Parameters
points3dthe 3d points organized like the depth image: rows x cols with 3 channels
normalsthe normals for every point in the depth image; optional, can be empty
maskAn image where each pixel is labeled with the plane it belongs to and 255 if it does not belong to any plane
plane_coefficientsthe coefficients of the corresponding planes (a,b,c,d) such that ax+by+cz+d=0, norm(a,b,c)=1 and c < 0 (so that the normal points towards the camera)
block_sizeThe size of the blocks to look at for a stable MSE
min_sizeThe minimum size of a cluster to be considered a plane
thresholdThe maximum distance of a point from a plane to belong to it (in meters)
sensor_error_acoefficient of the sensor error. 0 by default, use 0.0075 for a Kinect
sensor_error_bcoefficient of the sensor error. 0 by default
sensor_error_ccoefficient of the sensor error. 0 by default
methodThe method to use to compute the planes.

◆ getGaussianSplatPlyPropNames()

static List< string > OpenCVForUnity.PtcloudModule.Ptcloud.getGaussianSplatPlyPropNames ( )
static

Returns the PLY vertex property names cv::loadGaussianSplats reads by default.

The order of the names is the column order cv::decodeGaussianSplats expects. Pass a renamed copy of this list to cv::loadGaussianSplats to read a scene whose exporter spells the properties differently, keeping the same order.

◆ loadGaussianSplats() [1/2]

static void OpenCVForUnity.PtcloudModule.Ptcloud.loadGaussianSplats ( string filename,
Mat splats )
static

Loads a 3D Gaussian Splatting scene from a PLY or .splat file.

Requires a trained scene, i.e. a PLY whose vertices carry f_dc_0..2, opacity, scale_0..2 and rot_0..3 alongside x, y, z, or a .splat file of 32 byte records. Higher order f_rest_* harmonics are ignored.

The attributes are decoded on load, see cv::decodeGaussianSplats and cv::decodeGaussianSplatsPacked.

Parameters
filenameName of the file, the format is chosen from its extension.
splatsDecoded scene in the layout cv::viz3d::showGaussianSplats expects, see #GaussianSplatLayout, or empty on failure.
ply_propertiesVertex property names to read from a PLY file, in the column order of cv::getGaussianSplatPlyPropNames. Empty selects that default list. Unused for .splat files.

◆ loadGaussianSplats() [2/2]

static void OpenCVForUnity.PtcloudModule.Ptcloud.loadGaussianSplats ( string filename,
Mat splats,
List< string > ply_properties )
static

Loads a 3D Gaussian Splatting scene from a PLY or .splat file.

Requires a trained scene, i.e. a PLY whose vertices carry f_dc_0..2, opacity, scale_0..2 and rot_0..3 alongside x, y, z, or a .splat file of 32 byte records. Higher order f_rest_* harmonics are ignored.

The attributes are decoded on load, see cv::decodeGaussianSplats and cv::decodeGaussianSplatsPacked.

Parameters
filenameName of the file, the format is chosen from its extension.
splatsDecoded scene in the layout cv::viz3d::showGaussianSplats expects, see #GaussianSplatLayout, or empty on failure.
ply_propertiesVertex property names to read from a PLY file, in the column order of cv::getGaussianSplatPlyPropNames. Empty selects that default list. Unused for .splat files.

◆ loadMesh() [1/4]

static void OpenCVForUnity.PtcloudModule.Ptcloud.loadMesh ( string filename,
Mat vertices,
List< Mat > indices )
static

Loads a mesh from a file.

The function loads mesh from the specified file and returns it. If the mesh cannot be read, throws an error Vertex attributes (i.e. space and texture coodinates, normals and colors) are returned in same-sized arrays with corresponding elements having the same indices. This means that if a face uses a vertex with a normal or a texture coordinate with different indices (which is typical for OBJ files for example), this vertex will be duplicated for each face it uses.

Currently, the following file formats are supported:

Parameters
filenameName of the file
verticesvertex coordinates, each value contains 3 floats
indicesper-face list of vertices, each value is a vector of ints
normalsper-vertex normals, each value contains 3 floats
colorsper-vertex colors, each value contains 3 floats
texCoordsper-vertex texture coordinates, each value contains 2 or 3 floats

◆ loadMesh() [2/4]

static void OpenCVForUnity.PtcloudModule.Ptcloud.loadMesh ( string filename,
Mat vertices,
List< Mat > indices,
Mat normals )
static

Loads a mesh from a file.

The function loads mesh from the specified file and returns it. If the mesh cannot be read, throws an error Vertex attributes (i.e. space and texture coodinates, normals and colors) are returned in same-sized arrays with corresponding elements having the same indices. This means that if a face uses a vertex with a normal or a texture coordinate with different indices (which is typical for OBJ files for example), this vertex will be duplicated for each face it uses.

Currently, the following file formats are supported:

Parameters
filenameName of the file
verticesvertex coordinates, each value contains 3 floats
indicesper-face list of vertices, each value is a vector of ints
normalsper-vertex normals, each value contains 3 floats
colorsper-vertex colors, each value contains 3 floats
texCoordsper-vertex texture coordinates, each value contains 2 or 3 floats

◆ loadMesh() [3/4]

static void OpenCVForUnity.PtcloudModule.Ptcloud.loadMesh ( string filename,
Mat vertices,
List< Mat > indices,
Mat normals,
Mat colors )
static

Loads a mesh from a file.

The function loads mesh from the specified file and returns it. If the mesh cannot be read, throws an error Vertex attributes (i.e. space and texture coodinates, normals and colors) are returned in same-sized arrays with corresponding elements having the same indices. This means that if a face uses a vertex with a normal or a texture coordinate with different indices (which is typical for OBJ files for example), this vertex will be duplicated for each face it uses.

Currently, the following file formats are supported:

Parameters
filenameName of the file
verticesvertex coordinates, each value contains 3 floats
indicesper-face list of vertices, each value is a vector of ints
normalsper-vertex normals, each value contains 3 floats
colorsper-vertex colors, each value contains 3 floats
texCoordsper-vertex texture coordinates, each value contains 2 or 3 floats

◆ loadMesh() [4/4]

static void OpenCVForUnity.PtcloudModule.Ptcloud.loadMesh ( string filename,
Mat vertices,
List< Mat > indices,
Mat normals,
Mat colors,
Mat texCoords )
static

Loads a mesh from a file.

The function loads mesh from the specified file and returns it. If the mesh cannot be read, throws an error Vertex attributes (i.e. space and texture coodinates, normals and colors) are returned in same-sized arrays with corresponding elements having the same indices. This means that if a face uses a vertex with a normal or a texture coordinate with different indices (which is typical for OBJ files for example), this vertex will be duplicated for each face it uses.

Currently, the following file formats are supported:

Parameters
filenameName of the file
verticesvertex coordinates, each value contains 3 floats
indicesper-face list of vertices, each value is a vector of ints
normalsper-vertex normals, each value contains 3 floats
colorsper-vertex colors, each value contains 3 floats
texCoordsper-vertex texture coordinates, each value contains 2 or 3 floats

◆ loadPointCloud() [1/3]

static void OpenCVForUnity.PtcloudModule.Ptcloud.loadPointCloud ( string filename,
Mat vertices )
static

Loads a point cloud from a file.

The function loads point cloud from the specified file and returns it. If the cloud cannot be read, throws an error. Vertex coordinates, normals and colors are returned as they are saved in the file even if these arrays have different sizes and their elements do not correspond to each other (which is typical for OBJ files for example)

Currently, the following file formats are supported:

Parameters
filenameName of the file
verticesvertex coordinates, each value contains 3 floats
normalsper-vertex normals, each value contains 3 floats
rgbper-vertex colors, each value contains 3 floats

◆ loadPointCloud() [2/3]

static void OpenCVForUnity.PtcloudModule.Ptcloud.loadPointCloud ( string filename,
Mat vertices,
Mat normals )
static

Loads a point cloud from a file.

The function loads point cloud from the specified file and returns it. If the cloud cannot be read, throws an error. Vertex coordinates, normals and colors are returned as they are saved in the file even if these arrays have different sizes and their elements do not correspond to each other (which is typical for OBJ files for example)

Currently, the following file formats are supported:

Parameters
filenameName of the file
verticesvertex coordinates, each value contains 3 floats
normalsper-vertex normals, each value contains 3 floats
rgbper-vertex colors, each value contains 3 floats

◆ loadPointCloud() [3/3]

static void OpenCVForUnity.PtcloudModule.Ptcloud.loadPointCloud ( string filename,
Mat vertices,
Mat normals,
Mat rgb )
static

Loads a point cloud from a file.

The function loads point cloud from the specified file and returns it. If the cloud cannot be read, throws an error. Vertex coordinates, normals and colors are returned as they are saved in the file even if these arrays have different sizes and their elements do not correspond to each other (which is typical for OBJ files for example)

Currently, the following file formats are supported:

Parameters
filenameName of the file
verticesvertex coordinates, each value contains 3 floats
normalsper-vertex normals, each value contains 3 floats
rgbper-vertex colors, each value contains 3 floats

◆ orientedBoundingBox3D()

static void OpenCVForUnity.PtcloudModule.Ptcloud.orientedBoundingBox3D ( Mat inputCloud,
Mat center,
Mat axes,
Mat halfExtents )
static

Computes a PCA-based oriented bounding box (OBB) of a point cloud.

The box axes are the principal axes of the cloud (covariance eigenvectors). This is the common practical OBB (as in Open3D); it is not guaranteed to be the minimum-volume OBB. A point p is inside the box iff abs(axes * (p - center)) is <= halfExtents component-wise.

Parameters
inputCloudInput point cloud, 3-channel float array (CV_32FC3), or an Nx3 / 3xN CV_32F matrix.
centerOutput box center (x,y,z), 3x1 CV_32F.
axesOutput 3x3 CV_32F; each row is a unit box axis.
halfExtentsOutput half-size along each axis, 3x1 CV_32F.

◆ orientNormals() [1/3]

static void OpenCVForUnity.PtcloudModule.Ptcloud.orientNormals ( Mat inputCloud,
Mat normals,
in Vec3d viewpoint )
static

Flips point-cloud normals so that they face a given viewpoint.

Each normal whose direction points away from viewpoint is negated. Useful when the sensor position is known. Estimate the normals first with cv::normalEstimate.

Parameters
inputCloudInput point cloud, 3-channel float array (CV_32FC3), or an Nx3 / 3xN CV_32F matrix.
normalsPer-point normals to orient in place, Nx1 CV_32FC3 (as from cv::normalEstimate).
viewpointPoint the normals should face towards (e.g. the camera center).

◆ orientNormals() [2/3]

static void OpenCVForUnity.PtcloudModule.Ptcloud.orientNormals ( Mat inputCloud,
Mat normals,
in(double x, double y, double z) viewpoint )
static

Flips point-cloud normals so that they face a given viewpoint.

Each normal whose direction points away from viewpoint is negated. Useful when the sensor position is known. Estimate the normals first with cv::normalEstimate.

Parameters
inputCloudInput point cloud, 3-channel float array (CV_32FC3), or an Nx3 / 3xN CV_32F matrix.
normalsPer-point normals to orient in place, Nx1 CV_32FC3 (as from cv::normalEstimate).
viewpointPoint the normals should face towards (e.g. the camera center).

◆ orientNormals() [3/3]

static void OpenCVForUnity.PtcloudModule.Ptcloud.orientNormals ( Mat inputCloud,
Mat normals,
Point3 viewpoint )
static

Flips point-cloud normals so that they face a given viewpoint.

Each normal whose direction points away from viewpoint is negated. Useful when the sensor position is known. Estimate the normals first with cv::normalEstimate.

Parameters
inputCloudInput point cloud, 3-channel float array (CV_32FC3), or an Nx3 / 3xN CV_32F matrix.
normalsPer-point normals to orient in place, Nx1 CV_32FC3 (as from cv::normalEstimate).
viewpointPoint the normals should face towards (e.g. the camera center).

◆ orientNormalsConsistent() [1/2]

static void OpenCVForUnity.PtcloudModule.Ptcloud.orientNormalsConsistent ( Mat inputCloud,
Mat normals )
static

Orients point-cloud normals consistently across the whole cloud.

Builds a Riemannian graph over the k nearest neighbors (edge weight 1 - |n_i . n_j|), computes its minimum spanning tree with cv::buildMST, and propagates a consistent sign along the tree from a seed point (Hoppe et al. 1992). If the neighbor graph is disconnected the normals are oriented outward about the centroid instead. Estimate the normals first with cv::normalEstimate.

Parameters
inputCloudInput point cloud, 3-channel float array (CV_32FC3), or an Nx3 / 3xN CV_32F matrix.
normalsPer-point normals to orient in place, Nx1 CV_32FC3 (as from cv::normalEstimate).
kNumber of nearest neighbors used to build the graph.

◆ orientNormalsConsistent() [2/2]

static void OpenCVForUnity.PtcloudModule.Ptcloud.orientNormalsConsistent ( Mat inputCloud,
Mat normals,
int k )
static

Orients point-cloud normals consistently across the whole cloud.

Builds a Riemannian graph over the k nearest neighbors (edge weight 1 - |n_i . n_j|), computes its minimum spanning tree with cv::buildMST, and propagates a consistent sign along the tree from a seed point (Hoppe et al. 1992). If the neighbor graph is disconnected the normals are oriented outward about the centroid instead. Estimate the normals first with cv::normalEstimate.

Parameters
inputCloudInput point cloud, 3-channel float array (CV_32FC3), or an Nx3 / 3xN CV_32F matrix.
normalsPer-point normals to orient in place, Nx1 CV_32FC3 (as from cv::normalEstimate).
kNumber of nearest neighbors used to build the graph.

◆ registerDepth() [1/6]

static void OpenCVForUnity.PtcloudModule.Ptcloud.registerDepth ( Mat unregisteredCameraMatrix,
Mat registeredCameraMatrix,
Mat registeredDistCoeffs,
Mat Rt,
Mat unregisteredDepth,
in Vec2d outputImagePlaneSize,
Mat registeredDepth )
static

Registers depth data to an external camera Registration is performed by creating a depth cloud, transforming the cloud by the rigid body transformation between the cameras, and then projecting the transformed points into the RGB camera.

uv_rgb = K_rgb * [R | t] * z * inv(K_ir) * uv_ir

Currently does not check for negative depth values.

Parameters
unregisteredCameraMatrixthe camera matrix of the depth camera
registeredCameraMatrixthe camera matrix of the external camera
registeredDistCoeffsthe distortion coefficients of the external camera
Rtthe rigid body transform between the cameras. Transforms points from depth camera frame to external camera frame.
unregisteredDepththe input depth data
outputImagePlaneSizethe image plane dimensions of the external camera (width, height)
registeredDepththe result of transforming the depth into the external camera
depthDilationwhether or not the depth is dilated to avoid holes and occlusion errors (optional)

◆ registerDepth() [2/6]

static void OpenCVForUnity.PtcloudModule.Ptcloud.registerDepth ( Mat unregisteredCameraMatrix,
Mat registeredCameraMatrix,
Mat registeredDistCoeffs,
Mat Rt,
Mat unregisteredDepth,
in Vec2d outputImagePlaneSize,
Mat registeredDepth,
bool depthDilation )
static

Registers depth data to an external camera Registration is performed by creating a depth cloud, transforming the cloud by the rigid body transformation between the cameras, and then projecting the transformed points into the RGB camera.

uv_rgb = K_rgb * [R | t] * z * inv(K_ir) * uv_ir

Currently does not check for negative depth values.

Parameters
unregisteredCameraMatrixthe camera matrix of the depth camera
registeredCameraMatrixthe camera matrix of the external camera
registeredDistCoeffsthe distortion coefficients of the external camera
Rtthe rigid body transform between the cameras. Transforms points from depth camera frame to external camera frame.
unregisteredDepththe input depth data
outputImagePlaneSizethe image plane dimensions of the external camera (width, height)
registeredDepththe result of transforming the depth into the external camera
depthDilationwhether or not the depth is dilated to avoid holes and occlusion errors (optional)

◆ registerDepth() [3/6]

static void OpenCVForUnity.PtcloudModule.Ptcloud.registerDepth ( Mat unregisteredCameraMatrix,
Mat registeredCameraMatrix,
Mat registeredDistCoeffs,
Mat Rt,
Mat unregisteredDepth,
in(double width, double height) outputImagePlaneSize,
Mat registeredDepth )
static

Registers depth data to an external camera Registration is performed by creating a depth cloud, transforming the cloud by the rigid body transformation between the cameras, and then projecting the transformed points into the RGB camera.

uv_rgb = K_rgb * [R | t] * z * inv(K_ir) * uv_ir

Currently does not check for negative depth values.

Parameters
unregisteredCameraMatrixthe camera matrix of the depth camera
registeredCameraMatrixthe camera matrix of the external camera
registeredDistCoeffsthe distortion coefficients of the external camera
Rtthe rigid body transform between the cameras. Transforms points from depth camera frame to external camera frame.
unregisteredDepththe input depth data
outputImagePlaneSizethe image plane dimensions of the external camera (width, height)
registeredDepththe result of transforming the depth into the external camera
depthDilationwhether or not the depth is dilated to avoid holes and occlusion errors (optional)

◆ registerDepth() [4/6]

static void OpenCVForUnity.PtcloudModule.Ptcloud.registerDepth ( Mat unregisteredCameraMatrix,
Mat registeredCameraMatrix,
Mat registeredDistCoeffs,
Mat Rt,
Mat unregisteredDepth,
in(double width, double height) outputImagePlaneSize,
Mat registeredDepth,
bool depthDilation )
static

Registers depth data to an external camera Registration is performed by creating a depth cloud, transforming the cloud by the rigid body transformation between the cameras, and then projecting the transformed points into the RGB camera.

uv_rgb = K_rgb * [R | t] * z * inv(K_ir) * uv_ir

Currently does not check for negative depth values.

Parameters
unregisteredCameraMatrixthe camera matrix of the depth camera
registeredCameraMatrixthe camera matrix of the external camera
registeredDistCoeffsthe distortion coefficients of the external camera
Rtthe rigid body transform between the cameras. Transforms points from depth camera frame to external camera frame.
unregisteredDepththe input depth data
outputImagePlaneSizethe image plane dimensions of the external camera (width, height)
registeredDepththe result of transforming the depth into the external camera
depthDilationwhether or not the depth is dilated to avoid holes and occlusion errors (optional)

◆ registerDepth() [5/6]

static void OpenCVForUnity.PtcloudModule.Ptcloud.registerDepth ( Mat unregisteredCameraMatrix,
Mat registeredCameraMatrix,
Mat registeredDistCoeffs,
Mat Rt,
Mat unregisteredDepth,
Size outputImagePlaneSize,
Mat registeredDepth )
static

Registers depth data to an external camera Registration is performed by creating a depth cloud, transforming the cloud by the rigid body transformation between the cameras, and then projecting the transformed points into the RGB camera.

uv_rgb = K_rgb * [R | t] * z * inv(K_ir) * uv_ir

Currently does not check for negative depth values.

Parameters
unregisteredCameraMatrixthe camera matrix of the depth camera
registeredCameraMatrixthe camera matrix of the external camera
registeredDistCoeffsthe distortion coefficients of the external camera
Rtthe rigid body transform between the cameras. Transforms points from depth camera frame to external camera frame.
unregisteredDepththe input depth data
outputImagePlaneSizethe image plane dimensions of the external camera (width, height)
registeredDepththe result of transforming the depth into the external camera
depthDilationwhether or not the depth is dilated to avoid holes and occlusion errors (optional)

◆ registerDepth() [6/6]

static void OpenCVForUnity.PtcloudModule.Ptcloud.registerDepth ( Mat unregisteredCameraMatrix,
Mat registeredCameraMatrix,
Mat registeredDistCoeffs,
Mat Rt,
Mat unregisteredDepth,
Size outputImagePlaneSize,
Mat registeredDepth,
bool depthDilation )
static

Registers depth data to an external camera Registration is performed by creating a depth cloud, transforming the cloud by the rigid body transformation between the cameras, and then projecting the transformed points into the RGB camera.

uv_rgb = K_rgb * [R | t] * z * inv(K_ir) * uv_ir

Currently does not check for negative depth values.

Parameters
unregisteredCameraMatrixthe camera matrix of the depth camera
registeredCameraMatrixthe camera matrix of the external camera
registeredDistCoeffsthe distortion coefficients of the external camera
Rtthe rigid body transform between the cameras. Transforms points from depth camera frame to external camera frame.
unregisteredDepththe input depth data
outputImagePlaneSizethe image plane dimensions of the external camera (width, height)
registeredDepththe result of transforming the depth into the external camera
depthDilationwhether or not the depth is dilated to avoid holes and occlusion errors (optional)

◆ removeRadiusOutliers() [1/3]

static void OpenCVForUnity.PtcloudModule.Ptcloud.removeRadiusOutliers ( Mat inputCloud,
Mat outputCloud,
double radius )
static

Removes radius outliers from a point cloud.

Any point that has fewer than minNeighbors other points within radius is treated as an isolated outlier and dropped.

Parameters
inputCloudInput point cloud, 3-channel float array (CV_32FC3), or an Nx3 / 3xN CV_32F matrix.
outputCloudOutput filtered point cloud, Nx1 CV_32FC3.
radiusSearch radius.
minNeighborsMinimum number of neighbors (not counting the point itself) required to keep a point.
keptIndicesOptional output, indices (CV_32S) into the input cloud of the points that were kept.

◆ removeRadiusOutliers() [2/3]

static void OpenCVForUnity.PtcloudModule.Ptcloud.removeRadiusOutliers ( Mat inputCloud,
Mat outputCloud,
double radius,
int minNeighbors )
static

Removes radius outliers from a point cloud.

Any point that has fewer than minNeighbors other points within radius is treated as an isolated outlier and dropped.

Parameters
inputCloudInput point cloud, 3-channel float array (CV_32FC3), or an Nx3 / 3xN CV_32F matrix.
outputCloudOutput filtered point cloud, Nx1 CV_32FC3.
radiusSearch radius.
minNeighborsMinimum number of neighbors (not counting the point itself) required to keep a point.
keptIndicesOptional output, indices (CV_32S) into the input cloud of the points that were kept.

◆ removeRadiusOutliers() [3/3]

static void OpenCVForUnity.PtcloudModule.Ptcloud.removeRadiusOutliers ( Mat inputCloud,
Mat outputCloud,
double radius,
int minNeighbors,
Mat keptIndices )
static

Removes radius outliers from a point cloud.

Any point that has fewer than minNeighbors other points within radius is treated as an isolated outlier and dropped.

Parameters
inputCloudInput point cloud, 3-channel float array (CV_32FC3), or an Nx3 / 3xN CV_32F matrix.
outputCloudOutput filtered point cloud, Nx1 CV_32FC3.
radiusSearch radius.
minNeighborsMinimum number of neighbors (not counting the point itself) required to keep a point.
keptIndicesOptional output, indices (CV_32S) into the input cloud of the points that were kept.

◆ removeStatisticalOutliers() [1/4]

static void OpenCVForUnity.PtcloudModule.Ptcloud.removeStatisticalOutliers ( Mat inputCloud,
Mat outputCloud )
static

Removes statistical outliers from a point cloud.

For each point the mean distance to its meanK nearest neighbors is computed. Points whose mean distance exceeds global_mean + stddevMulThresh * global_stddev are treated as outliers and dropped. This targets sparse noise scattered around the surface.

Parameters
inputCloudInput point cloud, 3-channel float array (CV_32FC3), or an Nx3 / 3xN CV_32F matrix.
outputCloudOutput filtered point cloud, Nx1 CV_32FC3.
meanKNumber of nearest neighbors used to estimate the mean distance of each point.
stddevMulThreshStandard-deviation multiplier for the distance threshold.
keptIndicesOptional output, indices (CV_32S) into the input cloud of the points that were kept.

◆ removeStatisticalOutliers() [2/4]

static void OpenCVForUnity.PtcloudModule.Ptcloud.removeStatisticalOutliers ( Mat inputCloud,
Mat outputCloud,
int meanK )
static

Removes statistical outliers from a point cloud.

For each point the mean distance to its meanK nearest neighbors is computed. Points whose mean distance exceeds global_mean + stddevMulThresh * global_stddev are treated as outliers and dropped. This targets sparse noise scattered around the surface.

Parameters
inputCloudInput point cloud, 3-channel float array (CV_32FC3), or an Nx3 / 3xN CV_32F matrix.
outputCloudOutput filtered point cloud, Nx1 CV_32FC3.
meanKNumber of nearest neighbors used to estimate the mean distance of each point.
stddevMulThreshStandard-deviation multiplier for the distance threshold.
keptIndicesOptional output, indices (CV_32S) into the input cloud of the points that were kept.

◆ removeStatisticalOutliers() [3/4]

static void OpenCVForUnity.PtcloudModule.Ptcloud.removeStatisticalOutliers ( Mat inputCloud,
Mat outputCloud,
int meanK,
double stddevMulThresh )
static

Removes statistical outliers from a point cloud.

For each point the mean distance to its meanK nearest neighbors is computed. Points whose mean distance exceeds global_mean + stddevMulThresh * global_stddev are treated as outliers and dropped. This targets sparse noise scattered around the surface.

Parameters
inputCloudInput point cloud, 3-channel float array (CV_32FC3), or an Nx3 / 3xN CV_32F matrix.
outputCloudOutput filtered point cloud, Nx1 CV_32FC3.
meanKNumber of nearest neighbors used to estimate the mean distance of each point.
stddevMulThreshStandard-deviation multiplier for the distance threshold.
keptIndicesOptional output, indices (CV_32S) into the input cloud of the points that were kept.

◆ removeStatisticalOutliers() [4/4]

static void OpenCVForUnity.PtcloudModule.Ptcloud.removeStatisticalOutliers ( Mat inputCloud,
Mat outputCloud,
int meanK,
double stddevMulThresh,
Mat keptIndices )
static

Removes statistical outliers from a point cloud.

For each point the mean distance to its meanK nearest neighbors is computed. Points whose mean distance exceeds global_mean + stddevMulThresh * global_stddev are treated as outliers and dropped. This targets sparse noise scattered around the surface.

Parameters
inputCloudInput point cloud, 3-channel float array (CV_32FC3), or an Nx3 / 3xN CV_32F matrix.
outputCloudOutput filtered point cloud, Nx1 CV_32FC3.
meanKNumber of nearest neighbors used to estimate the mean distance of each point.
stddevMulThreshStandard-deviation multiplier for the distance threshold.
keptIndicesOptional output, indices (CV_32S) into the input cloud of the points that were kept.

◆ rescaleDepth() [1/2]

static void OpenCVForUnity.PtcloudModule.Ptcloud.rescaleDepth ( Mat _in,
int type,
Mat _out )
static

If the input image is of type CV_16UC1 (like the Kinect one), the image is converted to floats, divided by depth_factor to get a depth in meters, and the values 0 are converted to std::numeric_limits<float>::quiet_NaN() Otherwise, the image is simply converted to floats

Parameters
inthe depth image (if given as short int CV_U, it is assumed to be the depth in millimeters (as done with the Microsoft Kinect), it is assumed in meters)
typethe desired output depth (CV_32F or CV_64F)
outThe rescaled float depth image
depth_factor(optional) factor by which depth is converted to distance (by default = 1000.0 for Kinect sensor)

◆ rescaleDepth() [2/2]

static void OpenCVForUnity.PtcloudModule.Ptcloud.rescaleDepth ( Mat _in,
int type,
Mat _out,
double depth_factor )
static

If the input image is of type CV_16UC1 (like the Kinect one), the image is converted to floats, divided by depth_factor to get a depth in meters, and the values 0 are converted to std::numeric_limits<float>::quiet_NaN() Otherwise, the image is simply converted to floats

Parameters
inthe depth image (if given as short int CV_U, it is assumed to be the depth in millimeters (as done with the Microsoft Kinect), it is assumed in meters)
typethe desired output depth (CV_32F or CV_64F)
outThe rescaled float depth image
depth_factor(optional) factor by which depth is converted to distance (by default = 1000.0 for Kinect sensor)

◆ saveMesh() [1/4]

static void OpenCVForUnity.PtcloudModule.Ptcloud.saveMesh ( string filename,
Mat vertices,
List< Mat > indices )
static

Saves a mesh to a specified file.

The function saves mesh to the specified file. File format is chosen based on the filename extension.

Parameters
filenameName of the file.
verticesvertex coordinates, each value contains 3 floats
indicesper-face list of vertices, each value is a vector of ints
normalsper-vertex normals, each value contains 3 floats
colorsper-vertex colors, each value contains 3 floats
texCoordsper-vertex texture coordinates, each value contains 2 or 3 floats

◆ saveMesh() [2/4]

static void OpenCVForUnity.PtcloudModule.Ptcloud.saveMesh ( string filename,
Mat vertices,
List< Mat > indices,
Mat normals )
static

Saves a mesh to a specified file.

The function saves mesh to the specified file. File format is chosen based on the filename extension.

Parameters
filenameName of the file.
verticesvertex coordinates, each value contains 3 floats
indicesper-face list of vertices, each value is a vector of ints
normalsper-vertex normals, each value contains 3 floats
colorsper-vertex colors, each value contains 3 floats
texCoordsper-vertex texture coordinates, each value contains 2 or 3 floats

◆ saveMesh() [3/4]

static void OpenCVForUnity.PtcloudModule.Ptcloud.saveMesh ( string filename,
Mat vertices,
List< Mat > indices,
Mat normals,
Mat colors )
static

Saves a mesh to a specified file.

The function saves mesh to the specified file. File format is chosen based on the filename extension.

Parameters
filenameName of the file.
verticesvertex coordinates, each value contains 3 floats
indicesper-face list of vertices, each value is a vector of ints
normalsper-vertex normals, each value contains 3 floats
colorsper-vertex colors, each value contains 3 floats
texCoordsper-vertex texture coordinates, each value contains 2 or 3 floats

◆ saveMesh() [4/4]

static void OpenCVForUnity.PtcloudModule.Ptcloud.saveMesh ( string filename,
Mat vertices,
List< Mat > indices,
Mat normals,
Mat colors,
Mat texCoords )
static

Saves a mesh to a specified file.

The function saves mesh to the specified file. File format is chosen based on the filename extension.

Parameters
filenameName of the file.
verticesvertex coordinates, each value contains 3 floats
indicesper-face list of vertices, each value is a vector of ints
normalsper-vertex normals, each value contains 3 floats
colorsper-vertex colors, each value contains 3 floats
texCoordsper-vertex texture coordinates, each value contains 2 or 3 floats

◆ savePointCloud() [1/3]

static void OpenCVForUnity.PtcloudModule.Ptcloud.savePointCloud ( string filename,
Mat vertices )
static

Saves a point cloud to a specified file.

The function saves point cloud to the specified file. File format is chosen based on the filename extension.

Parameters
filenameName of the file
verticesvertex coordinates, each value contains 3 floats
normalsper-vertex normals, each value contains 3 floats
rgbper-vertex colors, each value contains 3 floats

◆ savePointCloud() [2/3]

static void OpenCVForUnity.PtcloudModule.Ptcloud.savePointCloud ( string filename,
Mat vertices,
Mat normals )
static

Saves a point cloud to a specified file.

The function saves point cloud to the specified file. File format is chosen based on the filename extension.

Parameters
filenameName of the file
verticesvertex coordinates, each value contains 3 floats
normalsper-vertex normals, each value contains 3 floats
rgbper-vertex colors, each value contains 3 floats

◆ savePointCloud() [3/3]

static void OpenCVForUnity.PtcloudModule.Ptcloud.savePointCloud ( string filename,
Mat vertices,
Mat normals,
Mat rgb )
static

Saves a point cloud to a specified file.

The function saves point cloud to the specified file. File format is chosen based on the filename extension.

Parameters
filenameName of the file
verticesvertex coordinates, each value contains 3 floats
normalsper-vertex normals, each value contains 3 floats
rgbper-vertex colors, each value contains 3 floats

◆ setGridVisible()

static void OpenCVForUnity.PtcloudModule.Ptcloud.setGridVisible ( string win_name,
bool visible )
static

Hides or shows the grid on a viz3d window.

Parameters
win_nameName of the viz3d window.
visibleShould the grid be shown?

◆ setPerspective()

static void OpenCVForUnity.PtcloudModule.Ptcloud.setPerspective ( string win_name,
float fov,
float z_near,
float z_far )
static

Sets the view's perspective on a viz3d window.

Parameters
win_nameName of the viz3d window.
fovVertical field of view in radians.
z_nearMinimum clip distance.
z_farMaximum clip distance.

◆ showGaussianSplats()

static void OpenCVForUnity.PtcloudModule.Ptcloud.showGaussianSplats ( string win_name,
string obj_name,
Mat splats )
static

Shows a 3D Gaussian Splatting scene in the specified viz3d window. See cv::viz3d::destroyObject.

Splats are alpha blended, sorted back to front by camera-space depth on the CPU whenever the view changes, and drawn after all opaque objects in the same window.

Several splat objects in one window are drawn back to front by the depth of their centers. This is correct for scenes that are apart from each other, but scenes that interpenetrate can blend in the wrong order where they overlap. Merge such scenes into a single object instead.

Parameters
win_nameName of the viz3d window.
obj_nameName of the object.
splatsOne row per Gaussian, 13 floats wide: position (3), upper triangle of the symmetric 3D covariance (6: xx, xy, xz, yy, yz, zz), color (3), opacity (1). As produced by cv::loadGaussianSplats or cv::decodeGaussianSplats, see cv::GaussianSplatLayout.

◆ showLines()

static void OpenCVForUnity.PtcloudModule.Ptcloud.showLines ( string win_name,
string obj_name,
Mat points )
static

Shows a lines object in the specified viz3d window. See cv::viz3d::destroyObject.

The points array must be 2D, where each row has either a width of 6 (xyz, rgb), so that each row represents a point. Points are grouped in pairs to make lines (points 1 and 2, points 3 and 4, etc).

Parameters
win_nameName of the viz3d window.
obj_nameName of the object.
pointsVertices input array.

◆ showMesh2()

static void OpenCVForUnity.PtcloudModule.Ptcloud.showMesh2 ( string win_name,
string obj_name,
Mat verts )
static

◆ showPoints()

static void OpenCVForUnity.PtcloudModule.Ptcloud.showPoints ( string win_name,
string obj_name,
Mat points )
static

Shows a point cloud object in the specified viz3d window. See cv::viz3d::destroyObject.

The points array must be 2D, where each row has either a width of 6 (xyz, rgb), so that each row represents a point.

Parameters
win_nameName of the viz3d window.
obj_nameName of the object.
pointsVertices input array.

◆ triangleRasterize() [1/2]

static void OpenCVForUnity.PtcloudModule.Ptcloud.triangleRasterize ( Mat vertices,
Mat indices,
Mat colors,
Mat colorBuf,
Mat depthBuf,
Mat world2cam,
double fovY,
double zNear,
double zFar )
static

Renders a set of triangles on a depth and color image.

Triangles can be drawn white (1.0, 1.0, 1.0), flat-shaded or with a color interpolation between vertices. In flat-shaded mode the 1st vertex color of each triangle is used to fill the whole triangle.

The world2cam is an inverted camera pose matrix in fact. It transforms vertices from world to camera coordinate system.

The camera coordinate system emulates the OpenGL's coordinate system having coordinate origin in a screen center, X axis pointing right, Y axis pointing up and Z axis pointing towards the viewer except that image is vertically flipped after the render. This means that all visible objects are placed in z-negative area, or exactly in -zNear > z > -zFar since zNear and zFar are positive. For example, at fovY = PI/2 the point (0, 1, -1) will be projected to (width/2, 0) screen point, (1, 0, -1) to (width/2 + height/2, height/2). Increasing fovY makes projection smaller and vice versa.

The function does not create or clear output images before the rendering. This means that it can be used for drawing over an existing image or for rendering a model into a 3D scene using pre-filled Z-buffer.

Empty scene results in a depth buffer filled by the maximum value since every pixel is infinitely far from the camera. Therefore, before rendering anything from scratch the depthBuf should be filled by zFar values (or by ones in INVDEPTH mode).

There are special versions of this function named triangleRasterizeDepth and triangleRasterizeColor for cases if a user needs a color image or a depth image alone; they may run slightly faster.

Parameters
verticesvertices coordinates array. Should contain values of CV_32FC3 type or a compatible one (e.g. cv::Vec3f, etc.)
indicestriangle vertices index array, 3 per triangle. Each index indicates a vertex in a vertices array. Should contain CV_32SC3 values or compatible
colorsper-vertex colors of CV_32FC3 type or compatible. Can be empty or the same size as vertices array. If the values are out of [0; 1] range, the result correctness is not guaranteed
colorBufan array representing the final rendered image. Should containt CV_32FC3 values and be the same size as depthBuf. Not cleared before rendering, i.e. the content is reused as there is some pre-rendered scene.
depthBufan array of floats containing resulting Z buffer. Should contain float values and be the same size as colorBuf. Not cleared before rendering, i.e. the content is reused as there is some pre-rendered scene. Empty scene corresponds to all values set to zFar (or to 1.0 in INVDEPTH mode)
world2cama 4x3 or 4x4 float or double matrix containing inverted (sic!) camera pose
fovYfield of view in vertical direction, given in radians
zNearminimum Z value to render, everything closer is clipped
zFarmaximum Z value to render, everything farther is clipped
settingssee TriangleRasterizeSettings. By default the smooth shading is on, with CW culling and with disabled GL compatibility

◆ triangleRasterize() [2/2]

static void OpenCVForUnity.PtcloudModule.Ptcloud.triangleRasterize ( Mat vertices,
Mat indices,
Mat colors,
Mat colorBuf,
Mat depthBuf,
Mat world2cam,
double fovY,
double zNear,
double zFar,
TriangleRasterizeSettings settings )
static

Renders a set of triangles on a depth and color image.

Triangles can be drawn white (1.0, 1.0, 1.0), flat-shaded or with a color interpolation between vertices. In flat-shaded mode the 1st vertex color of each triangle is used to fill the whole triangle.

The world2cam is an inverted camera pose matrix in fact. It transforms vertices from world to camera coordinate system.

The camera coordinate system emulates the OpenGL's coordinate system having coordinate origin in a screen center, X axis pointing right, Y axis pointing up and Z axis pointing towards the viewer except that image is vertically flipped after the render. This means that all visible objects are placed in z-negative area, or exactly in -zNear > z > -zFar since zNear and zFar are positive. For example, at fovY = PI/2 the point (0, 1, -1) will be projected to (width/2, 0) screen point, (1, 0, -1) to (width/2 + height/2, height/2). Increasing fovY makes projection smaller and vice versa.

The function does not create or clear output images before the rendering. This means that it can be used for drawing over an existing image or for rendering a model into a 3D scene using pre-filled Z-buffer.

Empty scene results in a depth buffer filled by the maximum value since every pixel is infinitely far from the camera. Therefore, before rendering anything from scratch the depthBuf should be filled by zFar values (or by ones in INVDEPTH mode).

There are special versions of this function named triangleRasterizeDepth and triangleRasterizeColor for cases if a user needs a color image or a depth image alone; they may run slightly faster.

Parameters
verticesvertices coordinates array. Should contain values of CV_32FC3 type or a compatible one (e.g. cv::Vec3f, etc.)
indicestriangle vertices index array, 3 per triangle. Each index indicates a vertex in a vertices array. Should contain CV_32SC3 values or compatible
colorsper-vertex colors of CV_32FC3 type or compatible. Can be empty or the same size as vertices array. If the values are out of [0; 1] range, the result correctness is not guaranteed
colorBufan array representing the final rendered image. Should containt CV_32FC3 values and be the same size as depthBuf. Not cleared before rendering, i.e. the content is reused as there is some pre-rendered scene.
depthBufan array of floats containing resulting Z buffer. Should contain float values and be the same size as colorBuf. Not cleared before rendering, i.e. the content is reused as there is some pre-rendered scene. Empty scene corresponds to all values set to zFar (or to 1.0 in INVDEPTH mode)
world2cama 4x3 or 4x4 float or double matrix containing inverted (sic!) camera pose
fovYfield of view in vertical direction, given in radians
zNearminimum Z value to render, everything closer is clipped
zFarmaximum Z value to render, everything farther is clipped
settingssee TriangleRasterizeSettings. By default the smooth shading is on, with CW culling and with disabled GL compatibility

◆ triangleRasterizeColor() [1/2]

static void OpenCVForUnity.PtcloudModule.Ptcloud.triangleRasterizeColor ( Mat vertices,
Mat indices,
Mat colors,
Mat colorBuf,
Mat world2cam,
double fovY,
double zNear,
double zFar )
static

Overloaded version of triangleRasterize() with color-only rendering.

Parameters
verticesvertices coordinates array. Should contain values of CV_32FC3 type or a compatible one (e.g. cv::Vec3f, etc.)
indicestriangle vertices index array, 3 per triangle. Each index indicates a vertex in a vertices array. Should contain CV_32SC3 values or compatible
colorsper-vertex colors of CV_32FC3 type or compatible. Can be empty or the same size as vertices array. If the values are out of [0; 1] range, the result correctness is not guaranteed
colorBufan array representing the final rendered image. Should containt CV_32FC3 values and be the same size as depthBuf. Not cleared before rendering, i.e. the content is reused as there is some pre-rendered scene.
world2cama 4x3 or 4x4 float or double matrix containing inverted (sic!) camera pose
fovYfield of view in vertical direction, given in radians
zNearminimum Z value to render, everything closer is clipped
zFarmaximum Z value to render, everything farther is clipped
settingssee TriangleRasterizeSettings. By default the smooth shading is on, with CW culling and with disabled GL compatibility

◆ triangleRasterizeColor() [2/2]

static void OpenCVForUnity.PtcloudModule.Ptcloud.triangleRasterizeColor ( Mat vertices,
Mat indices,
Mat colors,
Mat colorBuf,
Mat world2cam,
double fovY,
double zNear,
double zFar,
TriangleRasterizeSettings settings )
static

Overloaded version of triangleRasterize() with color-only rendering.

Parameters
verticesvertices coordinates array. Should contain values of CV_32FC3 type or a compatible one (e.g. cv::Vec3f, etc.)
indicestriangle vertices index array, 3 per triangle. Each index indicates a vertex in a vertices array. Should contain CV_32SC3 values or compatible
colorsper-vertex colors of CV_32FC3 type or compatible. Can be empty or the same size as vertices array. If the values are out of [0; 1] range, the result correctness is not guaranteed
colorBufan array representing the final rendered image. Should containt CV_32FC3 values and be the same size as depthBuf. Not cleared before rendering, i.e. the content is reused as there is some pre-rendered scene.
world2cama 4x3 or 4x4 float or double matrix containing inverted (sic!) camera pose
fovYfield of view in vertical direction, given in radians
zNearminimum Z value to render, everything closer is clipped
zFarmaximum Z value to render, everything farther is clipped
settingssee TriangleRasterizeSettings. By default the smooth shading is on, with CW culling and with disabled GL compatibility

◆ triangleRasterizeDepth() [1/2]

static void OpenCVForUnity.PtcloudModule.Ptcloud.triangleRasterizeDepth ( Mat vertices,
Mat indices,
Mat depthBuf,
Mat world2cam,
double fovY,
double zNear,
double zFar )
static

Overloaded version of triangleRasterize() with depth-only rendering.

Parameters
verticesvertices coordinates array. Should contain values of CV_32FC3 type or a compatible one (e.g. cv::Vec3f, etc.)
indicestriangle vertices index array, 3 per triangle. Each index indicates a vertex in a vertices array. Should contain CV_32SC3 values or compatible
depthBufan array of floats containing resulting Z buffer. Should contain float values and be the same size as colorBuf. Not cleared before rendering, i.e. the content is reused as there is some pre-rendered scene. Empty scene corresponds to all values set to zFar (or to 1.0 in INVDEPTH mode)
world2cama 4x3 or 4x4 float or double matrix containing inverted (sic!) camera pose
fovYfield of view in vertical direction, given in radians
zNearminimum Z value to render, everything closer is clipped
zFarmaximum Z value to render, everything farther is clipped
settingssee TriangleRasterizeSettings. By default the smooth shading is on, with CW culling and with disabled GL compatibility

◆ triangleRasterizeDepth() [2/2]

static void OpenCVForUnity.PtcloudModule.Ptcloud.triangleRasterizeDepth ( Mat vertices,
Mat indices,
Mat depthBuf,
Mat world2cam,
double fovY,
double zNear,
double zFar,
TriangleRasterizeSettings settings )
static

Overloaded version of triangleRasterize() with depth-only rendering.

Parameters
verticesvertices coordinates array. Should contain values of CV_32FC3 type or a compatible one (e.g. cv::Vec3f, etc.)
indicestriangle vertices index array, 3 per triangle. Each index indicates a vertex in a vertices array. Should contain CV_32SC3 values or compatible
depthBufan array of floats containing resulting Z buffer. Should contain float values and be the same size as colorBuf. Not cleared before rendering, i.e. the content is reused as there is some pre-rendered scene. Empty scene corresponds to all values set to zFar (or to 1.0 in INVDEPTH mode)
world2cama 4x3 or 4x4 float or double matrix containing inverted (sic!) camera pose
fovYfield of view in vertical direction, given in radians
zNearminimum Z value to render, everything closer is clipped
zFarmaximum Z value to render, everything farther is clipped
settingssee TriangleRasterizeSettings. By default the smooth shading is on, with CW culling and with disabled GL compatibility

◆ warpFrame() [1/4]

static void OpenCVForUnity.PtcloudModule.Ptcloud.warpFrame ( Mat depth,
Mat image,
Mat mask,
Mat Rt,
Mat cameraMatrix )
static

Warps depth or RGB-D image by reprojecting it in 3d, applying Rt transformation and then projecting it back onto the image plane. This function can be used to visualize the results of the Odometry algorithm.

Parameters
depthDepth data, should be 1-channel CV_16U, CV_16S, CV_32F or CV_64F
imageRGB image (optional), should be 1-, 3- or 4-channel CV_8U
maskMask of used pixels (optional), should be CV_8UC1, CV_8SC1 or CV_BoolC1
RtRotation+translation matrix (3x4 or 4x4) to be applied to depth points
cameraMatrixCamera intrinsics matrix (3x3)
warpedDepthThe warped depth data (optional)
warpedImageThe warped RGB image (optional)
warpedMaskThe mask of valid pixels in warped image (optional)

◆ warpFrame() [2/4]

static void OpenCVForUnity.PtcloudModule.Ptcloud.warpFrame ( Mat depth,
Mat image,
Mat mask,
Mat Rt,
Mat cameraMatrix,
Mat warpedDepth )
static

Warps depth or RGB-D image by reprojecting it in 3d, applying Rt transformation and then projecting it back onto the image plane. This function can be used to visualize the results of the Odometry algorithm.

Parameters
depthDepth data, should be 1-channel CV_16U, CV_16S, CV_32F or CV_64F
imageRGB image (optional), should be 1-, 3- or 4-channel CV_8U
maskMask of used pixels (optional), should be CV_8UC1, CV_8SC1 or CV_BoolC1
RtRotation+translation matrix (3x4 or 4x4) to be applied to depth points
cameraMatrixCamera intrinsics matrix (3x3)
warpedDepthThe warped depth data (optional)
warpedImageThe warped RGB image (optional)
warpedMaskThe mask of valid pixels in warped image (optional)

◆ warpFrame() [3/4]

static void OpenCVForUnity.PtcloudModule.Ptcloud.warpFrame ( Mat depth,
Mat image,
Mat mask,
Mat Rt,
Mat cameraMatrix,
Mat warpedDepth,
Mat warpedImage )
static

Warps depth or RGB-D image by reprojecting it in 3d, applying Rt transformation and then projecting it back onto the image plane. This function can be used to visualize the results of the Odometry algorithm.

Parameters
depthDepth data, should be 1-channel CV_16U, CV_16S, CV_32F or CV_64F
imageRGB image (optional), should be 1-, 3- or 4-channel CV_8U
maskMask of used pixels (optional), should be CV_8UC1, CV_8SC1 or CV_BoolC1
RtRotation+translation matrix (3x4 or 4x4) to be applied to depth points
cameraMatrixCamera intrinsics matrix (3x3)
warpedDepthThe warped depth data (optional)
warpedImageThe warped RGB image (optional)
warpedMaskThe mask of valid pixels in warped image (optional)

◆ warpFrame() [4/4]

static void OpenCVForUnity.PtcloudModule.Ptcloud.warpFrame ( Mat depth,
Mat image,
Mat mask,
Mat Rt,
Mat cameraMatrix,
Mat warpedDepth,
Mat warpedImage,
Mat warpedMask )
static

Warps depth or RGB-D image by reprojecting it in 3d, applying Rt transformation and then projecting it back onto the image plane. This function can be used to visualize the results of the Odometry algorithm.

Parameters
depthDepth data, should be 1-channel CV_16U, CV_16S, CV_32F or CV_64F
imageRGB image (optional), should be 1-, 3- or 4-channel CV_8U
maskMask of used pixels (optional), should be CV_8UC1, CV_8SC1 or CV_BoolC1
RtRotation+translation matrix (3x4 or 4x4) to be applied to depth points
cameraMatrixCamera intrinsics matrix (3x3)
warpedDepthThe warped depth data (optional)
warpedImageThe warped RGB image (optional)
warpedMaskThe mask of valid pixels in warped image (optional)

Member Data Documentation

◆ GAUSSIAN_SPLAT_ALPHA

const int OpenCVForUnity.PtcloudModule.Ptcloud.GAUSSIAN_SPLAT_ALPHA = 12
static

C++: enum GaussianSplatLayout (cv.GaussianSplatLayout)

◆ GAUSSIAN_SPLAT_COV

const int OpenCVForUnity.PtcloudModule.Ptcloud.GAUSSIAN_SPLAT_COV = 3
static

C++: enum GaussianSplatLayout (cv.GaussianSplatLayout)

◆ GAUSSIAN_SPLAT_POS

const int OpenCVForUnity.PtcloudModule.Ptcloud.GAUSSIAN_SPLAT_POS = 0
static

C++: enum GaussianSplatLayout (cv.GaussianSplatLayout)

◆ GAUSSIAN_SPLAT_RGB

const int OpenCVForUnity.PtcloudModule.Ptcloud.GAUSSIAN_SPLAT_RGB = 9
static

C++: enum GaussianSplatLayout (cv.GaussianSplatLayout)

◆ GAUSSIAN_SPLAT_STRIDE

const int OpenCVForUnity.PtcloudModule.Ptcloud.GAUSSIAN_SPLAT_STRIDE = 13
static

C++: enum GaussianSplatLayout (cv.GaussianSplatLayout)

◆ INITIALIZING

const int OpenCVForUnity.PtcloudModule.Ptcloud.INITIALIZING = 1
static

C++: enum OdometryState (cv.slam.OdometryState)

◆ N_PYRAMIDS

const int OpenCVForUnity.PtcloudModule.Ptcloud.N_PYRAMIDS = 8 + 1
static

C++: enum OdometryFramePyramidType (cv.OdometryFramePyramidType)

◆ NOT_INITIALIZED

const int OpenCVForUnity.PtcloudModule.Ptcloud.NOT_INITIALIZED = 0
static

C++: enum OdometryState (cv.slam.OdometryState)

◆ OdometryAlgoType_COMMON

const int OpenCVForUnity.PtcloudModule.Ptcloud.OdometryAlgoType_COMMON = 0
static

C++: enum OdometryAlgoType (cv.OdometryAlgoType)

◆ OdometryAlgoType_FAST

const int OpenCVForUnity.PtcloudModule.Ptcloud.OdometryAlgoType_FAST = 1
static

C++: enum OdometryAlgoType (cv.OdometryAlgoType)

◆ OdometryType_DEPTH

const int OpenCVForUnity.PtcloudModule.Ptcloud.OdometryType_DEPTH = 0
static

C++: enum OdometryType (cv.OdometryType)

◆ OdometryType_RGB

const int OpenCVForUnity.PtcloudModule.Ptcloud.OdometryType_RGB = 1
static

C++: enum OdometryType (cv.OdometryType)

◆ OdometryType_RGB_DEPTH

const int OpenCVForUnity.PtcloudModule.Ptcloud.OdometryType_RGB_DEPTH = 2
static

C++: enum OdometryType (cv.OdometryType)

◆ PYR_CLOUD

const int OpenCVForUnity.PtcloudModule.Ptcloud.PYR_CLOUD = 3
static

C++: enum OdometryFramePyramidType (cv.OdometryFramePyramidType)

◆ PYR_DEPTH

const int OpenCVForUnity.PtcloudModule.Ptcloud.PYR_DEPTH = 1
static

C++: enum OdometryFramePyramidType (cv.OdometryFramePyramidType)

◆ PYR_DIX

const int OpenCVForUnity.PtcloudModule.Ptcloud.PYR_DIX = 4
static

C++: enum OdometryFramePyramidType (cv.OdometryFramePyramidType)

◆ PYR_DIY

const int OpenCVForUnity.PtcloudModule.Ptcloud.PYR_DIY = 5
static

C++: enum OdometryFramePyramidType (cv.OdometryFramePyramidType)

◆ PYR_IMAGE

const int OpenCVForUnity.PtcloudModule.Ptcloud.PYR_IMAGE = 0
static

C++: enum OdometryFramePyramidType (cv.OdometryFramePyramidType)

◆ PYR_MASK

const int OpenCVForUnity.PtcloudModule.Ptcloud.PYR_MASK = 2
static

C++: enum OdometryFramePyramidType (cv.OdometryFramePyramidType)

◆ PYR_NORM

const int OpenCVForUnity.PtcloudModule.Ptcloud.PYR_NORM = 7
static

C++: enum OdometryFramePyramidType (cv.OdometryFramePyramidType)

◆ PYR_NORMMASK

const int OpenCVForUnity.PtcloudModule.Ptcloud.PYR_NORMMASK = 8
static

C++: enum OdometryFramePyramidType (cv.OdometryFramePyramidType)

◆ PYR_TEXMASK

const int OpenCVForUnity.PtcloudModule.Ptcloud.PYR_TEXMASK = 6
static

C++: enum OdometryFramePyramidType (cv.OdometryFramePyramidType)

◆ RASTERIZE_COMPAT_DISABLED

const int OpenCVForUnity.PtcloudModule.Ptcloud.RASTERIZE_COMPAT_DISABLED = 0
static

C++: enum TriangleGlCompatibleMode (cv.TriangleGlCompatibleMode)

◆ RASTERIZE_COMPAT_INVDEPTH

const int OpenCVForUnity.PtcloudModule.Ptcloud.RASTERIZE_COMPAT_INVDEPTH = 1
static

C++: enum TriangleGlCompatibleMode (cv.TriangleGlCompatibleMode)

◆ RASTERIZE_CULLING_CCW

const int OpenCVForUnity.PtcloudModule.Ptcloud.RASTERIZE_CULLING_CCW = 2
static

C++: enum TriangleCullingMode (cv.TriangleCullingMode)

◆ RASTERIZE_CULLING_CW

const int OpenCVForUnity.PtcloudModule.Ptcloud.RASTERIZE_CULLING_CW = 1
static

C++: enum TriangleCullingMode (cv.TriangleCullingMode)

◆ RASTERIZE_CULLING_NONE

const int OpenCVForUnity.PtcloudModule.Ptcloud.RASTERIZE_CULLING_NONE = 0
static

C++: enum TriangleCullingMode (cv.TriangleCullingMode)

◆ RASTERIZE_SHADING_FLAT

const int OpenCVForUnity.PtcloudModule.Ptcloud.RASTERIZE_SHADING_FLAT = 1
static

C++: enum TriangleShadingType (cv.TriangleShadingType)

◆ RASTERIZE_SHADING_SHADED

const int OpenCVForUnity.PtcloudModule.Ptcloud.RASTERIZE_SHADING_SHADED = 2
static

C++: enum TriangleShadingType (cv.TriangleShadingType)

◆ RASTERIZE_SHADING_WHITE

const int OpenCVForUnity.PtcloudModule.Ptcloud.RASTERIZE_SHADING_WHITE = 0
static

C++: enum TriangleShadingType (cv.TriangleShadingType)

◆ RENDER_SHADING

const int OpenCVForUnity.PtcloudModule.Ptcloud.RENDER_SHADING = 1
static

C++: enum RenderMode (cv.viz3d.RenderMode)

◆ RENDER_SIMPLE

const int OpenCVForUnity.PtcloudModule.Ptcloud.RENDER_SIMPLE = 0
static

C++: enum RenderMode (cv.viz3d.RenderMode)

◆ RENDER_WIREFRAME

const int OpenCVForUnity.PtcloudModule.Ptcloud.RENDER_WIREFRAME = 2
static

C++: enum RenderMode (cv.viz3d.RenderMode)

◆ RGBD_PLANE_METHOD_DEFAULT

const int OpenCVForUnity.PtcloudModule.Ptcloud.RGBD_PLANE_METHOD_DEFAULT = 0
static

C++: enum RgbdPlaneMethod (cv.RgbdPlaneMethod)

◆ TRACKING

const int OpenCVForUnity.PtcloudModule.Ptcloud.TRACKING = 2
static

C++: enum OdometryState (cv.slam.OdometryState)

◆ VolumeType_ColorHashTSDF

const int OpenCVForUnity.PtcloudModule.Ptcloud.VolumeType_ColorHashTSDF = 3
static

C++: enum VolumeType (cv.VolumeType)

◆ VolumeType_ColorTSDF

const int OpenCVForUnity.PtcloudModule.Ptcloud.VolumeType_ColorTSDF = 2
static

C++: enum VolumeType (cv.VolumeType)

◆ VolumeType_HashTSDF

const int OpenCVForUnity.PtcloudModule.Ptcloud.VolumeType_HashTSDF = 1
static

C++: enum VolumeType (cv.VolumeType)

◆ VolumeType_TSDF

const int OpenCVForUnity.PtcloudModule.Ptcloud.VolumeType_TSDF = 0
static

C++: enum VolumeType (cv.VolumeType)


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