Xiaolong
Xiaolong

Reputation: 259

QR decomposition in OpenCV

OpenCV provides SVD decomposition, but I cannot find general QR decomposition in its library. Is there any alternative to achieve this?

Upvotes: 3

Views: 2692

Answers (3)

tomithy
tomithy

Reputation: 11

As someone mentioned 3 years ago, this is an old question (lolz)

But QR decomposition is very much possible in OpenCV. In 3.2 it can be done using cv::decomposeProjectionMatrix, as documented here: http://docs.opencv.org/trunk/d9/d0c/group__calib3d.html#gaaae5a7899faa1ffdf268cd9088940248

Note: I recognize I'm really answering for a specific case of QR decomposition (that on a projection matrix), but that doc page says that this function is based on RQDecomp3x3, which could be used for the generic RQ decomposition.

I'm answering this now as all of the answers that pop up when googling this are wrong in saying that it's not possible.

Upvotes: 1

alrikai
alrikai

Reputation: 4194

This is an old question, but for the sake of completeness (and because google took me here), here's the answer using OpenCV --

OpenCV has the solve() function, which can be invoked with a flag specifying the matrix inversion method to be used. Use the flag DECOMP_QR to perform a QR decomposition.

Upvotes: 3

Daniel Martín
Daniel Martín

Reputation: 7845

You can use a matrix library like Newmat11 http://www.robertnz.net/nm11.htm#qr

Upvotes: 0

Related Questions