[opencv] Mat Depth
- Library / opencv
- 2021. 1. 26.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
double m[3][3] = {{a, b, c}, {d, e, f}, {g, h, i}}; | |
Mat M = Mat(3, 3, CV_64F, m).inv(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
C++: int Mat::depth() const | |
The method returns the identifier of the matrix element depth (the type of each individual channel). For example, for a 16-bit signed 3-channel array, the method returns CV_16S . A complete list of matrix types contains the following values: | |
CV_8U - 8-bit unsigned integers ( 0..255 ) | |
CV_8S - 8-bit signed integers ( -128..127 ) | |
CV_16U - 16-bit unsigned integers ( 0..65535 ) | |
CV_16S - 16-bit signed integers ( -32768..32767 ) | |
CV_32S - 32-bit signed integers ( -2147483648..2147483647 ) | |
CV_32F - 32-bit floating-point numbers ( -FLT_MAX..FLT_MAX, INF, NAN ) | |
CV_64F - 64-bit floating-point numbers ( -DBL_MAX..DBL_MAX, INF, NAN ) |
파라미터 정보는 참고하여 항상 생성하도록 하자.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
double dml1[3] = { 0, 340, 0 }; | |
double dmr2[3] = { 640, 330, 0 }; | |
Mat Lm = Mat(3,1,CV_64F, dml1); | |
Mat Rm = Mat(3,1,CV_64F, dmr2); | |
// method | |
//const double *data = Lm.ptr<double>(0); | |
Point2f tLRpt[2]; | |
tLRpt[0].x = Lm.at<double>(0,0); | |
tLRpt[0] = Point2f( Lm.at<double>(0,0), Lm.at<double>(1,0) ); | |
tLRpt[1] = Point2f( Rm.at<double>(0,0), Rm.at<double>(1,0) ); | |
Mat m1 = H * Lm; | |
Mat m2 = H * Rm; |
'Library > opencv' 카테고리의 다른 글
Setting the develop environment (0) | 2021.01.26 |
---|---|
How to set up opencv using various versions of the openCV library in Visual Studio (2) | 2021.01.26 |
OpenCV 3.2.0 build with CUDA 8.0, TBB, extraModule (0) | 2021.01.26 |
[OpenCV] Blending (2) | 2014.04.22 |
openCV ROI 영역에 관해 (0) | 2013.11.13 |