Abc
Abc

Reputation: 824

Logarithm of 3x3 matrix in opencv

I have a matrix like this.

A = 
30 10 40 10 50
90 20 60 50 40
30 10 40 10 50
90 20 60 50 40
30 10 40 10 50

and matrix p is

30 10 40
90 20 60
30 10 40

and matrix q is

10 40 10
20 60 50
10 40 10

./.. How can i compute log of p and q?

Log (p) and Log (q) ?

Anyone can help me .. I have to do this in opencv. thanks

Upvotes: 0

Views: 2181

Answers (1)

Sunreef
Sunreef

Reputation: 4542

As @cxyzs pointed out in the comments, there is a log function directly implemented in OpenCV. You can find it here in the documentation.

Here is a small example of how to use it:

cv::Mat p, q;  // Your original matrices

cv::Mat logP, logQ;
cv::log(p, logP);
cv::log(q, logQ);

// Now logP and logQ contain the logarithms of the values in p and q

Upvotes: 1

Related Questions