53 namespace fs = std::experimental::filesystem;
59 std::string proj_dir = fs::current_path().generic_string();
60 std::string conf_file = proj_dir +
"/../dataset/Dice/WRP/Dice_WRP.xml";
63 if (!Hologram->
readConfig(conf_file.c_str())) {
64 std::cerr <<
"Fail to load Config file : " << conf_file << std::endl;
69 std::string wrp_file = proj_dir +
"/../dataset/Dice/WRP/dice_100000.ply";
71 std::cerr <<
"Fail to load WRP file : " << wrp_file << std::endl;
79 std::string res_path =
"./result/";
80 if (!fs::exists(res_path)) {
81 fs::create_directories(res_path);
85 time_t cur_time = time(
nullptr);
89 localtime_s(&local, &cur_time);
91 localtime_r(&cur_time, &local);
96 sprintf_s(buff,
"%4d%02d%02d-%02d%02d%02d",
97 local.tm_year + 1900, local.tm_mon + 1, local.tm_mday,
98 local.tm_hour, local.tm_min, local.tm_sec);
100 sprintf(buff,
"%4d%02d%02d-%02d%02d%02d",
101 local.tm_year + 1900, local.tm_mon + 1, local.tm_mday,
102 local.tm_hour, local.tm_min, local.tm_sec);
105 std::string ohc_file = res_path +
"wrp_sample_" + std::string(buff) +
".ohc";
106 if (!Hologram->
saveAsOhc(ohc_file.c_str())) {
107 std::cerr <<
"Fail to save OHC file : " << ohc_file << std::endl;
118 std::string bmp_file = res_path +
"wrp_sample_" + std::string(buff) +
".bmp";
119 if (!Hologram->
save(bmp_file.c_str())) {
120 std::cerr <<
"Fail to save BMP file : " << bmp_file << std::endl;
virtual bool readConfig(const char *fname)
load to configuration file.
void normalize(void)
Normalization function to save as image file after hologram creation.
void encoding(unsigned int ENCODE_FLAG)
Encoding Functions.
bool save(const char *fname, uint8_t bitsperpixel=8, uchar *src=nullptr, uint px=0, uint py=0)
Function for saving image files.
virtual int loadPointCloud(const char *pc_file)
load to point cloud data.
virtual bool saveAsOhc(const char *fname)
Function to write OHC file
unsigned long release(void)
Call release() when reference is finished.
void generateHologram(void)
Generate a hologram, main funtion.