本文整理汇总了C++中cv::Mat::it方法的典型用法代码示例。如果您正苦于以下问题:C++ Mat::it方法的具体用法?C++ Mat::it怎么用?C++ Mat::it使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类cv::Mat
的用法示例。
在下文中一共展示了Mat::it方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: isWithinTri
//=============================================================================
int isWithinTri(double x,double y,cv::Mat &tri,cv::Mat &shape)
{
int i,j,k,t,n = tri.rows,p = shape.rows/2;
double s11,s12,s21,s22,s31,s32;
for(t = 0; t < n; t++) {
i = tri.it(t,0);
j = tri.it(t,1);
k = tri.it(t,2);
s11 = shape.db(i ,0);
s21 = shape.db(j ,0);
s31 = shape.db(k ,0);
s12 = shape.db(i+p,0);
s22 = shape.db(j+p,0);
s32 = shape.db(k+p,0);
if(sameSide(x,y,s11,s12,s21,s22,s31,s32) &&
sameSide(x,y,s21,s22,s11,s12,s31,s32) &&
sameSide(x,y,s31,s32,s11,s12,s21,s22))return t;
}
return -1;
}
示例2: CalcSimT
bool
DetectorNCC::response(cv::Mat & im, cv::Mat & sh,
cv::Size wSize,
cv::Mat& visi)
{
cv::Mat simTransfMat;
CalcSimT(_refs, sh, simTransfMat);
int n = sh.rows/2;
cv::Mat shape = sh.reshape(0,2);
prob_.resize(n);
wmem_.resize(n);
pmem_.resize(n);
#ifdef _OPENMP
#pragma omp parallel for
#endif
for(int i=0; i<n; i++){
if(visi.it(i,0) ==0) continue;
int w = wSize.width + _patch[i]._w - 1;
int h = wSize.height + _patch[i]._h - 1;
simTransfMat.rl(0,2) = shape.rl(0,i);
simTransfMat.rl(1,2) = shape.rl(1,i);
if((w>wmem_[i].cols) || (h>wmem_[i].rows))
wmem_[i].create(h,nextMultipleOf4(w),CV_32F);
cv::Mat wimg = wmem_[i](cv::Rect(0,0,w,h));
CvMat wimg_o = wimg,sim_o = simTransfMat; IplImage im_o = im;
cvGetQuadrangleSubPix(&im_o,&wimg_o,&sim_o);
if(wSize.height > pmem_[i].rows)
pmem_[i].create(wSize.height, nextMultipleOf4(wSize.width), CV_REAL);
prob_[i] = pmem_[i](cv::Rect(cv::Point(0,0),wSize));
_patch[i].Response(wimg,prob_[i]);
}
return true;
}