Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

"Is there a more succinct way ?"

yes. use the template version of cv::Mat, it has an overloaded "," operator, that lets you write it like this::

cv::Mat_<double> P(3,4); // rows, cols
P << 0, inputImage.cols, inputImage.cols, 0;
     0, 0, inputImage.rows, inputImage.rows;
     1, 1, 1, 1;

"Is there a more succinct way ?"

yes. use the template version of cv::Mat, it has an overloaded ","and "<<" operator, that operators, which lets you write it like this::

cv::Mat_<double> P(3,4); // rows, cols
P << 0, inputImage.cols, inputImage.cols, 0;
     0, 0, inputImage.rows, inputImage.rows;
     1, 1, 1, 1;

"Is there a more succinct way ?"

yes. use the template version of cv::Mat, it has overloaded ","and "<<" operators, which lets you write it like this::

cv::Mat_<double> P(3,4); // rows, cols
P << 0, inputImage.cols, inputImage.cols, 0;
0,
     0, 0, inputImage.rows, inputImage.rows;
inputImage.rows,
     1, 1, 1, 1;