OpenCV  4.1.1
Open Source Computer Vision
Public Member Functions | List of all members
cv::cnn_3dobj::descriptorExtractor Class Reference

Caffe based 3D images descriptor. A class to extract features from an image. The so obtained descriptors can be used for classification and pose estimation goals [240]. More...

#include <opencv2/cnn_3dobj.hpp>

Public Member Functions

 descriptorExtractor (const String &device_type, int device_id=0)
 Set the device for feature extraction, if the GPU is used, there should be a device_id. More...
 
void extract (InputArrayOfArrays inputimg, OutputArray feature, String feature_blob)
 Extract features from a single image or from a vector of images. If loadNet was not called before, this method invocation will fail. More...
 
int getDeviceId ()
 Get device ID information for feature extraction. More...
 
String getDeviceType ()
 Get device type information for feature extraction. More...
 
void loadNet (const String &model_file, const String &trained_file, const String &mean_file="")
 Initiate a classification structure, the net work parameter is stored in model_file, the network structure is stored in trained_file, you can decide whether to use mean images or not. More...
 
void setDeviceId (const int &device_id)
 Set device ID information for feature extraction. Useful to change device without the need to reload the net. Only used for GPU. More...
 
void setDeviceType (const String &device_type)
 Set device type information for feature extraction. Useful to change device without the need to reload the net. More...
 

Detailed Description

Caffe based 3D images descriptor. A class to extract features from an image. The so obtained descriptors can be used for classification and pose estimation goals [240].

Constructor & Destructor Documentation

§ descriptorExtractor()

cv::cnn_3dobj::descriptorExtractor::descriptorExtractor ( const String device_type,
int  device_id = 0 
)

Set the device for feature extraction, if the GPU is used, there should be a device_id.

Parameters
device_typeCPU or GPU.
device_idID of GPU.

Member Function Documentation

§ extract()

void cv::cnn_3dobj::descriptorExtractor::extract ( InputArrayOfArrays  inputimg,
OutputArray  feature,
String  feature_blob 
)

Extract features from a single image or from a vector of images. If loadNet was not called before, this method invocation will fail.

Parameters
inputimgInput images.
featureOutput features.
feature_blobLayer which the feature is extracted from.

§ getDeviceId()

int cv::cnn_3dobj::descriptorExtractor::getDeviceId ( )

Get device ID information for feature extraction.

§ getDeviceType()

String cv::cnn_3dobj::descriptorExtractor::getDeviceType ( )

Get device type information for feature extraction.

§ loadNet()

void cv::cnn_3dobj::descriptorExtractor::loadNet ( const String model_file,
const String trained_file,
const String mean_file = "" 
)

Initiate a classification structure, the net work parameter is stored in model_file, the network structure is stored in trained_file, you can decide whether to use mean images or not.

Parameters
model_filePath of caffemodel which including all parameters in CNN.
trained_filePath of prototxt which defining the structure of CNN.
mean_filePath of mean file(option).

§ setDeviceId()

void cv::cnn_3dobj::descriptorExtractor::setDeviceId ( const int &  device_id)

Set device ID information for feature extraction. Useful to change device without the need to reload the net. Only used for GPU.

Parameters
device_idID of GPU.

§ setDeviceType()

void cv::cnn_3dobj::descriptorExtractor::setDeviceType ( const String device_type)

Set device type information for feature extraction. Useful to change device without the need to reload the net.

Parameters
device_typeCPU or GPU.

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