Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion python/bindings.cc
Original file line number Diff line number Diff line change
Expand Up @@ -249,7 +249,9 @@ PYBIND11_MODULE(_libmultisense, m) {
.def_readonly("frame_time", &multisense::ImageFrame::frame_time)
.def_readonly("ptp_frame_time", &multisense::ImageFrame::ptp_frame_time)
.def_readonly("aux_color_encoding", &multisense::ImageFrame::aux_color_encoding)
.def_readonly("stereo_histogram", &multisense::ImageFrame::stereo_histogram);
.def_readonly("stereo_histogram", &multisense::ImageFrame::stereo_histogram)
.def_readonly("capture_exposure_time", &multisense::ImageFrame::capture_exposure_time)
.def_readonly("capture_gain", &multisense::ImageFrame::capture_gain);

// ImuRate
py::class_<multisense::ImuRate>(m, "ImuRate")
Expand Down
12 changes: 8 additions & 4 deletions source/LibMultiSense/details/legacy/channel.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1106,7 +1106,7 @@ void LegacyChannel::image_callback(std::shared_ptr<const std::vector<uint8_t>> d
scale_calibration(select_calibration(cal, source.front()), cal_x_scale, cal_y_scale)};

handle_and_dispatch(std::move(image),
get_histogram(meta->second),
meta->second,
wire_image.frameId,
scale_calibration(cal, cal_x_scale, cal_y_scale),
capture_time_point,
Expand Down Expand Up @@ -1175,7 +1175,7 @@ void LegacyChannel::disparity_callback(std::shared_ptr<const std::vector<uint8_t
scale_calibration(select_calibration(cal, source), cal_x_scale, cal_y_scale)};

handle_and_dispatch(std::move(image),
get_histogram(meta->second),
meta->second,
wire_image.frameId,
scale_calibration(cal, cal_x_scale, cal_y_scale),
capture_time_point,
Expand Down Expand Up @@ -1234,12 +1234,14 @@ void LegacyChannel::imu_callback(std::shared_ptr<const std::vector<uint8_t>> dat
}

void LegacyChannel::handle_and_dispatch(Image image,
ImageHistogram histogram,
const crl::multisense::details::wire::ImageMeta &metadata,
int64_t frame_id,
const StereoCalibration &calibration,
const TimeT &capture_time,
const TimeT &ptp_capture_time)
{
using namespace std::chrono;

//
// Create a new frame if one does not exist, or add the input image to the corresponding frame
//
Expand All @@ -1252,7 +1254,9 @@ void LegacyChannel::handle_and_dispatch(Image image,
capture_time,
ptp_capture_time,
m_calibration.aux ? ColorImageEncoding::YCBCR420 : ColorImageEncoding::NONE,
std::move(histogram)};
get_histogram(metadata),
microseconds{metadata.exposureTime},
metadata.gain};

m_frame_buffer.emplace(frame_id, std::move(frame));
}
Expand Down
10 changes: 10 additions & 0 deletions source/LibMultiSense/include/MultiSense/MultiSenseTypes.hh
Original file line number Diff line number Diff line change
Expand Up @@ -384,6 +384,16 @@ struct ImageFrame
/// @brief Corresponding histogram from the main stereo pair
///
std::optional<ImageHistogram> stereo_histogram = std::nullopt;

///
/// @brief The exposure time which was used to capture this frame
///
std::chrono::microseconds capture_exposure_time{0};

///
/// @brief The gain that was used to capture the stereo images in this frame
///
float capture_gain = 0.0;
};

///
Expand Down
2 changes: 1 addition & 1 deletion source/LibMultiSense/include/details/legacy/channel.hh
Original file line number Diff line number Diff line change
Expand Up @@ -291,7 +291,7 @@ private:
/// @brief Handle internal process, and potentially dispatch a image
///
void handle_and_dispatch(Image image,
ImageHistogram histogram,
const crl::multisense::details::wire::ImageMeta &metadata,
int64_t frame_id,
const StereoCalibration &calibration,
const TimeT &capture_time,
Expand Down