简体   繁体   English

OpenCV中3x3矩阵的对数

[英]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 矩阵p是

30 10 40
90 20 60
30 10 40

and matrix q is 矩阵q是

10 40 10
20 60 50
10 40 10

./.. How can i compute log of p and q? ./ ..如何计算p和q的对数?

Log (p) and Log (q) ?

Anyone can help me .. I have to do this in opencv. 任何人都可以帮助我..我必须在opencv中做到这一点。 thanks 谢谢

As @cxyzs pointed out in the comments, there is a log function directly implemented in OpenCV. 正如@cxyzs在评论中指出的那样,在OpenCV中直接实现了一个log功能。 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

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM