-
Notifications
You must be signed in to change notification settings - Fork 35
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #43 from luxonis/develop
Release 2.6.0
- Loading branch information
Showing
19 changed files
with
264 additions
and
108 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
#pragma once | ||
#include <cstdint> | ||
#include <nlohmann/json.hpp> | ||
#include <vector> | ||
|
||
#include "DatatypeEnum.hpp" | ||
#include "RawBuffer.hpp" | ||
#include "RawImgFrame.hpp" | ||
#include "depthai-shared/common/Rect.hpp" | ||
|
||
namespace dai { | ||
|
||
/// EdgeDetectorConfigData configuration data structure | ||
struct EdgeDetectorConfigData { | ||
/** | ||
* Used for horizontal gradiant computation in 3x3 Sobel filter | ||
* Format: 3x3 matrix, 2nd column must be 0 | ||
* Default: +1 0 -1; +2 0 -2; +1 0 -1 | ||
*/ | ||
std::vector<std::vector<int>> sobelFilterHorizontalKernel; | ||
/** | ||
* Used for vertical gradiant computation in 3x3 Sobel filter | ||
* Format: 3x3 matrix, 2nd row must be 0 | ||
* Default: +1 +2 +1; 0 0 0; -1 -2 -1 | ||
*/ | ||
std::vector<std::vector<int>> sobelFilterVerticalKernel; | ||
}; | ||
NLOHMANN_DEFINE_TYPE_NON_INTRUSIVE(EdgeDetectorConfigData, sobelFilterHorizontalKernel, sobelFilterVerticalKernel); | ||
|
||
/// RawEdgeDetectorConfig configuration structure | ||
struct RawEdgeDetectorConfig : public RawBuffer { | ||
EdgeDetectorConfigData config; | ||
|
||
void serialize(std::vector<std::uint8_t>& metadata, DatatypeEnum& datatype) const override { | ||
nlohmann::json j = *this; | ||
metadata = nlohmann::json::to_msgpack(j); | ||
datatype = DatatypeEnum::EdgeDetectorConfig; | ||
}; | ||
|
||
NLOHMANN_DEFINE_TYPE_INTRUSIVE(RawEdgeDetectorConfig, config); | ||
}; | ||
|
||
} // namespace dai |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
#pragma once | ||
#include <cstdint> | ||
#include <nlohmann/json.hpp> | ||
#include <vector> | ||
|
||
#include "DatatypeEnum.hpp" | ||
#include "RawBuffer.hpp" | ||
|
||
namespace dai { | ||
|
||
/** | ||
* Median filter config for disparity post-processing | ||
*/ | ||
enum class MedianFilter : int32_t { MEDIAN_OFF = 0, KERNEL_3x3 = 3, KERNEL_5x5 = 5, KERNEL_7x7 = 7 }; | ||
|
||
/// StereoDepth configuration data structure | ||
struct StereoDepthConfigData { | ||
using MedianFilter = dai::MedianFilter; | ||
|
||
/** | ||
* Set kernel size for disparity/depth median filtering, or disable | ||
*/ | ||
MedianFilter median = MedianFilter::KERNEL_5x5; | ||
|
||
/** | ||
* Confidence threshold for disparity calculation, 0..255 | ||
*/ | ||
std::int32_t confidenceThreshold = 230; | ||
|
||
/** | ||
* Sigma value for bilateral filter. 0 means disabled | ||
* A larger value of the parameter means that farther colors within the pixel neighborhood will be mixed together. | ||
*/ | ||
std::int16_t bilateralSigmaValue = 0; | ||
|
||
/** | ||
* Left-right check threshold for left-right, right-left disparity map combine, 0..128 | ||
* Used only when left-right check mode is enabled. | ||
* Defines the maximum difference between the confidence of pixels from left-right and right-left confidence maps | ||
*/ | ||
std::int32_t leftRightCheckThreshold = 4; | ||
}; | ||
NLOHMANN_DEFINE_TYPE_NON_INTRUSIVE(StereoDepthConfigData, median, confidenceThreshold, bilateralSigmaValue, leftRightCheckThreshold); | ||
|
||
/// RawStereoDepthConfig configuration structure | ||
struct RawStereoDepthConfig : public RawBuffer { | ||
StereoDepthConfigData config; | ||
|
||
void serialize(std::vector<std::uint8_t>& metadata, DatatypeEnum& datatype) const override { | ||
nlohmann::json j = *this; | ||
metadata = nlohmann::json::to_msgpack(j); | ||
datatype = DatatypeEnum::StereoDepthConfig; | ||
}; | ||
|
||
NLOHMANN_DEFINE_TYPE_INTRUSIVE(RawStereoDepthConfig, config); | ||
}; | ||
|
||
} // namespace dai |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
31 changes: 31 additions & 0 deletions
31
include/depthai-shared/properties/EdgeDetectorProperties.hpp
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
#pragma once | ||
|
||
#include <depthai-shared/common/optional.hpp> | ||
#include <depthai-shared/datatype/RawEdgeDetectorConfig.hpp> | ||
#include <nlohmann/json.hpp> | ||
#include <vector> | ||
|
||
namespace dai { | ||
|
||
/** | ||
* Specify properties for EdgeDetector | ||
*/ | ||
struct EdgeDetectorProperties { | ||
/// Initial edge detector config | ||
RawEdgeDetectorConfig initialConfig; | ||
|
||
/// Whether to wait for config at 'inputConfig' IO | ||
bool inputConfigSync = false; | ||
|
||
/** | ||
* Maximum output frame size in bytes (eg: 300x300 BGR image -> 300*300*3 bytes) | ||
*/ | ||
int outputFrameSize = 1 * 1024 * 1024; | ||
|
||
/// Num frames in output pool | ||
int numFramesPool = 4; | ||
}; | ||
|
||
NLOHMANN_DEFINE_TYPE_NON_INTRUSIVE(EdgeDetectorProperties, initialConfig, inputConfigSync, outputFrameSize, numFramesPool); | ||
|
||
} // namespace dai |
Oops, something went wrong.