18 if (
it->unique_id ==
info.unique_id)
52 << std::hex <<
info.pid <<
":" <<
info.vid << std::dec <<
" is not supported.");
69 std::vector<platform::uvc_device_info> results;
73 case ds_caps::CAP_FISHEYE_SENSOR:
74 std::copy_if(
devices.begin(),
devices.end(), std::back_inserter(results),
77 return d400_fisheye_pid.find(info.pid) != d400_fisheye_pid.end();
82 <<
"Capability filters are not implemented for val "
83 << std::hex << caps << std::dec);
92 throw std::runtime_error(
"Firmware binary image might be corrupted - size is only: "
109 case d400_calibration_table_id::coefficients_table_id:
113 case d400_calibration_table_id::fisheye_calibration_id:
117 case d400_calibration_table_id::rgb_calibration_id:
128 auto table = check_calib<ds::d400_coefficients_table>(raw_data);
130 #define intrinsics_string(res) #res << "\t" << array2str((float_4&)table->rect_params[res]) << endl
133 <<
"baseline = " <<
table->baseline <<
" mm" << endl
134 <<
"Rect params: \t fX\t\t fY\t\t ppX\t\t ppY \n"
146 #undef intrinsics_string
162 auto rect_params =
static_cast<const float4>(
table->rect_params[resolution]);
164 if ((rect_params.x == rect_params.y) && (rect_params.z == rect_params.w))
166 rect_params.
x = rect_params.y =
intrinsics.width * 1.5f;
194 auto rect_params =
static_cast<const float4>(
table->rect_params[resolution]);
196 if ((rect_params.x == rect_params.y) && (rect_params.z == rect_params.w))
198 rect_params.
x = rect_params.y =
intrinsics.width * 1.5f;
228 auto table = check_calib<d400_rgb_calibration_table>(raw_data);
231 float trans_scale = -0.001f;
233 trans_vector.
x *= trans_scale;
234 trans_vector.
y *= trans_scale;
235 trans_vector.
z *= trans_scale;
237 return{ rect_rot_mat,trans_vector };
242 auto table = check_calib<ds::d400_rgb_calibration_table>(raw_data);
246 float calib_aspect_ratio = 9.f / 16.f;
248 if (
table->calib_width &&
table->calib_height)
249 calib_aspect_ratio = float(
table->calib_height) / float(
table->calib_width);
252 LOG_WARNING(
"RGB Calibration resolution is not specified, using default 16/9 Aspect ratio");
257 if (actual_aspect_ratio < calib_aspect_ratio)
259 intrin(1, 1) *= calib_aspect_ratio / actual_aspect_ratio;
260 intrin(2, 1) *= calib_aspect_ratio / actual_aspect_ratio;
264 intrin(0, 0) *= actual_aspect_ratio / calib_aspect_ratio;
265 intrin(2, 0) *= actual_aspect_ratio / calib_aspect_ratio;
270 static_cast<int>(
width),
278 std::memcpy(calc_intrinsic.coeffs,
table->distortion,
sizeof(
table->distortion));
285 << std::setprecision(3) <<
intrin(0, 0) <<
", " <<
intrin(1, 1)
286 <<
". Fx,Fy = " << calc_intrinsic.
fx <<
"," << calc_intrinsic.fy);
287 ref = calc_intrinsic;
290 return calc_intrinsic;
302 auto&& item = items[
i];