Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Depthai Wrapper #1

Merged
merged 28 commits into from
Sep 28, 2020
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
28 commits
Select commit Hold shift + click to select a range
fcbee79
added depthai wrapper
saching13 Sep 19, 2020
d3780d7
refactoring variables
saching13 Sep 19, 2020
772c323
added versions of cmakelists
saching13 Sep 19, 2020
5d031ea
bug fix
saching13 Sep 19, 2020
60c4c1b
updated depth_raw to depth
saching13 Sep 19, 2020
cb5de32
Update include/depthai/depthai_wrapper.hpp
saching13 Sep 25, 2020
e45e049
updated PR req
saching13 Sep 25, 2020
614ea22
updated with PR changes
saching13 Sep 26, 2020
f40f20d
updated with maps. WIP not tested
saching13 Sep 26, 2020
bee2b1c
updated comments and test run worked
saching13 Sep 26, 2020
6b4818c
Update include/depthai/depthai_wrapper.hpp
saching13 Sep 26, 2020
1339edf
Update include/depthai/depthai_wrapper.hpp
saching13 Sep 26, 2020
30fc974
updated with PR
saching13 Sep 26, 2020
e0218ca
Merge branch 'feature/sachin/depthai_wrapper' of https://github.com/I…
saching13 Sep 26, 2020
2a5d116
updated with PR
saching13 Sep 26, 2020
694a158
Update include/depthai/depthai_wrapper.hpp
saching13 Sep 26, 2020
5a47330
Update src/depthai_wrapper.cpp
saching13 Sep 27, 2020
f5b211a
Update src/depthai_wrapper.cpp
saching13 Sep 27, 2020
593ca42
Update include/depthai/depthai_wrapper.hpp
saching13 Sep 27, 2020
b428b04
Update include/depthai/depthai_wrapper.hpp
saching13 Sep 27, 2020
3f03bb7
update changes
saching13 Sep 27, 2020
478da76
update changes
saching13 Sep 27, 2020
bc01961
update changes
saching13 Sep 27, 2020
484707c
update changes
saching13 Sep 27, 2020
5272fe6
Update include/depthai/depthai_wrapper.hpp
saching13 Sep 27, 2020
112b924
update changes
saching13 Sep 27, 2020
eb48e36
Merge branch 'feature/sachin/depthai_wrapper' of https://github.com/I…
saching13 Sep 27, 2020
02334e9
updated code
saching13 Sep 27, 2020
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
Prev Previous commit
Next Next commit
updated PR req
  • Loading branch information
saching13 committed Sep 25, 2020
commit e45e049252aa0365ff49edff6148ac3cc8924a3c
24 changes: 17 additions & 7 deletions include/depthai/depthai_wrapper.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -11,32 +11,41 @@ namespace DepthAI
{

using CV_mat_ptr = std::shared_ptr<cv::Mat>; // shared ptr for cv::Mat
using PacketsTuple = std::tuple<
std::list<std::shared_ptr<NNetPacket>>,
std::list<std::shared_ptr<HostDataPacket>>>; // tuple of data packets on which Depthai is
// publishing the streams

/** DepthAI:
* This is a wrapper on the host side of the device which
* helps in initializing OAK device, creating pipeline
* and fetching the frames as cv::Mat.
*/

class DepthAI : public Device
{

public:
/** Constructor:
* initializing OAK device and creating pipeline
* to capture camera streams and AI outputs.
* @param usb_device (std::string): Provide the path of the device
* or pass empty string to choose the default device.
* @param config_file (std::string): Provides the json file which is
* used by the Depthai to configure the OAK-D.
* @param usb2_mode (bool): set to true to connect over usb2
*/
DepthAI(const std::string& usb_device, const std::string& config_file, bool usb2_mode = false);

/* API to stream output frames from OAK.
* AI data and metadata is WIP
*/

void get_frames(std::unordered_map<std::string, CV_mat_ptr>& output_streams);

/* Destructor */
~DepthAI();

private:
using PacketsTuple = std::tuple<
std::list<std::shared_ptr<NNetPacket>>,
std::list<std::shared_ptr<HostDataPacket>>>; // tuple of data packets on which Depthai is
// publishing the streams


std::shared_ptr<CNNHostPipeline> pipeline_; // Depthai's pipeline object.

PacketsTuple packets_;
Expand All @@ -55,3 +64,4 @@ class DepthAI : public Device
};

} // namespace DepthAI

3 changes: 1 addition & 2 deletions src/depthai_wrapper.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,6 @@ DepthAI::~DepthAI() = default;

void DepthAI::get_frames(std::unordered_map<std::string, CV_mat_ptr>& output_streams)
{
// std::cout << "mono it-----" << mono_height_ << " ~~ " << mono_width_ << std::endl;

int count = stream_names_.size();
std::vector<std::string>::iterator it;
Expand Down Expand Up @@ -166,4 +165,4 @@ void DepthAI::get_frames(std::unordered_map<std::string, CV_mat_ptr>& output_str
}
}

} // namespace DepthAI
} // namespace DepthAI