OpenCV 5.0.0
Open Source Computer Vision
読み込み中...
検索中...
見つかりません
🤖 AIによる機械翻訳(非公式) — これは OpenCV 5.0.0 公式リファレンス(英語)を AI (Claude) で自動翻訳したものです。訳に誤りを含む場合があります。正確な情報は 公式英語版(原文) を参照してください。

テキスト検出ネットワークの基底クラス。 続き...

#include <opencv2/dnn/dnn.hpp>

Collaboration diagram for cv::dnn::TextDetectionModel:

公開メンバ関数

void detect (InputArray frame, std::vector< std::vector< Point > > &detections) const
 
void detect (InputArray frame, std::vector< std::vector< Point > > &detections, std::vector< float > &confidences) const
 検出を実行する。
 
void detectTextRectangles (InputArray frame, std::vector< cv::RotatedRect > &detections) const
 
void detectTextRectangles (InputArray frame, std::vector< cv::RotatedRect > &detections, std::vector< float > &confidences) const
 検出を実行する。
 
- Public Member Functions inherited from cv::dnn::Model
 Model ()
 
 Model (const Model &)=default
 
 Model (const Net &network)
 ディープラーニングのネットワークからモデルを作成する。
 
 Model (CV_WRAP_FILE_PATH const String &model, CV_WRAP_FILE_PATH const String &config="")
 サポートされている形式のいずれかで表現されたディープラーニングのネットワークからモデルを作成する。modelconfig 引数の順序は問わない。
 
 Model (Model &&)=default
 
ModelenableWinograd (bool useWinograd)
 
Impl * getImpl () const
 
Impl & getImplRef () const
 
NetgetNetwork_ ()
 
NetgetNetwork_ () const
 
 operator Net & () const
 
Modeloperator= (const Model &)=default
 
Modeloperator= (Model &&)=default
 
void predict (InputArray frame, OutputArrayOfArrays outs) const
 input フレームを与え、入力blobを作成し、netを実行して出力 blobs を返す。
 
ModelsetInputCrop (bool crop)
 フレームに対するcropフラグを設定する。
 
ModelsetInputMean (const Scalar &mean)
 フレームに対する平均値を設定する。
 
void setInputParams (double scale=1.0, const Size &size=Size(), const Scalar &mean=Scalar(), bool swapRB=false, bool crop=false)
 フレームの前処理パラメータを設定する。
 
ModelsetInputScale (const Scalar &scale)
 フレームのscalefactor値を設定する。
 
ModelsetInputSize (const Size &size)
 フレームの入力サイズを設定する。
 
ModelsetInputSize (int width, int height)
 
ModelsetInputSwapRB (bool swapRB)
 フレームのフラグswapRBを設定する。
 
ModelsetOutputNames (const std::vector< String > &outNames)
 フレームの出力名を設定する。
 
ModelsetPreferableBackend (dnn::Backend backendId)
 
ModelsetPreferableTarget (dnn::Target targetId)
 

限定公開メンバ関数

 TextDetectionModel ()
 

Additional Inherited Members

- Protected Attributes inherited from cv::dnn::Model
Ptr< Impl > impl
 

詳細説明

テキスト検出ネットワークの基底クラス。

構築子と解体子の詳解

◆ TextDetectionModel()

cv::dnn::TextDetectionModel::TextDetectionModel ( )
protected

メンバ関数詳解

◆ detect() [1/2]

void cv::dnn::TextDetectionModel::detect ( InputArray frame,
std::vector< std::vector< Point > > & detections ) const
Python:
cv.dnn.TextDetectionModel.detect(frame) -> detections, confidences
cv.dnn.TextDetectionModel.detect(frame) -> detections

これは利便性のために提供されているオーバーロードされたメンバ関数である。上記の関数とは、受け取る引数のみが異なる。

◆ detect() [2/2]

void cv::dnn::TextDetectionModel::detect ( InputArray frame,
std::vector< std::vector< Point > > & detections,
std::vector< float > & confidences ) const
Python:
cv.dnn.TextDetectionModel.detect(frame) -> detections, confidences
cv.dnn.TextDetectionModel.detect(frame) -> detections

検出を実行する。

入力 frame を受け取り、ネットワーク入力を準備し、ネットワーク推論を実行し、ネットワーク出力を後処理して検出結果を返す。

各結果は次の順序の四角形の4点である。

  • 左下
  • 左上
  • 右上
  • 右下

透視変換を行わずに画像領域を取得するには cv::getPerspectiveTransform 関数を使用する。

覚え書き
DLモデルがこの種の出力をサポートしていない場合、結果は detectTextRectangles() の出力から導出される場合がある。
引数
[in]frame入力画像
[out]detections検出された四角形の配列(結果1件につき4点)
[out]confidences検出の信頼度の配列

◆ detectTextRectangles() [1/2]

void cv::dnn::TextDetectionModel::detectTextRectangles ( InputArray frame,
std::vector< cv::RotatedRect > & detections ) const
Python:
cv.dnn.TextDetectionModel.detectTextRectangles(frame) -> detections, confidences
cv.dnn.TextDetectionModel.detectTextRectangles(frame) -> detections

これは利便性のために提供されているオーバーロードされたメンバ関数である。上記の関数とは、受け取る引数のみが異なる。

◆ detectTextRectangles() [2/2]

void cv::dnn::TextDetectionModel::detectTextRectangles ( InputArray frame,
std::vector< cv::RotatedRect > & detections,
std::vector< float > & confidences ) const
Python:
cv.dnn.TextDetectionModel.detectTextRectangles(frame) -> detections, confidences
cv.dnn.TextDetectionModel.detectTextRectangles(frame) -> detections

検出を実行する。

入力 frame を受け取り、ネットワーク入力を準備し、ネットワーク推論を実行し、ネットワーク出力を後処理して検出結果を返す。

各結果は回転矩形である。

覚え書き
強い透視変換がある場合、結果は不正確になることがある。
引数
[in]frame入力画像
[out]detections検出された RotationRect 結果の配列
[out]confidences検出の信頼度の配列

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