How to get the Projection ProjectionMatrixFromCameraIntrinsics

25 篇文章 0 订阅


ProjectionMatrixForCameraIntrinsics(float width, float height, float fx, float fy,float cx, float cy,  float near, float far) {
  const float xscale = near / fx;
  const float yscale = near / fy;

  const float xoffset = (cx - (width / 2.0)) * xscale;

  const float yoffset = -(cy - (height / 2.0)) * yscale;

  return glm::frustum(xscale * -width / 2.0f - xoffset,
                      xscale * width / 2.0f - xoffset,
                      yscale * -height / 2.0f - yoffset,
                      yscale * height / 2.0f - yoffset, near, far);
}

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
Locality Preserving Projection (LPP) is a dimensionality reduction technique that aims to preserve the local structure of the data. It uses the covariance matrix of the data to achieve this goal. Here are the steps to use covariance in LPP: 1. Compute the covariance matrix of the data. The covariance matrix is a matrix that quantifies the relationship between the different variables in the data. It can be computed using the formula: Covariance matrix = (1/n) * ((X - μ) * (X - μ)T) where X is the data matrix, μ is the mean of the data, and n is the number of data points. 2. Compute the affinity matrix. The affinity matrix is a matrix that quantifies the similarity between different data points. It can be computed using the formula: Affinity matrix = exp(-||xi - xj||^2 / σ^2) where xi and xj are two data points, ||.|| is the Euclidean distance between them, and σ is a parameter that controls the scale of the affinity matrix. 3. Compute the graph Laplacian. The graph Laplacian is a matrix that measures the smoothness of the data on the graph defined by the affinity matrix. It can be computed using the formula: Graph Laplacian = D - W where D is a diagonal matrix with the degree of each node on the diagonal, and W is the affinity matrix. 4. Compute the eigenvectors of the graph Laplacian. The eigenvectors of the graph Laplacian represent the new coordinates of the data in the reduced-dimensional space. 5. Select the k eigenvectors corresponding to the k smallest eigenvalues. These eigenvectors represent the k-dimensional subspace that preserves the local structure of the data. 6. Project the data onto the k-dimensional subspace. The projected data is obtained by multiplying the data matrix with the selected eigenvectors. In summary, covariance is used in LPP to compute the affinity matrix, which is then used to compute the graph Laplacian. The eigenvectors of the graph Laplacian are used to project the data onto a lower-dimensional subspace that preserves the local structure of the data.
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值