zoukankan      html  css  js  c++  java
  • QR & RQ Factorization

    from the documentation (here is a page that shows it though). To use this version, import rq like this:


    from scipy.linalg import rq


    Alternatively, you can use the more common QR factorization and with some modifications write your own RQ function. 


    from scipy.linalg import qr

    def rq(A):
    Q,R = qr(flipud(A).T)
    R = flipud(R.T)
    Q = Q.T
    return R[:,::-1],Q[::-1,:]


    RQ factorization is not unique. The sign of the diagonal elements can vary. In computer vision we need them to be positive to correspond to focal length and other positive parameters. To get a consistent result with positive diagonal you can apply a transform that changes the sign. Try this on a camera matrix like this:


    # factor first 3*3 part of P
    K,R = rq(P[:,:3])

    # make diagonal of K positive
    T = diag(sign(diag(K)))

    K = dot(K,T)
    R = dot(T,R) #T is its own inverse


    The RQ decomposition transforms a matrix A into the product of an upper triangular matrix R (also known as right-triangular) and an orthogonal matrix Q. The only difference from QR decomposition is the order of these matrices.

    QR decomposition is Gram–Schmidt orthogonalization of columns of A, started from the first column.

    RQ decomposition is Gram–Schmidt orthogonalization of rows of A, started from the last row.

  • 相关阅读:
    SQL关于分页的sql查询语句 limit 和row_number() OVER函数
    js的工作原理
    jQuery工作原理
    java servlet的工作原理
    JSP工作原理
    Ajax工作原理
    知识总结
    SQL Server Job 简单使用
    [转]基于fiddler的APP抓包及服务端模拟
    排序算法 python
  • 原文地址:https://www.cnblogs.com/ShaneZhang/p/3134655.html
Copyright © 2011-2022 走看看