OpenCV453
公開メンバ関数 | 限定公開型 | 限定公開メンバ関数 | 限定公開変数類 | 全メンバ一覧
cv::linemod::Detector クラス

Object detector using the LINE template matching algorithm with any set of modalities. [詳解]

#include <linemod.hpp>

公開メンバ関数

CV_WRAP Detector ()
 Empty constructor, initialize with read().
 
CV_WRAP Detector (const std::vector< Ptr< Modality > > &modalities, const std::vector< int > &T_pyramid)
 Constructor. [詳解]
 
CV_WRAP void match (const std::vector< Mat > &sources, float threshold, CV_OUT std::vector< Match > &matches, const std::vector< String > &class_ids=std::vector< String >(), OutputArrayOfArrays quantized_images=noArray(), const std::vector< Mat > &masks=std::vector< Mat >()) const
 Detect objects by template matching. [詳解]
 
CV_WRAP int addTemplate (const std::vector< Mat > &sources, const String &class_id, const Mat &object_mask, CV_OUT Rect *bounding_box=NULL)
 Add new object template. [詳解]
 
CV_WRAP int addSyntheticTemplate (const std::vector< Template > &templates, const String &class_id)
 Add a new object template computed by external means.
 
CV_WRAP const std::vector< Ptr< Modality > > & getModalities () const
 Get the modalities used by this detector. [詳解]
 
CV_WRAP int getT (int pyramid_level) const
 Get sampling step T at pyramid_level.
 
CV_WRAP int pyramidLevels () const
 Get number of pyramid levels used by this detector.
 
CV_WRAP const std::vector< Template > & getTemplates (const String &class_id, int template_id) const
 Get the template pyramid identified by template_id. [詳解]
 
CV_WRAP int numTemplates () const
 
CV_WRAP int numTemplates (const String &class_id) const
 
CV_WRAP int numClasses () const
 
CV_WRAP std::vector< String > classIds () const
 
CV_WRAP void read (const FileNode &fn)
 
void write (FileStorage &fs) const
 
String readClass (const FileNode &fn, const String &class_id_override="")
 
void writeClass (const String &class_id, FileStorage &fs) const
 
CV_WRAP void readClasses (const std::vector< String > &class_ids, const String &format="templates_%s.yml.gz")
 
CV_WRAP void writeClasses (const String &format="templates_%s.yml.gz") const
 

限定公開型

typedef std::vector< TemplateTemplatePyramid
 
typedef std::map< String, std::vector< TemplatePyramid > > TemplatesMap
 
typedef std::vector< MatLinearMemories
 
typedef std::vector< std::vector< LinearMemories > > LinearMemoryPyramid
 

限定公開メンバ関数

void matchClass (const LinearMemoryPyramid &lm_pyramid, const std::vector< Size > &sizes, float threshold, std::vector< Match > &matches, const String &class_id, const std::vector< TemplatePyramid > &template_pyramids) const
 

限定公開変数類

std::vector< Ptr< Modality > > modalities
 
int pyramid_levels
 
std::vector< int > T_at_level
 
TemplatesMap class_templates
 

詳解

Object detector using the LINE template matching algorithm with any set of modalities.

構築子と解体子

◆ Detector()

CV_WRAP cv::linemod::Detector::Detector ( const std::vector< Ptr< Modality > > &  modalities,
const std::vector< int > &  T_pyramid 
)

Constructor.

引数
modalitiesModalities to use (color gradients, depth normals, ...).
T_pyramidValue of the sampling step T at each pyramid level. The number of pyramid levels is T_pyramid.size().

関数詳解

◆ addTemplate()

CV_WRAP int cv::linemod::Detector::addTemplate ( const std::vector< Mat > &  sources,
const String &  class_id,
const Mat object_mask,
CV_OUT Rect bounding_box = NULL 
)

Add new object template.

引数
sourcesSource images, one for each modality.
class_idObject class ID.
object_maskMask separating object from background.
[out]bounding_boxOptionally return bounding box of the extracted features.
戻り値
Template ID, or -1 if failed to extract a valid template.

◆ getModalities()

CV_WRAP const std::vector< Ptr< Modality > > & cv::linemod::Detector::getModalities ( ) const
inline

Get the modalities used by this detector.

You are not permitted to add/remove modalities, but you may dynamic_cast them to tweak parameters.

◆ getTemplates()

CV_WRAP const std::vector< Template > & cv::linemod::Detector::getTemplates ( const String &  class_id,
int  template_id 
) const

Get the template pyramid identified by template_id.

For example, with 2 modalities (Gradient, Normal) and two pyramid levels (L0, L1), the order is (GradientL0, NormalL0, GradientL1, NormalL1).

◆ match()

CV_WRAP void cv::linemod::Detector::match ( const std::vector< Mat > &  sources,
float  threshold,
CV_OUT std::vector< Match > &  matches,
const std::vector< String > &  class_ids = std::vector< String >(),
OutputArrayOfArrays  quantized_images = noArray(),
const std::vector< Mat > &  masks = std::vector< Mat >() 
) const

Detect objects by template matching.

Matches globally at the lowest pyramid level, then refines locally stepping up the pyramid.

引数
sourcesSource images, one for each modality.
thresholdSimilarity threshold, a percentage between 0 and 100.
[out]matchesTemplate matches, sorted by similarity score.
class_idsIf non-empty, only search for the desired object classes.
[out]quantized_imagesOptionally return vector<Mat> of quantized images.
masksThe masks for consideration during matching. The masks should be CV_8UC1 where 255 represents a valid pixel. If non-empty, the vector must be the same size as sources. Each element must be empty or the same size as its corresponding source.

このクラス詳解は次のファイルから抽出されました: