user7857293
user7857293

Reputation: 33

How to change the mat type in openCV

I used mat1.convertTo(mat1, mat2.type())but the type ofmat1and mat2 are not the same. Why is that?

Upvotes: 1

Views: 2361

Answers (1)

Shawn Mathew
Shawn Mathew

Reputation: 2337

Not all functions are in-place. This means that if you are calling the function on mat1, then the destination matrix must be different. So try declaring another matrix and test the function.

mat1.convertTo(mat1_new, mat2.type())

Upvotes: 1

Related Questions