[OpenCV/cpp] Mat의 at함수
프로그래밍/그 외2018. 4. 19. 22:17
출처 : https://docs.opencv.org/trunk/d3/d63/classcv_1_1Mat.html
_Tp& cv::Mat::at(int i0 = 0
)
Returns a reference to the specified array element.
The template methods return a reference to the specified array element. For the sake of higher performance, the index range checks are only performed in the Debug configuration.
Note that the variants with a single index (i) can be used to access elements of single-row or single-column 2-dimensional arrays. That is, if, for example, A is a 1 x N floating-point matrix and B is an M x 1 integer matrix, you can simply write A.at<float>(k+4)
and B.at<int>(2*i+1)
instead of A.at<float>(0,k+4)
and B.at<int>(2*i+1,0)
, respectively.
- If matrix is of type
CV_8U
then useMat.at<uchar>(y,x)
. - If matrix is of type
CV_8S
then useMat.at<schar>(y,x)
. - If matrix is of type
CV_16U
then useMat.at<ushort>(y,x)
. - If matrix is of type
CV_16S
then useMat.at<short>(y,x)
. - If matrix is of type
CV_32S
then useMat.at<int>(y,x)
. - If matrix is of type
CV_32F
then useMat.at<float>(y,x)
. - If matrix is of type
CV_64F
then useMat.at<double>(y,x)
.
댓글 영역