OpenCV 4.5.3(日本語機械翻訳)
|
クラス |
|
struct | cv::text::ERStat |
のクラスはスレッドセーフではありません。ERStat構造体はクラス固有の極小領域(ER)を表す。[【詳解】(英語]
|
|
class | cv::text::ERFilter |
Neumann and Matas のシーンテキスト検出アルゴリズムの第1段階と第2段階のベースクラス[Neumann12].. :[【詳解】(英語]
|
|
class | cv::text::TextDetector |
テキスト検出アルゴリズムのインターフェースを提供する抽象クラス[【詳解】(英語]
|
|
class | cv::text::TextDetectorCNN |
TextDetectorCNNクラスは,テキストのバウンディングボックスを検出する機能を提供します.このクラスは,入力画像に含まれるテキスト単語のバウンディングボックスを検出するためのものです.このクラスは,OpenCV の dnn モジュールを利用して,以下に示す事前学習済みのモデルを読み込みます.[LiaoSBWL17]で推奨されています.. オリジナルのリポジトリにSSD Caffeの修正を加えたものです。https://github.com/MhLiao/TextBoxes. モデルは以下からダウンロードできます。ドロップボックス. モデルの説明を含む修正された.prototxtファイルは、以下の場所にあります。opencv_contrib/modules/text/samples/textbox.prototxt .[【詳解】(英語]
|
|
列挙型 |
|
enum | { ERFILTER_NM_RGBLGrad , ERFILTER_NM_IHSGrad } |
computeNMChannels 操作モード |
|
enum | cv::text::erGrouping_Modes { cv::text::ERGROUPING_ORIENTATION_HORIZ , cv::text::ERGROUPING_ORIENTATION_ANY } |
text::erGroupingの操作モード[【詳解】(英語]
|
|
関数 |
|
CV_EXPORTS_W Ptr< ERFilter > | cv::text::createERFilterNM1 (const Ptr< ERFilter::Callback > &cb, int thresholdDelta=1, float minArea=(float) 0.00025, float maxArea=(float) 0.13, float minProbability=(float) 0.4, bool nonMaxSuppression=true, float minProbabilityDiff=(float) 0.1) |
N&Mアルゴリズムの第一段階の分類器にExtremal Region Filterを作成する。[Neumann12]..[【詳解】(英語]
|
|
CV_EXPORTS_W Ptr< ERFilter > | cv::text::createERFilterNM2 (const Ptr< ERFilter::Callback > &cb, float minProbability=(float) 0.3) |
N&Mアルゴリズムの第2段階分類器のExtremal Region Filterの作成[Neumann12]..[【詳解】(英語]
|
|
CV_EXPORTS_W Ptr< ERFilter > | cv::text::createERFilterNM1 (const String &filename, int thresholdDelta=1, float minArea=(float) 0.00025, float maxArea=(float) 0.13, float minProbability=(float) 0.4, bool nonMaxSuppression=true, float minProbabilityDiff=(float) 0.1) |
N&Mアルゴリズムの第1段階分類器のExtremal Region Filterを指定されたパスから読み込む 例:/path/to/cpp/trained_classifierNM1.xml[【詳解】(英語]
|
|
CV_EXPORTS_W Ptr< ERFilter > | cv::text::createERFilterNM2 (const String &filename, float minProbability=(float) 0.3) |
N&Mアルゴリズムの第2段階の分類器のためのExtremal Region Filterを、指定されたパスから読み込みます(例:/path/to/cpp/trained_classifierNM2.xml[【詳解】(英語]
|
|
CV_EXPORTS_W Ptr< ERFilter::Callback > | cv::text::loadClassifierNM1 (const String &filename) |
を作成する際に,デフォルトの分類器を暗黙的にロードすることを許可します。ERFilterオブジェクトを作成します。[【詳解】(英語]
|
|
CV_EXPORTS_W Ptr< ERFilter::Callback > | cv::text::loadClassifierNM2 (const String &filename) |
を作成する際に,デフォルトの分類器を暗黙的にロードすることを許可します。ERFilterオブジェクトを作成します。[【詳解】(英語]
|
|
CV_EXPORTS_W void | cv::text::computeNMChannels (InputArray _src, CV_OUT OutputArrayOfArrays _channels, int _mode=ERFILTER_NM_RGBLGrad) |
N&Mアルゴリズムで独立して処理される異なるチャンネルを計算する[Neumann12]..[【詳解】(英語]
|
|
CV_EXPORTS void | cv::text::erGrouping (InputArray img, InputArrayOfArrays channels, std::vector< std::vector< ERStat > > ®ions, std::vector< std::vector< Vec2i > > &groups, std::vector< Rect > &groups_rects, int method=ERGROUPING_ORIENTATION_HORIZ, const std::string &filename=std::string(), float minProbablity=0.5) |
テキストブロックとして構成されたExtremal Regionsのグループを検索します。[【詳解】(英語]
|
|
CV_EXPORTS_W void | cv::text::erGrouping (InputArray image, InputArray channel, std::vector< std::vector< Point > > regions, CV_OUT std::vector< Rect > &groups_rects, int method=ERGROUPING_ORIENTATION_HORIZ, const String &filename=String(), float minProbablity=(float) 0.5) |
CV_EXPORTS void | cv::text::MSERsToERStats (InputArray image, std::vector< std::vector< Point > > &contours, std::vector< std::vector< ERStat > > ®ions) |
オブジェクトを出力配列に変換します.MSER輪郭(vector<Point>)からERStatの領域を表します.[【詳解】(英語]
|
|
CV_EXPORTS_W void | cv::text::detectRegions (InputArray image, const Ptr< ERFilter > &er_filter1, const Ptr< ERFilter > &er_filter2, CV_OUT std::vector< std::vector< Point > > ®ions) |
CV_EXPORTS_W void | cv::text::detectRegions (InputArray image, const Ptr< ERFilter > &er_filter1, const Ptr< ERFilter > &er_filter2, CV_OUT std::vector< Rect > &groups_rects, int method=ERGROUPING_ORIENTATION_HORIZ, const String &filename=String(), float minProbability=(float) 0.5) |
画像からテキスト領域を抽出します。[【詳解】(英語]
|
|
The scene text detection algorithm described below has been initially proposed by Lukás Neumann & Jiri Matas [Neumann11]. The main idea behind Class-specific Extremal Regions is similar to the MSER in that suitable Extremal Regions (ERs) are selected from the whole component tree of the image. However, this technique differs from MSER in that selection of suitable ERs is done by a sequential classifier trained for character detection, i.e. dropping the stability requirement of MSERs and selecting class-specific (not necessarily stable) regions.
The component tree of an image is constructed by thresholding by an increasing value step-by-step from 0 to 255 and then linking the obtained connected components from successive levels in a hierarchy by their inclusion relation:
The component tree may contain a huge number of regions even for a very simple image as shown in the previous image. This number can easily reach the order of 1 x 10\^6 regions for an average 1 Megapixel image. In order to efficiently select suitable regions among all the ERs the algorithm make use of a sequential classifier with two differentiated stages.
In the first stage incrementally computable descriptors (area, perimeter, bounding box, and Euler's number) are computed (in O(1)) for each region r and used as features for a classifier which estimates the class-conditional probability p(r|character). Only the ERs which correspond to local maximum of the probability p(r|character) are selected (if their probability is above a global limit p_min and the difference between local maximum and local minimum is greater than a delta_min value).
In the second stage, the ERs that passed the first stage are classified into character and non-character classes using more informative but also more computationally expensive features. (Hole area ratio, convex hull ratio, and the number of outer boundary inflexion points).
This ER filtering process is done in different single-channel projections of the input image in order to increase the character localization recall.
After the ER filtering is done on each input channel, character candidates must be grouped in high-level text blocks (i.e. words, text lines, paragraphs, ...). The opencv_text module implements two different grouping algorithms: the Exhaustive Search algorithm proposed in [Neumann12] for grouping horizontally aligned text, and the method proposed by Lluis Gomez and Dimosthenis Karatzas in [Gomez13] [Gomez14] for grouping arbitrary oriented text (see erGrouping).
To see the text detector at work, have a look at the textdetection demo: https://github.com/opencv/opencv_contrib/blob/master/modules/text/samples/textdetection.cpp
@defgroup text_recognize Scene Text Recognition
text::erGroupingの操作モード
列挙値 | |
---|---|
エルグルーピングの方向性 |
で提案された網羅的探索アルゴリズム[Neumann11]で提案された水平方向に整列したテキストをグループ化するためのものです。このアルゴリズムは、可能な全てのER配列に対する検証関数をモデル化する。ERペアの検証機能は、2つの領域の測定値(高さ比、重心角度、領域距離)を比較する、閾値ベースのペアワイズ・ルールのセットで構成される。ERトリプレットの検証機能は、与えられたトリプレットに対して、Least Median-Squaresフィッティングを用いて、単語テキストの行の推定値を作成し、その推定値が有効であるかどうかを検証する(トレーニング中に作成された閾値に基づいて)。3以上の配列に対する検証関数は、長さ3のすべての(サブ)配列のテキストラインパラメータが一貫していることを検証することで近似されます。 |
グループ化の方向性を指定する |
で提案されているテキストグルーピング手法。[Gomez13]で提案されている [Gomez14]で提案された任意の方向性を持ったテキストをグループ化するための方法です。リージョンは、近接性(x,y座標)と類似性尺度(色、サイズ、グラデーションの大きさ、ストロークの幅など)を組み合わせた重み付き特徴空間において、Single Linkage Clusteringによって凝集されます。SLCは、各ノードがテキストグループの仮説を表すデンドログラムを提供します。そして、アルゴリズムは、回転不変のテキストグループ分類器の出力と、階層型クラスタリングの有効性評価のための確率的尺度を組み合わせた停止ルールを用いて、このデンドログラムをトラバースすることで、テキストグループに対応するブランチを見つけます。
|
CV_EXPORTS_W void cv::text::computeNMChannels | ( | InputArray | _src, |
CV_OUT OutputArrayOfArrays | _channels, | ||
int |
_mode
=
ERFILTER_NM_RGBLGrad |
||
) |
N&Mアルゴリズムで独立して処理される異なるチャンネルを計算する[Neumann12]..
_src | ソース画像.RGB CV_8UC3 である必要があります. |
_channels | 出力ベクトル<Mat> 計算されたチャンネルが格納されます. |
_mode | 動作モード.現在のところ,以下のオプションしかありません.ERFILTER_NM_RGBLGrad**(デフォルトで利用されます)とERFILTER_NM_IHSGrad. |
N&Mアルゴリズムでは、強度(I)、色相(H)、彩度(S)、グラデーション・マグニチュード・チャンネル(Grad)を組み合わせて使用することで、高い定位再現性を得ることができます。この実装では、赤(R)、緑(G)、青(B)、明度(L)、グラデーションの大きさ(Grad)の組み合わせも用意されています。
CV_EXPORTS_W Ptr< ERFilter > cv::text::createERFilterNM1 | ( | const Ptr< ERFilter::Callback > & | cb, |
int |
thresholdDelta
=
1 ,
|
||
float |
minArea
=
(float) 0.00025 ,
|
||
float |
maxArea
=
(float) 0.13 ,
|
||
float |
minProbability
=
(float) 0.4 ,
|
||
bool |
nonMaxSuppression
=
true ,
|
||
float |
minProbabilityDiff
=
(float) 0.1 |
||
) |
N&Mアルゴリズムの第一段階の分類器にExtremal Region Filterを作成する。[Neumann12]..
cb | : 分類器を用いたコールバック。デフォルトの分類器は,例えばsamples/cpp/trained_classifierNM1.xml内のファイルから,関数loadClassifierNM1で暗黙的に読み込むことができます. |
thresholdDelta | : コンポーネントツリーを抽出する際の,後続の閾値のステップ |
minArea | : 抽出されたERに許容される最小面積(画像サイズの%) |
maxArea | : 回収されたERに許容される最大面積(画像サイズに対する割合 |
minProbability | : 再検索されたERに許される最小確率P(er|character) |
nonMaxSuppression | : 枝の確率に最大値以外の抑制がかかる場合 |
minProbabilityDiff | : ローカルマキシマムとローカルミニマムのERの最小確率差 |
画像のコンポーネントツリーは,0から255まで段階的に増加したしきい値によって抽出され,各ERに対して増分計算可能な記述子(aspect_ratio,compactness,number of holes,number of horizontal crossings)が計算され,クラス条件付き確率P(er|character)を推定する分類器の特徴として使用される。P(er|character)の値は、すべてのしきい値にわたるERの包含関係を用いて追跡され、確率P(er|character)の局所的な最大値に対応するERのみが選択される(確率の局所的な最大値がグローバルな限界pmin以上で、局所的な最大値と局所的な最小値の差がminProbabilityDiffより大きい場合)。
CV_EXPORTS_W Ptr< ERFilter > cv::text::createERFilterNM1 | ( | const String & | filename, |
int |
thresholdDelta
=
1 ,
|
||
float |
minArea
=
(float) 0.00025 ,
|
||
float |
maxArea
=
(float) 0.13 ,
|
||
float |
minProbability
=
(float) 0.4 ,
|
||
bool |
nonMaxSuppression
=
true ,
|
||
float |
minProbabilityDiff
=
(float) 0.1 |
||
) |
N&Mアルゴリズムの第1段階分類器のExtremal Region Filterを指定されたパスから読み込む 例:/path/to/cpp/trained_classifierNM1.xml
これはオーバーロードされたメンバ関数です。利便性のために用意されています。元の関数との違いは引き数のみです。
CV_EXPORTS_W Ptr< ERFilter > cv::text::createERFilterNM2 | ( | const Ptr< ERFilter::Callback > & | cb, |
float |
minProbability
=
(float) 0.3 |
||
) |
N&Mアルゴリズムの第2段階分類器のExtremal Region Filterの作成[Neumann12]..
cb | : 分類器のコールバック。デフォルトの分類器は,例えばsamples/cpp/trained_classifierNM2.xml内のファイルから,関数loadClassifierNM2で暗黙的に読み込むことができます. |
minProbability | : 再検索されたERに許される最小確率P(er|character) |
第2段階では,第1段階を通過したERを,より情報量の多い,しかし計算量の多い特徴を用いて,文字クラスと非文字クラスに分類する.この分類器では、第1段階で計算されたすべての特徴に加えて、穴面積比、凸包比、外側の変曲点の数などの特徴を使用する。
CV_EXPORTS_W Ptr< ERFilter > cv::text::createERFilterNM2 | ( | const String & | filename, |
float |
minProbability
=
(float) 0.3 |
||
) |
N&Mアルゴリズムの第2段階の分類器のためのExtremal Region Filterを、指定されたパスから読み込みます(例:/path/to/cpp/trained_classifierNM2.xml
これはオーバーロードされたメンバ関数です。利便性のために用意されています。元の関数との違いは引き数のみです。
CV_EXPORTS_W void cv::text::detectRegions | ( | InputArray | image, |
const Ptr< ERFilter > & | er_filter1, | ||
const Ptr< ERFilter > & | er_filter2, | ||
CV_OUT std::vector< Rect > & | groups_rects, | ||
int |
method
=
ERGROUPING_ORIENTATION_HORIZ ,
|
||
const String & |
filename
=
String() ,
|
||
float |
minProbability
=
(float) 0.5 |
||
) |
画像からテキスト領域を抽出します。
image | テキストブロックを抽出する必要がある元画像.CV_8UC3(カラー)である必要があります. |
er_filter1 | N&Mアルゴリズムの第1段階の分類器に対する極値領域フィルタ[Neumann12]. |
er_filter2 | N&Mアルゴリズムの第2段階分類器のための極値領域フィルタ.[Neumann12]. |
groups_rects | テキストを含む矩形ブロックのリストを出力します. |
method | グループ化方法(text::erGrouping_Modes 参照)。ERGROUPING_ORIENTATION_HORIZ, ERGROUPING_ORIENTATION_ANY のいずれかになります。 |
filename | 分類器モデルを含むXMLまたはYAMLファイル(例:samples/trained_classifier_erGrouping.xml)。グルーピング・メソッドがERGROUPING_ORIENTATION_ANYの場合にのみ使用されます。 |
minProbability | グループを受け入れるための最小確率.グループ化の方法がERGROUPING_ORIENTATION_ANYのときのみ使用します。 |
CV_EXPORTS void cv::text::erGrouping | ( | InputArray | img, |
InputArrayOfArrays | channels, | ||
std::vector< std::vector< ERStat > > & | regions, | ||
std::vector< std::vector< Vec2i > > & | groups, | ||
std::vector< Rect > & | groups_rects, | ||
int |
method
=
ERGROUPING_ORIENTATION_HORIZ ,
|
||
const std::string & |
filename
=
std::string() ,
|
||
float |
minProbablity
=
0.5 |
||
) |
テキストブロックとして構成されたExtremal Regionsのグループを検索します。
img | リージョンが抽出された元のRGBまたはグレースケール画像. |
channels | リージョンが抽出された,シングルチャンネル画像CV_8UC1のベクトル. |
regions | 各チャンネルからアルゴリズムによって取得されたERのベクトルERFilter各チャンネルのアルゴリズムから検索されたERのベクトル. |
groups | アルゴリズムの出力は,提供された領域に対するインデックスのリストのセットとして,このパラメータに格納されます. |
groups_rects | アルゴリズムの出力は、矩形のリストとしてこのパラメータに格納されます。 |
method | グループ化方法(text::erGrouping_Modes 参照)。ERGROUPING_ORIENTATION_HORIZ, ERGROUPING_ORIENTATION_ANY のいずれかになります。 |
filename | 分類器モデルを含むXMLまたはYAMLファイル(例:samples/trained_classifier_erGrouping.xml)。グルーピング・メソッドがERGROUPING_ORIENTATION_ANYの場合にのみ使用されます。 |
minProbablity | グループを受け入れるための最小確率.グループ化の方法がERGROUPING_ORIENTATION_ANYのときのみ使用します。 |
CV_EXPORTS_W Ptr< ERFilter::Callback > cv::text::loadClassifierNM1 | ( | const String & | filename | ) |
を作成する際に,デフォルトの分類器を暗黙的にロードすることを許可します。ERFilterオブジェクトを作成します。
filename | 分類器モデルを含む XML または YAML ファイル(例:trained_classifierNM1.xml). |
へのポインタを返します.ERFilter::Callback.
CV_EXPORTS_W Ptr< ERFilter::Callback > cv::text::loadClassifierNM2 | ( | const String & | filename | ) |
を作成する際に,デフォルトの分類器を暗黙的にロードすることを許可します。ERFilterオブジェクトを作成します。
filename | 分類器モデルを含むXMLまたはYAMLファイル(例:trained_classifierNM2.xml). |
へのポインタを返します.ERFilter::Callback.
CV_EXPORTS void cv::text::MSERsToERStats | ( | InputArray | image, |
std::vector< std::vector< Point > > & | contours, | ||
std::vector< std::vector< ERStat > > & | regions | ||
) |
オブジェクトを出力配列に変換します.MSER輪郭(vector<Point>)からERStatの領域を表します.
image | MSERが抽出されたソース画像 CV_8UC1. |
contours | すべての輪郭(vector<Point>)を含む入力ベクトル. |
regions | リージョンが格納された出力ERStatリージョンが格納される出力. |
これは,OpenCVの特徴検出器によって与えられた輪郭を入力とし,出力として2つのベクトルのMSERを返します.MSER特徴検出器によって与えられた輪郭を入力とし,出力として ERStats の 2 つのベクトルを返します.これは,MSER() の出力が,MSER+ と MSER- の両方の領域を1つの vector<Point> に含むためであり,この関数はそれらを2つの異なるベクトルに分離します(これは,ERStats が2つの異なるチャンネルから抽出されたかのようです).
MSERsToERStats の使用例は,テキスト検出の webcam_demo にあります.https://github.com/opencv/opencv_contrib/blob/master/modules/text/samples/webcam_demo.cpp