차근차근/C

zero array

예쁜꽃이피었으면 2015. 2. 27. 16:14


검색어 :zero array , zeros()


Mat::zeros

Returns a zero array of the specified size and type.

C++: static MatExpr Mat::zeros(int rows, int cols, int type)
C++: static MatExpr Mat::zeros(Size size, int type)
C++: static MatExpr Mat::zeros(int ndims, const int* sz, int type)
Parameters:
  • ndims – Array dimensionality.
  • rows – Number of rows.
  • cols – Number of columns.
  • size – Alternative to the matrix size specification Size(cols, rows) .
  • sz – Array of integers specifying the array shape.
  • type – Created matrix type.

The method returns a Matlab-style zero array initializer. It can be used to quickly form a constant array as a function parameter, part of a matrix expression, or as a matrix initializer.

Mat A;
A = Mat::zeros(3, 3, CV_32F);

In the example above, a new matrix is allocated only if A is not a 3x3 floating-point matrix. Otherwise, the existing matrix A is filled with zeros.


소스를 보던 중 나온 함수.

지정된 크기와 종류의 제로 배열을 돌려준다고 한다.


친절하게 알려줘도 이해 못해서 찾아봤다.


Size가 0인 배열은 도대체 무엇에 쓰이는 물건인가? 

http://www.devpia.com/MAEUL/Contents/Detail.aspx?BoardID=51&MAEULNO=20&no=7804



[Matlab / 매트랩] 강의 2번째

http://engi-agora.tistory.com/5


반응형