Skip to content

Commit

Permalink
Merge pull request #1168 from luxonis/release_v2.29.0
Browse files Browse the repository at this point in the history
Release v2.29.0
  • Loading branch information
moratom authored Nov 22, 2024
2 parents 0834ccb + 68fe9be commit d6a37a5
Show file tree
Hide file tree
Showing 13 changed files with 335 additions and 8 deletions.
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ if(WIN32)
endif()

# Create depthai project
project(depthai VERSION "2.28.0" LANGUAGES CXX C)
project(depthai VERSION "2.29.0" LANGUAGES CXX C)
get_directory_property(has_parent PARENT_DIRECTORY)
if(has_parent)
set(DEPTHAI_VERSION ${PROJECT_VERSION} PARENT_SCOPE)
Expand Down
2 changes: 1 addition & 1 deletion cmake/Depthai/DepthaiDeviceSideConfig.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
set(DEPTHAI_DEVICE_SIDE_MATURITY "snapshot")

# "full commit hash of device side binary"
set(DEPTHAI_DEVICE_SIDE_COMMIT "9ed7c9ae4c232ff93a3500a585a6b1c00650e22c")
set(DEPTHAI_DEVICE_SIDE_COMMIT "4d360b5c56225f23e9a3d3a3999ce46c90cfdeaf")

# "version if applicable"
set(DEPTHAI_DEVICE_SIDE_VERSION "")
17 changes: 17 additions & 0 deletions include/depthai/device/DeviceBase.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -758,6 +758,23 @@ class DeviceBase {
*/
void flashCalibration2(CalibrationHandler calibrationDataHandler);

/**
* Sets the Calibration at runtime. This is not persistent and will be lost after device reset.
*
* @throws std::runtime_exception if failed to set the calibration
* @param calibrationObj CalibrationHandler object which is loaded with calibration information.
*
*/
void setCalibration(CalibrationHandler calibrationDataHandler);

/**
* Retrieves the CalibrationHandler object containing the non-persistent calibration
*
* @throws std::runtime_exception if failed to get the calibration
* @returns The CalibrationHandler object containing the non-persistent calibration
*/
CalibrationHandler getCalibration();

/**
* Fetches the EEPROM data from the device and loads it into CalibrationHandler object
* If no calibration is flashed, it returns default
Expand Down
35 changes: 35 additions & 0 deletions include/depthai/pipeline/datatype/CameraControl.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -292,6 +292,41 @@ class CameraControl : public Buffer {
*/
CameraControl& setCaptureIntent(CaptureIntent mode);

/**
* Set a miscellaneous control. The controls set by this function get appended
* to a list, processed after the standard controls
* @param control Control name
* @param value Value as a string
*/
CameraControl& setMisc(std::string control, std::string value);

/**
* Set a miscellaneous control. The controls set by this function get appended
* to a list, processed after the standard controls
* @param control Control name
* @param value Value as an integer number
*/
CameraControl& setMisc(std::string control, int value);

/**
* Set a miscellaneous control. The controls set by this function get appended
* to a list, processed after the standard controls
* @param control Control name
* @param value Value as a floating point number
*/
CameraControl& setMisc(std::string control, float value);

/**
* Clear the list of miscellaneous controls set by `setControl`
*/
void clearMiscControls();

/**
* Get the list of miscellaneous controls set by `setControl`
* @returns A list of <key, value> pairs as strings
*/
std::vector<std::pair<std::string, std::string>> getMiscControls();

// Functions to retrieve properties
/**
* Check whether command to capture a still is set
Expand Down
23 changes: 23 additions & 0 deletions include/depthai/pipeline/datatype/EncodedFrame.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,15 @@ class EncodedFrame : public Buffer {
* Retrieves instance number
*/
unsigned int getInstanceNum() const;
/**
* Retrieves image width in pixels
*/
unsigned int getWidth() const;

/**
* Retrieves image height in pixels
*/
unsigned int getHeight() const;
/**
* Retrieves exposure time
*/
Expand Down Expand Up @@ -111,6 +120,20 @@ class EncodedFrame : public Buffer {
*/
EncodedFrame& setInstanceNum(unsigned int instance);

/**
* Specifies frame width
*
* @param width frame width
*/
EncodedFrame& setWidth(unsigned int width);

/**
* Specifies frame height
*
* @param height frame height
*/
EncodedFrame& setHeight(unsigned int height);

/**
* Specifies the encoding quality
*
Expand Down
9 changes: 7 additions & 2 deletions include/depthai/pipeline/node/StereoDepth.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,16 @@ class StereoDepth : public NodeCRTP<Node, StereoDepth, StereoDepthProperties> {
/**
* Prefers accuracy over density. More invalid depth values, but less outliers.
*/
HIGH_ACCURACY,
HIGH_ACCURACY [[deprecated("Will be removed in future releases and replaced with DEFAULT")]],
/**
* Prefers density over accuracy. Less invalid depth values, but more outliers.
*/
HIGH_DENSITY
HIGH_DENSITY [[deprecated("Will be removed in future releases and replaced with DEFAULT")]],

DEFAULT,
FACE,
HIGH_DETAIL,
ROBOTICS
};

protected:
Expand Down
20 changes: 20 additions & 0 deletions src/device/DeviceBase.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1349,6 +1349,26 @@ void DeviceBase::flashCalibration2(CalibrationHandler calibrationDataHandler) {
}
}

