TextDetectorCNN
class provides the functionallity of text bounding box detection. This class is representing to find bounding boxes of text words given an input image. This class uses OpenCV dnn module to load pre-trained model described in
[LiaoSBWL17]. The original repository with the modified SSD Caffe version:
https://github.com/MhLiao/TextBoxes. Model can be downloaded from
DropBox. Modified .prototxt file with the model description can be found in
opencv_contrib/modules/text/samples/textbox.prototxt
.
[詳解]
#include <textDetector.hpp>
cv::text::TextDetectorを継承しています。
|
virtual CV_WRAP void |
detect
(InputArray inputImage, CV_OUT std::vector<
Rect
> &Bbox, CV_OUT std::vector< float > &confidence) CV_OVERRIDE=0 |
|
TextDetectorCNNクラスは,テキストのバウンディングボックスを検出する機能を提供します.このクラスは,入力画像に含まれるテキスト単語のバウンディングボックスを検出するためのものです.このクラスは,OpenCV の dnn モジュールを利用して,以下に示す事前学習済みのモデルを読み込みます.[LiaoSBWL17]で推奨されています.. オリジナルのリポジトリにSSD Caffeの修正を加えたものです。https://github.com/MhLiao/TextBoxes. モデルは以下からダウンロードできます。ドロップボックス. モデルの説明を含む修正された.prototxtファイルは、以下の場所にあります。opencv_contrib/modules/text/samples/textbox.prototxt
.
◆
create()
[1/2]
static CV_WRAP
Ptr<
TextDetectorCNN
> cv::text::TextDetectorCNN::create
|
( |
const String & |
modelArchFilename,
|
|
|
const String & |
modelWeightsFilename |
|
) |
|
|
|
static
|
これはオーバーロードされたメンバ関数です。利便性のために用意されています。元の関数との違いは引き数のみです。
◆
create()
[2/2]
static
Ptr<
TextDetectorCNN
> cv::text::TextDetectorCNN::create
|
( |
const String & |
modelArchFilename,
|
|
|
const String & |
modelWeightsFilename,
|
|
|
std::vector<
Size
> |
detectionSizes |
|
) |
|
|
|
static
|
クラスのインスタンスを作成します。TextDetectorCNN与えられたパラメータを用いて,以下のようなクラスを作成します.
- 引数
-
modelArchFilename |
分類器のアーキテクチャを記述した prototxt ファイルへの相対パスまたは絶対パス. |
modelWeightsFilename |
プリトレーニングされたモデルの重みをcaffe-binary形式で格納したファイルへの相対パスまたは絶対パス. |
detectionSizes |
マルチスケール検出のためのサイズのリスト.これらの値は[(300,300),(700,500),(700,300),(700,700),(1600,1600)] が推奨されています.[LiaoSBWL17]で推奨されています.で推奨されている値を利用すると,最高の品質が得られます. |
◆
detect()
virtual CV_WRAP void cv::text::TextDetectorCNN::detect
|
( |
InputArray |
inputImage,
|
|
|
CV_OUT std::vector<
Rect
> & |
Bbox,
|
|
|
CV_OUT std::vector< float > & |
confidence |
|
) |
|
|
|
pure virtual
|
これはオーバーロードされたメンバ関数です。利便性のために用意されています。元の関数との違いは引き数のみです。
- 引数
-
inputImage |
任意のサイズの CV_U8C3 であることが予想される画像. |
Bbox |
検出された単語のバウンディングボックスを格納する Rect のベクトル |
confidence |
選択されたバウンディングボックスに対する分類器の信頼度が更新される float のベクトル |
cv::text::TextDetectorを実装します。
このクラス詳解は次のファイルから抽出されました: