#ifndef MYPCA_H
#define MYPCA_H

#pragma once
#include <iostream>
#include <opencv2/core/core.hpp>
#include <opencv2/highgui/highgui.hpp>
#include <opencv2/opencv.hpp>
#include <fstream>
class myPCA
{
public:
	std::vector<cv::Point3d> deform_norm_4PnP;
	std::vector<double> deform_norm_1d;
	std::vector<float> ref_shape_1d;
	std::vector<double> ref_and_deform_1d;
	cv::Mat ref_and_deform_1d_mat;
	int num_eigenvect = 0;
	int num_featurepnt = 0;
	cv::Mat eigenVectors;
	cv::Mat eigenVectors_sub;
	cv::Mat parameters;
	std::vector<cv::Mat> parameters_vec;
	std::vector<int> parameters_idx;
	cv::Mat LS_res;
	std::vector<cv::Mat> LS_res_vec;

	std::vector<cv::Point3f> deformed_keyPnts; // for reprojection in ROI casting

	myPCA();
	virtual ~myPCA();

	int readfile(std::string PCA_ref_filename, std::string PCA_deform_normal_filename, std::string PCA_eigenvec_filename);

};

#endif

