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

ContourFitting 演算法類。ContourFitting 匹配兩個輪廓 \( z_a \) 和 \( z_b \) 並最小化距離。更多...

#include <opencv2/ximgproc/fourier_descriptors.hpp>

cv::ximgproc::ContourFitting 的協作圖

公共成員函式

 ContourFitting (int ctr=1024, int fd=16)
 使用傅立葉描述子擬合兩條閉合曲線。更多細節請參見 [223][26]
 
void estimateTransformation (InputArray src, InputArray dst, OutputArray alphaPhiST, double &dist, bool fdContour=false)
 使用傅立葉描述子擬合兩條閉合曲線。更多細節請參見 [223][26]
 
void estimateTransformation (InputArray src, InputArray dst, OutputArray alphaPhiST, double *dist=0, bool fdContour=false)
 使用傅立葉描述子擬合兩條閉合曲線。更多細節請參見 [223][26]
 
int getCtrSize ()
 
int getFDSize ()
 
void setCtrSize (int n)
 設定 estimateTransformation 中使用的傅立葉描述子的數量
 
void setFDSize (int n)
 當 estimateTransformation 使用 vector<Point> 時,設定傅立葉描述子的數量
 
- 從 cv::Algorithm 繼承的公共成員函式
 Algorithm ()
 
virtual ~Algorithm ()
 
virtual void clear ()
 清除演算法狀態。
 
virtual bool empty () const
 如果 Algorithm 為空(例如,在最開始或在不成功的讀取之後),則返回 true。
 
virtual String getDefaultName () const
 
virtual void read (const FileNode &fn)
 從檔案儲存中讀取演算法引數。
 
virtual void save (const String &filename) const
 
void write (const Ptr< FileStorage > &fs, const String &name=String()) const
 
virtual void write (FileStorage &fs) const
 將演算法引數儲存到檔案儲存中。
 
void write (FileStorage &fs, const String &name) const
 

其他繼承的成員

- 從 cv::Algorithm 繼承的靜態公共成員函式
template<typename _Tp >
static Ptr< _Tpload (const String &filename, const String &objname=String())
 從檔案中載入演算法。
 
template<typename _Tp >
static Ptr< _TploadFromString (const String &strModel, const String &objname=String())
 從字串載入演算法。
 
template<typename _Tp >
static Ptr< _Tpread (const FileNode &fn)
 從檔案節點讀取演算法。
 
- 從 cv::Algorithm 繼承的保護成員函式
void writeFormat (FileStorage &fs) const
 

詳細描述

ContourFitting 演算法類。ContourFitting 匹配兩個輪廓 \( z_a \) 和 \( z_b \) 並最小化距離。

\[ d(z_a,z_b)=\sum (a_n - s b_n e^{j(n \alpha +\phi )})^2 \]

其中 \( a_n \) 和 \( b_n \) 是 \( z_a \) 和 \( z_b \) 的傅立葉描述子,s 是縮放因子,\( \phi \) 是旋轉角度,\( \alpha \) 是起點因子調整

建構函式 & 解構函式文件

◆ ContourFitting()

cv::ximgproc::ContourFitting::ContourFitting ( int ctr = 1024,
int fd = 16 )
inline

使用傅立葉描述子擬合兩條閉合曲線。更多細節請參見 [223][26]

引數
ctr傅立葉描述子的數量,等於重取樣後輪廓點的數量。
fd定義第二個形狀(目標)的輪廓。

成員函式文件

◆ estimateTransformation() [1/2]

void cv::ximgproc::ContourFitting::estimateTransformation ( InputArray src,
InputArray dst,
OutputArray alphaPhiST,
double & dist,
bool fdContour = false )
Python
cv.ximgproc.ContourFitting.estimateTransformation(src, dst[, alphaPhiST[, fdContour]]) -> alphaPhiST, dist

使用傅立葉描述子擬合兩條閉合曲線。更多細節請參見 [223][26]

引數
src定義第一個形狀的輪廓。
dst定義第二個形狀(目標)的輪廓。
alphaPhiST:\( \alpha \)=alphaPhiST(0,0), \( \phi \)=alphaPhiST(0,1)(弧度),s=alphaPhiST(0,2),Tx=alphaPhiST(0,3),Ty=alphaPhiST(0,4) 旋轉中心
dist匹配後 src 和 dst 之間的距離。
fdContourfalse 則 src 和 dst 是輪廓,true 則 src 和 dst 是傅立葉描述子。

◆ estimateTransformation() [2/2]

void cv::ximgproc::ContourFitting::estimateTransformation ( InputArray src,
InputArray dst,
OutputArray alphaPhiST,
如果傳入NULL,則假定尺度引數c為1.0。否則,指向的變數將被設定為最優尺度。 dist = 0,
bool fdContour = false )
Python
cv.ximgproc.ContourFitting.estimateTransformation(src, dst[, alphaPhiST[, fdContour]]) -> alphaPhiST, dist

使用傅立葉描述子擬合兩條閉合曲線。更多細節請參見 [223][26]

引數
src定義第一個形狀的輪廓。
dst定義第二個形狀(目標)的輪廓。
alphaPhiST:\( \alpha \)=alphaPhiST(0,0), \( \phi \)=alphaPhiST(0,1)(弧度),s=alphaPhiST(0,2),Tx=alphaPhiST(0,3),Ty=alphaPhiST(0,4) 旋轉中心
dist匹配後 src 和 dst 之間的距離。
fdContourfalse 則 src 和 dst 是輪廓,true 則 src 和 dst 是傅立葉描述子。

◆ getCtrSize()

int cv::ximgproc::ContourFitting::getCtrSize ( )
inline
Python
cv.ximgproc.ContourFitting.getCtrSize() -> retval
返回
傅立葉描述子的數量

◆ getFDSize()

int cv::ximgproc::ContourFitting::getFDSize ( )
inline
Python
cv.ximgproc.ContourFitting.getFDSize() -> retval
返回
用於最佳曲線匹配的傅立葉描述子的數量

◆ setCtrSize()

void cv::ximgproc::ContourFitting::setCtrSize ( int n)
Python
cv.ximgproc.ContourFitting.setCtrSize(n) ->

設定 estimateTransformation 中使用的傅立葉描述子的數量

引數
n傅立葉描述子的數量,等於重取樣後輪廓點的數量。

◆ setFDSize()

void cv::ximgproc::ContourFitting::setFDSize ( int n)
Python
cv.ximgproc.ContourFitting.setFDSize(n) ->

當 estimateTransformation 使用 vector<Point> 時,設定傅立葉描述子的數量

引數
n用於最佳曲線匹配的傅立葉描述子的數量。

此類文件由以下檔案生成