1 | initial version |
instead of:
codes.row(i) = code;
which creates a temporary Mat header, you want:
code.copyTo(codes.row(i));
think of it like this: a cv::Mat holds continuous data, you can't simply insert an arbitrary pointer anywhere you like, but need to memcpy the specific region.
then, my compiler chokes on this:
std::cout<<"codes.row= "<<codes.row<<std::endl;
codes.row is a function, you probably meant
std::cout<<"codes.row= "<<codes.row(i) <<std::endl;