void DeviceBase::setCalibration(CalibrationHandler calibrationDataHandler) {
bool success;
std::string errorMsg;
std::tie(success, errorMsg) = pimpl->rpcClient->call("setCalibration", calibrationDataHandler.getEepromData()).as<std::tuple<bool, std::string>>();
if(!success) {
throw std::runtime_error(errorMsg);
}
}

CalibrationHandler DeviceBase::getCalibration() {
bool success;
std::string errorMsg;
dai::EepromData eepromData;
std::tie(success, errorMsg, eepromData) = pimpl->rpcClient->call("getCalibration").as<std::tuple<bool, std::string, dai::EepromData>>();
if(!success) {
throw EepromError(errorMsg);
}
return CalibrationHandler(eepromData);
}

CalibrationHandler DeviceBase::readCalibration() {
dai::EepromData eepromData{};
try {
Expand Down
17 changes: 17 additions & 0 deletions src/pipeline/datatype/CameraControl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -215,6 +215,23 @@ CameraControl& CameraControl::setCaptureIntent(CaptureIntent mode) {
return *this;
}

CameraControl& CameraControl::setMisc(std::string control, std::string value) {
cfg.miscControls.push_back(std::make_pair(control, value));
return *this;
}
CameraControl& CameraControl::setMisc(std::string control, int value) {
return setMisc(control, std::to_string(value));
}
CameraControl& CameraControl::setMisc(std::string control, float value) {
return setMisc(control, std::to_string(value));
}
void CameraControl::clearMiscControls() {
cfg.miscControls.clear();
}
std::vector<std::pair<std::string, std::string>> CameraControl::getMiscControls() {
return cfg.miscControls;
}

bool CameraControl::getCaptureStill() const {
return cfg.getCommand(RawCameraControl::Command::STILL_CAPTURE);
}
Expand Down
14 changes: 14 additions & 0 deletions src/pipeline/datatype/EncodedFrame.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,12 @@ EncodedFrame::EncodedFrame(std::shared_ptr<RawEncodedFrame> ptr) : Buffer(std::m
unsigned int EncodedFrame::getInstanceNum() const {
return frame.instanceNum;
}
unsigned int EncodedFrame::getWidth() const {
return frame.width;
}
unsigned int EncodedFrame::getHeight() const {
return frame.height;
}
std::chrono::microseconds EncodedFrame::getExposureTime() const {
return std::chrono::microseconds(frame.cam.exposureTimeUs);
}
Expand Down Expand Up @@ -99,6 +105,14 @@ EncodedFrame& EncodedFrame::setInstanceNum(unsigned int instanceNum) {
frame.instanceNum = instanceNum;
return *this;
}
EncodedFrame& EncodedFrame::setWidth(unsigned int width) {
frame.width = width;
return *this;
}
EncodedFrame& EncodedFrame::setHeight(unsigned int height) {
frame.height = height;
return *this;
}
EncodedFrame& EncodedFrame::setQuality(unsigned int quality) {
frame.quality = quality;
return *this;
Expand Down
42 changes: 42 additions & 0 deletions src/pipeline/datatype/StereoDepthConfig.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,48 @@ float StereoDepthConfig::getMaxDisparity() const {
maxDisp += cfg.algorithmControl.disparityShift;
if(cfg.algorithmControl.enableExtended) maxDisp *= 2;
if(cfg.algorithmControl.enableSubpixel) maxDisp *= (1 << cfg.algorithmControl.subpixelFractionalBits);

std::vector<dai::StereoDepthConfig::PostProcessing::Filter> filtersToExecute;
for(auto filter : cfg.postProcessing.filteringOrder) {
switch(filter) {
case RawStereoDepthConfig::PostProcessing::Filter::SPECKLE:
if(cfg.postProcessing.speckleFilter.enable) {
filtersToExecute.push_back(filter);
}
break;
case RawStereoDepthConfig::PostProcessing::Filter::TEMPORAL:
if(cfg.postProcessing.temporalFilter.enable) {
filtersToExecute.push_back(filter);
}
break;
case RawStereoDepthConfig::PostProcessing::Filter::SPATIAL:
if(cfg.postProcessing.spatialFilter.enable) {
filtersToExecute.push_back(filter);
}
break;
case RawStereoDepthConfig::PostProcessing::Filter::DECIMATION:
if(cfg.postProcessing.decimationFilter.decimationFactor > 1) {
filtersToExecute.push_back(filter);
}
break;
case RawStereoDepthConfig::PostProcessing::Filter::MEDIAN:
if(cfg.postProcessing.median != dai::MedianFilter::MEDIAN_OFF) {
filtersToExecute.push_back(filter);
}
break;
case RawStereoDepthConfig::PostProcessing::Filter::NONE:
break;
default:
break;
}
}

if(filtersToExecute.size() != 0) {
if(filtersToExecute.back() != RawStereoDepthConfig::PostProcessing::Filter::MEDIAN) {
maxDisp = 1 << 13;
}
}

return maxDisp;
}

Expand Down
Loading

0 comments on commit d6a37a5

Please sign in to comment.