Reputation: 12276
I have a pretty basic question.
The below Matlab code takes 2 matrices with same dimensions (matrix1, matrix2)
, and produces a new matrix, result_matrix
, which in each index (i,j)
, it contains sqrt(matrix1[i][j] ^ 2 + matrix2[i][j] ^ 2)
.
How would you convert this simple Matlab code into OpenCV in C++, such that it would be most simple, clear and efficient?
result_matrix = sqrt(matrix1 .^ 2 + matrix2 .^ 2);
Upvotes: 1
Views: 78