ifm / ifm3d

Library and Utilities for working with ifm pmd-based 3D ToF Cameras
https://api.ifm3d.com
Apache License 2.0
106 stars 69 forks source link

Wrong inverse intrinsics from O3D305 with ifm3d 1.4.1, C++ #420

Closed REB427 closed 9 months ago

REB427 commented 10 months ago

Hi,

with the following code I get strage inverse intrinsics from O3D305 camera
const auto& buffer = img->GetBuffer(ifm3d::buffer_id::INVERSE_INTRINSIC_CALIBRATION);
int width = buffer.width();
int height = buffer.height();
std::vector<double> intr(width*height/sizeof(double), 0.0);
std::memcpy(intr.data(), buffer.ptr(0), width*height);

result:

did you change something compared to older versions < 1.0 of ifm3d or am I doing something wrong? Thanks

lola-masson commented 10 months ago

Hi @REB427,

What firmware version are you using on your O3D305?

BigBoot commented 10 months ago

Hi @REB427,

with the new version all intrinsic values are exposed instead of just the translations and rotations. You should be able to access the values using the deserialize module like this:

#include <ifm3d/deserialize/deserialize_o3d_buffers.hpp>

auto inv_intrinsics = ifm3d::O3DInstrinsicCalibration::Deserialize(buffer);

float trans_x = inv_intrinsics[ifm3d::intrinsic_param::TRANS_X];
float trans_y = inv_intrinsics[ifm3d::intrinsic_param::TRANS_Y];
float trans_z = inv_intrinsics[ifm3d::intrinsic_param::TRANS_Z];
float rot_x = inv_intrinsics[ifm3d::intrinsic_param::ROT_X];
float rot_y = inv_intrinsics[ifm3d::intrinsic_param::ROT_Y];
float rot_z = inv_intrinsics[ifm3d::intrinsic_param::ROT_Z];
REB427 commented 10 months ago

That solved the problem, thanks. Also figured out that my code from above is working when changing double to float.