| | #ifndef NONRIGIDREG_SPARE_H |
| | #define NONRIGIDREG_SPARE_H |
| |
|
| | #include "nodeSampler.h" |
| | #include "registration.h" |
| |
|
| |
|
| |
|
| |
|
| | #ifdef USE_PARDISO |
| | #include <Eigen/PardisoSupport> |
| | #endif |
| |
|
| |
|
| | class NonrigidSpareRegistration : public Registration { |
| | public: |
| | NonrigidSpareRegistration(); |
| | ~NonrigidSpareRegistration(); |
| |
|
| | |
| | spare::Parameters pars_; |
| |
|
| | |
| | VectorX weight_d_; |
| | RowMajorSparseMatrix mat_A0_; |
| | VectorX vec_b_; |
| |
|
| | |
| | Scalar nu; |
| |
|
| | #ifdef USE_PARDISO |
| | Eigen::PardisoLDLT<RowMajorSparseMatrix, Eigen::Lower> solver_; |
| | #else |
| | Eigen::SimplicialLDLT<RowMajorSparseMatrix, Eigen::Lower> solver_; |
| | #endif |
| |
|
| | |
| | int num_sample_nodes; |
| | int num_graph_edges; |
| | int num_edges; |
| |
|
| | |
| | svr::nodeSampler src_sample_nodes; |
| |
|
| | |
| | VectorX X_; |
| |
|
| | |
| | VectorX nodes_P_; |
| | RowMajorSparseMatrix align_coeff_PV0_; |
| |
|
| | |
| | RowMajorSparseMatrix reg_coeff_B_; |
| | VectorX reg_right_D_; |
| | VectorX reg_cwise_weights_; |
| |
|
| | |
| | RowMajorSparseMatrix landmark_mul_; |
| | VectorX tar_landmarks_; |
| | VectorX landmark_right_; |
| | RowMajorSparseMatrix landmark_mul_fine_; |
| | VectorX landmark_right_fine_; |
| | |
| | VectorX nodes_R_; |
| | RowMajorSparseMatrix rigid_coeff_L_; |
| | RowMajorSparseMatrix rigid_coeff_J_; |
| | VectorX diff_UP_; |
| |
|
| | |
| | VectorX arap_laplace_weights_; |
| | Matrix3X local_rotations_; |
| | RowMajorSparseMatrix arap_coeff_; |
| | RowMajorSparseMatrix arap_coeff_mul_; |
| | VectorX arap_right_; |
| |
|
| | |
| | RowMajorSparseMatrix arap_coeff_fine_; |
| | RowMajorSparseMatrix arap_coeff_mul_fine_; |
| | VectorX arap_right_fine_; |
| |
|
| | |
| | RowMajorSparseMatrix normals_sum_; |
| |
|
| | |
| | std::vector<size_t> sampling_indices_; |
| | std::vector<int> vertex_sample_indices_; |
| | std::vector<int> vertex_landmark_indices_; |
| | |
| | Eigen::MatrixXi src_knn_indices_; |
| |
|
| | int align_sampling_num_ = 3000; |
| |
|
| | |
| | Scalar w_align; |
| | Scalar w_smo; |
| | Scalar optimize_w_align; |
| | Scalar optimize_w_smo; |
| | Scalar optimize_w_rot; |
| | Scalar optimize_w_arap; |
| | Scalar optimize_w_landmark; |
| | |
| | void Initialize(); |
| | void InitFromInput(Mesh& src_mesh, Mesh& tar_mesh, spare::Parameters& paras); |
| | virtual Scalar DoNonRigid(); |
| |
|
| | |
| | |
| | void InitWelschParam(); |
| | void InitwithLandmark(); |
| |
|
| | |
| | void CalcNodeRotations(); |
| | void InitRotations(); |
| | void CalcLocalRotations(bool isCoarseAlign); |
| |
|
| | |
| | void FullInARAPCoeff(); |
| | void CalcARAPRight(); |
| | void CalcARAPRightFine(); |
| | |
| | void CalcDeformedNormals(); |
| | void InitNormalsSum(); |
| | void CalcNormalsSum(); |
| | void CalcLandmarkCoeff(); |
| | |
| | void PointwiseFineReg(Scalar nu1); |
| | void GraphCoarseReg(Scalar nu1); |
| | void Paras_init(int iters = 30 ,double stopcoarse=1e-3,double stopfine=1e-4,bool uselandmark = false,std::vector<int> src=std::vector<int>(),std::vector<int> tar=std::vector<int>()); |
| | |
| | void Register()override; |
| | void Reg(const std::string& file_target, |
| | const std::string& file_source, |
| | const std::string& out_path)override; |
| | std::string landmark_file; |
| | spare::Parameters paras; |
| | bool normalize = true; |
| |
|
| | }; |
| |
|
| |
|
| |
|
| | #endif |
| |
|