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.

  • 相关阅读:
    解决iex -S mix报错
    OTP服务器
    多进程
    字符串与二进制
    IphoneX适配正确姿势
    Babel 配置用法解析
    babel版本变化
    你好,babel
    XSS攻击 && CSRF攻击 基础理解
    小程序开发初体验~
  • 原文地址:https://www.cnblogs.com/ShaneZhang/p/3134655.html
Copyright © 2011-2022 走看看