MrNeRF / gaussian-splatting-cuda

3D Gaussian Splatting, reimagined: Unleashing unmatched speed with C++ and CUDA from the ground up!
Other
909 stars 74 forks source link

is this an error when transfer from eigen matrix to torch? #56

Open zmxiaoj opened 7 months ago

zmxiaoj commented 7 months ago

Eigen::Matrix4f getWorld2View2Eigen(const Eigen::Matrix3f& R, const Eigen::Vector3f& t, const Eigen::Vector3f& translate /= Eigen::Vector3d::Zero()/, float scale /= 1.0/) { Eigen::Matrix4f Rt = Eigen::Matrix4f::Zero(); Rt.block<3, 3>(0, 0) = R.transpose(); Rt.block<3, 1>(0, 3) = t; Rt(3, 3) = 1.0;

Eigen::Matrix4f C2W = Rt.inverse();
Eigen::Vector3f cam_center = C2W.block<3, 1>(0, 3);
cam_center = (cam_center + translate) * scale;
C2W.block<3, 1>(0, 3) = cam_center;
Rt = C2W.inverse();
return Rt;

}

eigen matrix is stored column major by default