I have this method:
//codeSize previously defined
void generateRow(cv::Mat1f &row){
if(row.cols != codeSize || !code.isContinous() || row.rows!=1)
return;
//fill row somehow
}
And I want to call it like this:
cv::Mat1f mat(rows,cols);
for(size_t i=0; i<rows; i++)
generateRow(mat.row(i));
But I get this error message:
../EncoderManager.cpp:100:37: error: invalid initialization of non-const reference of type ‘cv::Mat1f& {aka cv::Mat_<float>&}’ from an rvalue of type ‘cv::Mat_<float>’
How can I solve this?