d2rgb-common.h
Go to the documentation of this file.
1 // License: Apache 2.0. See LICENSE file in root directory.
2 // Copyright(c) 2020 Intel Corporation. All Rights Reserved.
3 
4 #pragma once
5 
6 #include "../algo-common.h"
7 #include "../../../src/algo/depth-to-rgb-calibration/optimizer.h"
8 #include "scene-data.h"
9 #include "../../../src/algo/depth-to-rgb-calibration/k-to-dsm.h"
10 #include "../../../src/algo/depth-to-rgb-calibration/utils.h"
11 #include "../../../src/algo/depth-to-rgb-calibration/uvmap.h"
12 
13 #include "../../../src/algo/thermal-loop/l500-thermal-loop.h"
14 
15 #include "ac-logger.h"
16 #if ! defined( DISABLE_LOG_TO_STDOUT )
18 #endif
19 
20 
21 #include "../../profiler.h"
22 
23 
26 
28 
29 
30 
32  std::string const & dir,
33  std::string const & yuy,
34  std::string const & yuy_prev,
35  std::string const & yuy_last_successful,
36  std::string const & ir,
37  std::string const & z,
38  camera_params const & camera,
39  memory_profiler * profiler = nullptr
40 )
41 {
42  algo::calib calibration( camera.rgb, camera.extrinsics );
43 
44  std::vector< algo::yuy_t> yuy_last_successful_frame;
45 
46  try
47  {
48  yuy_last_successful_frame
49  = read_image_file< algo::yuy_t >( join( dir, yuy_last_successful ),
50  camera.rgb.width,
51  camera.rgb.height );
52  }
53  catch (...)
54  {
55  yuy_last_successful_frame.clear();
56  };
57 
58  if( profiler )
59  profiler->section( "Preprocessing YUY" );
60  cal.set_yuy_data(
61  read_image_file< algo::yuy_t >( join( dir, yuy ), camera.rgb.width, camera.rgb.height ),
62  read_image_file< algo::yuy_t >( join( dir, yuy_prev ), camera.rgb.width, camera.rgb.height ),
63  std::move(yuy_last_successful_frame),
64  calibration
65  );
66  if( profiler )
67  profiler->section_end();
68 
69  if( profiler )
70  profiler->section( "Preprocessing IR" );
71  cal.set_ir_data(
72  read_image_file< algo::ir_t >( join( dir, ir ), camera.z.width, camera.z.height ),
73  camera.z.width, camera.z.height
74  );
75  if( profiler )
76  profiler->section_end();
77 
78  if( profiler )
79  profiler->section( "Preprocessing DEPTH" );
80  cal.set_z_data(
81  read_image_file< algo::z_t >( join( dir, z ), camera.z.width, camera.z.height ),
82  camera.z, camera.dsm_params, camera.cal_info, camera.cal_regs, camera.z_units
83  );
84  if( profiler )
85  profiler->section_end();
86 }
std::string join(const std::string &base, const std::string &path)
Definition: filesystem.h:113
librealsense::algo::depth_to_rgb_calibration::algo_calibration_info cal_info
Definition: scene-data.h:219
ac_logger LOG_TO_STDOUT
Definition: d2rgb-common.h:17
GLsizei const GLchar *const * string
GLdouble GLdouble z
librealsense::algo::depth_to_rgb_calibration::algo_calibration_registers cal_regs
Definition: scene-data.h:220
librealsense::algo::depth_to_rgb_calibration::rs2_intrinsics_double z
Definition: scene-data.h:217
void set_z_data(std::vector< z_t > &&z_data, rs2_intrinsics_double const &depth_intrinsics, rs2_dsm_params const &dms_params, algo_calibration_info const &cal_info, algo_calibration_registers const &cal_regs, float depth_units)
Definition: optimizer.cpp:455
void set_yuy_data(std::vector< yuy_t > &&yuy_data, std::vector< yuy_t > &&prev_yuy_data, std::vector< yuy_t > &&last_successful_yuy_data, calib const &calibration)
Definition: optimizer.cpp:991
void init_algo(algo::optimizer &cal, std::string const &dir, std::string const &yuy, std::string const &yuy_prev, std::string const &yuy_last_successful, std::string const &ir, std::string const &z, camera_params const &camera, memory_profiler *profiler=nullptr)
Definition: d2rgb-common.h:31
librealsense::algo::depth_to_rgb_calibration::rs2_extrinsics_double extrinsics
Definition: scene-data.h:221
void set_ir_data(std::vector< ir_t > &&ir_data, size_t width, size_t height)
Definition: optimizer.cpp:1081
rs2_dsm_params dsm_params
Definition: scene-data.h:218
librealsense::algo::depth_to_rgb_calibration::rs2_intrinsics_double rgb
Definition: scene-data.h:216
static const textual_icon camera
Definition: model-views.h:219
typename::boost::move_detail::remove_reference< T >::type && move(T &&t) BOOST_NOEXCEPT
std::string to_string(T value)


librealsense2
Author(s): Sergey Dorodnicov , Doron Hirshberg , Mark Horn , Reagan Lopez , Itay Carpis
autogenerated on Mon May 3 2021 02:47:12