OpenCV453
公開メンバ関数 | 全メンバ一覧
cv::dnn::DetectionModel クラス

This class represents high-level API for object detection networks. [詳解]

#include <dnn.hpp>

cv::dnn::Modelを継承しています。

公開メンバ関数

CV_WRAP DetectionModel (const String &model, const String &config="")
 Create detection model from network represented in one of the supported formats. An order of model and config arguments does not matter. [詳解]
 
CV_WRAP DetectionModel (const Net &network)
 Create model from deep learning network. [詳解]
 
CV_WRAP DetectionModelsetNmsAcrossClasses (bool value)
 nmsAcrossClasses defaults to false, such that when non max suppression is used during the detect() function, it will do so per-class. This function allows you to toggle this behaviour. [詳解]
 
CV_WRAP bool getNmsAcrossClasses ()
 Getter for nmsAcrossClasses. This variable defaults to false, such that when non max suppression is used during the detect() function, it will do so only per-class
 
CV_WRAP void detect (InputArray frame, CV_OUT std::vector< int > &classIds, CV_OUT std::vector< float > &confidences, CV_OUT std::vector< Rect > &boxes, float confThreshold=0.5f, float nmsThreshold=0.0f)
 Given the input frame, create input blob, run net and return result detections. [詳解]
 
- 基底クラス cv::dnn::Model に属する継承公開メンバ関数
 Model (const Model &)=default
 
 Model (Model &&)=default
 
Modeloperator= (const Model &)=default
 
Modeloperator= (Model &&)=default
 
CV_WRAP Model (const String &model, const String &config="")
 Create model from deep learning network represented in one of the supported formats. An order of model and config arguments does not matter. [詳解]
 
CV_WRAP Model (const Net &network)
 Create model from deep learning network. [詳解]
 
CV_WRAP ModelsetInputSize (const Size &size)
 Set input size for frame. [詳解]
 
CV_WRAP ModelsetInputSize (int width, int height)
 
CV_WRAP ModelsetInputMean (const Scalar &mean)
 Set mean value for frame. [詳解]
 
CV_WRAP ModelsetInputScale (double scale)
 Set scalefactor value for frame. [詳解]
 
CV_WRAP ModelsetInputCrop (bool crop)
 Set flag crop for frame. [詳解]
 
CV_WRAP ModelsetInputSwapRB (bool swapRB)
 Set flag swapRB for frame. [詳解]
 
CV_WRAP void setInputParams (double scale=1.0, const Size &size=Size(), const Scalar &mean=Scalar(), bool swapRB=false, bool crop=false)
 Set preprocessing parameters for frame. [詳解]
 
CV_WRAP void predict (InputArray frame, OutputArrayOfArrays outs) const
 Given the input frame, create input blob, run net and return the output blobs. [詳解]
 
CV_WRAP ModelsetPreferableBackend (dnn::Backend backendId)
 
CV_WRAP ModelsetPreferableTarget (dnn::Target targetId)
 
CV_DEPRECATED_EXTERNAL operator Net & () const
 
NetgetNetwork_ () const
 
NetgetNetwork_ ()
 
Impl * getImpl () const
 
Impl & getImplRef () const
 

その他の継承メンバ

- 基底クラス cv::dnn::Model に属する継承限定公開変数類
Ptr< Impl > impl
 

詳解

This class represents high-level API for object detection networks.

DetectionModel allows to set params for preprocessing input image. DetectionModel creates net from file with trained weights and config, sets preprocessing input, runs forward pass and return result detections. For DetectionModel SSD, Faster R-CNN, YOLO topologies are supported.

構築子と解体子

◆ DetectionModel() [1/2]

CV_WRAP cv::dnn::DetectionModel::DetectionModel ( const String &  model,
const String &  config = "" 
)

Create detection model from network represented in one of the supported formats. An order of model and config arguments does not matter.

引数
[in]modelBinary file contains trained weights.
[in]configText file contains network configuration.

◆ DetectionModel() [2/2]

CV_WRAP cv::dnn::DetectionModel::DetectionModel ( const Net network)

Create model from deep learning network.

引数
[in]networkNet object.

関数詳解

◆ detect()

CV_WRAP void cv::dnn::DetectionModel::detect ( InputArray  frame,
CV_OUT std::vector< int > &  classIds,
CV_OUT std::vector< float > &  confidences,
CV_OUT std::vector< Rect > &  boxes,
float  confThreshold = 0.5f,
float  nmsThreshold = 0.0f 
)

Given the input frame, create input blob, run net and return result detections.

引数
[in]frameThe input image.
[out]classIdsClass indexes in result detection.
[out]confidencesA set of corresponding confidences.
[out]boxesA set of bounding boxes.
[in]confThresholdA threshold used to filter boxes by confidences.
[in]nmsThresholdA threshold used in non maximum suppression.

◆ setNmsAcrossClasses()

CV_WRAP DetectionModel & cv::dnn::DetectionModel::setNmsAcrossClasses ( bool  value)

nmsAcrossClasses defaults to false, such that when non max suppression is used during the detect() function, it will do so per-class. This function allows you to toggle this behaviour.

引数
[in]valueThe new value for nmsAcrossClasses

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