common.h 1.65 KB
#pragma once

//common
#include <string>
#include <fstream>
#include <iostream>
#include <vector>
#include <ctime>
#include <cstdio>
#include <algorithm>
#include <stdlib.h>
#include <sstream>
#include <iomanip>

//eigen
#include <Eigen/Dense>

//boost
#include <boost/format.hpp>
#include <boost/filesystem.hpp>
#include <boost/thread/thread.hpp>
#include <boost/algorithm/string.hpp>

//opencv
#include <opencv2/core.hpp>
#include <opencv2/highgui.hpp>
#include <opencv2/imgproc.hpp>

//pcl
#include <pcl/point_types.h>
#include <pcl/point_cloud.h>
#include <pcl/io/io.h>
#include <pcl/io/pcd_io.h>
#include <pcl/io/vtk_io.h>
#include <pcl/io/vtk_lib_io.h>
#include <pcl/kdtree/kdtree_flann.h>
#include <pcl/filters/filter.h>
#include <pcl/filters/radius_outlier_removal.h>
#include <pcl/filters/voxel_grid.h>
#include <pcl/features/normal_3d.h>
#include <pcl/surface/mls.h>
#include <pcl/surface/poisson.h>
#include <pcl/surface/marching_cubes_hoppe.h>
#include <pcl/surface/gp3.h>

using namespace boost::filesystem;

struct camInfo
{
    double fx;
    double fy;
    double cx;
    double cy;
    double k1;
    double k2;
    double p1;
    double p2;
    int width;
    int height;
};

void realsenseSetUp(camInfo& cam)
{
    cam.fx = 612.1810302745375;
    cam.fy = 612.27685546875;
    cam.cx = 323.64208984375;
    cam.cy = 234.55838012695312;
    cam.k1 = 0;
    cam.k2 = 0;
    cam.p1 = 0;
    cam.p2 = 0;
    cam.width = 640;
    cam.height = 480;
}

Eigen::Vector3d coordinateRotation(double x, double y, double z)
{
    Eigen::Vector3d coord;
    coord << x, y, z;

    Eigen::Matrix3d rot;
    rot << 1, 0, 0, 0, 0, 1, 0, -1, 0;

    coord = rot * coord;
    return coord;
}