OpenCV  3.4.10
Open Source Computer Vision
Public Member Functions | Static Public Member Functions | Public Attributes | List of all members
cv::cnn_3dobj::icoSphere Class Reference

Icosohedron based camera view data generator. The class create some sphere views of camera towards a 3D object meshed from .ply files [95] . More...

#include <opencv2/cnn_3dobj.hpp>

Public Member Functions

 icoSphere (float radius_in, int depth_in)
 Generating a sphere by mean of a iteration based points selection process. More...
 
cv::Point3d getCenter (cv::Mat cloud)
 Get the center of points on surface in .ply model. More...
 
float getRadius (cv::Mat cloud, cv::Point3d center)
 Get the proper camera radius from the view point to the center of model. More...
 

Static Public Member Functions

static void createHeader (int num_item, int rows, int cols, const char *headerPath)
 Create header in binary files collecting the image data and label. More...
 
static int swapEndian (int val)
 Suit the position of bytes in 4 byte data structure for particular system. More...
 
static void writeBinaryfile (String filenameImg, const char *binaryPath, const char *headerPath, int num_item, int label_class, int x, int y, int z, int isrgb)
 Write binary files used for training in other open source project including Caffe. More...
 

Public Attributes

std::vector< cv::Point3dCameraPos
 Camera position on the sphere after duplicated points elimination. More...
 

Detailed Description

Icosohedron based camera view data generator. The class create some sphere views of camera towards a 3D object meshed from .ply files [95] .

Constructor & Destructor Documentation

◆ icoSphere()

cv::cnn_3dobj::icoSphere::icoSphere ( float  radius_in,
int  depth_in 
)

Generating a sphere by mean of a iteration based points selection process.

Parameters
radius_inAnother radius used for adjusting the view distance.
depth_inNumber of interations for increasing the points on sphere.

Member Function Documentation

◆ createHeader()

static void cv::cnn_3dobj::icoSphere::createHeader ( int  num_item,
int  rows,
int  cols,
const char *  headerPath 
)
static

Create header in binary files collecting the image data and label.

Parameters
num_itemNumber of items.
rowsRows of a single sample image.
colsColumns of a single sample image.
headerPathPath where the header will be stored.

◆ getCenter()

cv::Point3d cv::cnn_3dobj::icoSphere::getCenter ( cv::Mat  cloud)

Get the center of points on surface in .ply model.

Parameters
cloudPoint cloud used for computing the center point.

◆ getRadius()

float cv::cnn_3dobj::icoSphere::getRadius ( cv::Mat  cloud,
cv::Point3d  center 
)

Get the proper camera radius from the view point to the center of model.

Parameters
cloudPoint cloud used for computing the center point.
centercenter point of the point cloud.

◆ swapEndian()

static int cv::cnn_3dobj::icoSphere::swapEndian ( int  val)
static

Suit the position of bytes in 4 byte data structure for particular system.

◆ writeBinaryfile()

static void cv::cnn_3dobj::icoSphere::writeBinaryfile ( String  filenameImg,
const char *  binaryPath,
const char *  headerPath,
int  num_item,
int  label_class,
int  x,
int  y,
int  z,
int  isrgb 
)
static

Write binary files used for training in other open source project including Caffe.

Parameters
filenameImgPath which including a set of images.
binaryPathPath which will output a binary file.
headerPathPath which header belongs to.
num_itemNumber of samples.
label_classClass label of the sample.
xPose label of X.
yPose label of Y.
zPose label of Z.
isrgbOption for choice of using RGB images or not.

Member Data Documentation

◆ CameraPos

std::vector<cv::Point3d> cv::cnn_3dobj::icoSphere::CameraPos

Camera position on the sphere after duplicated points elimination.


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