hconcat은 mat 두개를 좌우로 연결하는 함수이다. opencv core.h에 있는데 document에 설명은 찾을 수 없었다.
[-] Collapse
bool Trans4way(const Mat matSrc, int nStep, Mat& matLeft, Mat& matRight, Mat& matUp, Mat& matDown)
{
int nWidth = matSrc.cols;
int nHeight = matSrc.rows;
matLeft = Mat(matSrc,Rect(nStep,0,nWidth-nStep,nHeight));
matRight = Mat(matSrc,Rect(0,0,nWidth-nStep,nHeight));
matUp = Mat(matSrc,Rect(0,nStep,nWidth,nHeight-nStep));
matDown = Mat(matSrc,Rect(0,0,nWidth,nHeight-nStep));
Mat row = Mat::zeros(Size(nWidth,nStep),CV_8UC1);
Mat col = Mat::zeros(Size(nStep,nHeight),CV_8UC1);
hconcat(matLeft,col,matLeft);
hconcat(col,matRight,matRight);
vconcat(matUp,row,matUp);
vconcat(row,matDown,matDown);
return true;
}
{
int nWidth = matSrc.cols;
int nHeight = matSrc.rows;
matLeft = Mat(matSrc,Rect(nStep,0,nWidth-nStep,nHeight));
matRight = Mat(matSrc,Rect(0,0,nWidth-nStep,nHeight));
matUp = Mat(matSrc,Rect(0,nStep,nWidth,nHeight-nStep));
matDown = Mat(matSrc,Rect(0,0,nWidth,nHeight-nStep));
Mat row = Mat::zeros(Size(nWidth,nStep),CV_8UC1);
Mat col = Mat::zeros(Size(nStep,nHeight),CV_8UC1);
hconcat(matLeft,col,matLeft);
hconcat(col,matRight,matRight);
vconcat(matUp,row,matUp);
vconcat(row,matDown,matDown);
return true;
}
댓글 없음:
댓글 쓰기