Alex Rivera | Logout

OpenCV/C++: Copying a row/column in a Mat to another?

Asked 2011-07-12T20:37:56.653
22

I know I can do this by copying each element myself, but is there a method that does it for me? I tried mat2.copyTo(mat1.row(0)) but that doesn't work.

Edit
Report

1 Answer

9

Try

destMat.row(i) = (sourceMat.row(i) + 0);

It's not very pretty but it gets the job done. Also see this. Read the comments on Mat::row

answered 2011-07-22T02:23:09.750

Your Answer