OpenCV 4.12.0
開源計算機視覺
載入中...
搜尋中...
無匹配項
cv::dnn::TextDetectionModel 類參考

文字檢測網路基類。 更多...

#include <opencv2/dnn/dnn.hpp>

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
 執行檢測。
 
- 繼承自 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,執行網路並返回輸出 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 ()
 

其他繼承的成員

- 繼承自 cv::dnn::Model 的保護屬性
Ptr< Impl > impl
 

詳細描述

文字檢測網路基類。

建構函式 & 解構函式文件

◆ TextDetectionModel()

cv::dnn::TextDetectionModel::TextDetectionModel ( )
保護

成員函式文件

◆ 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) -> 檢測

這是一個過載的成員函式,為了方便而提供。它與上述函式的不同之處僅在於它接受的引數。

◆ detect() [2/2]

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

執行檢測。

給定輸入 frame,準備網路輸入,執行網路推理,後處理網路輸出並返回結果檢測。

每個結果是四邊形的 4 個點,順序如下

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

使用 cv::getPerspectiveTransform 函式檢索沒有透視變換的影像區域。

注意
如果 DL 模型不支援該型別的輸出,則結果可能來自 detectTextRectangles() 輸出。
引數
[輸入]frame輸入影像
[輸出]檢測具有檢測到的四邊形的陣列(每個結果 4 個點)
[輸出]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) -> 檢測

這是一個過載的成員函式,為了方便而提供。它與上述函式的不同之處僅在於它接受的引數。

◆ detectTextRectangles() [2/2]

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

執行檢測。

給定輸入 frame,準備網路輸入,執行網路推理,後處理網路輸出並返回結果檢測。

每個結果都是旋轉的矩形。

注意
在強透視變換的情況下,結果可能不準確。
引數
[輸入]frame輸入影像
[輸出]檢測具有檢測到的 RotationRect 結果的陣列
[輸出]confidences具有檢測置信度的陣列

該類的文件由以下檔案生成