user1964417
user1964417

Reputation: 1705

How can I assign values to a opencv matrix Mat?

For example, I have a 2by3 matrix [1,0,5;1,0,-5], and a Mat trans_mat( 2, 3, CV_32FC1).

How can I assign those values to the trans_mat matrix?

Upvotes: 0

Views: 1537

Answers (1)

Froyo
Froyo

Reputation: 18477

Mat trans_mat( 2, 3, CV_32FC1);
trans_mat = (Mat_<float>(2, 3) << 1, 0, 5, 1, 0, -5);

Upvotes: 2

Related Questions