| OpenCV 3.4.3 Open Source Computer Vision

Public Member Functions | List of all members
cv::cnn_3dobj::descriptorExtractor Class Reference
3D object recognition and pose estimation API

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 [210]. More...

`#include "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 [210].

## 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_type | CPU or GPU.
  device_id | ID 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

  inputimg | Input images.
  feature | Output features.
  feature_blob | Layer 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_file | Path of caffemodel which including all parameters in CNN.
  trained_file | Path of prototxt which defining the structure of CNN.
  mean_file | Path 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_id | ID 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_type | CPU or GPU.

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

- /build/3_4-contrib_docs-lin64/opencv_contrib/modules/cnn_3dobj/include/opencv2/cnn_3dobj.hpp