-
Notifications
You must be signed in to change notification settings - Fork 132
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
Camera node holistic record & replay #1117
Open
asahtik
wants to merge
60
commits into
v3_develop
Choose a base branch
from
v3_camera_record_n_replay
base: v3_develop
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from 6 commits
Commits
Show all changes
60 commits
Select commit
Hold shift + click to select a range
ceb441c
Implemented holistic record for Camera node
asahtik 8419fe8
Added Holistic R&R support for the Camera node
asahtik 2e7029e
Merge branch 'v3_develop' of github.com:luxonis/depthai-core into v3_…
asahtik 085a7fb
Bump fw
asahtik b064bf9
Added RVC4 support for holistic record & replay
asahtik b9526bb
Bump fw
asahtik 62beaab
Merge branch 'v3_develop' of github.com:luxonis/depthai-core into v3_…
asahtik 4916b3b
Move cross-platform examples
asahtik 52e78e2
PR fixes
asahtik 3dd2eef
Merge branch 'v3_develop' of github.com:luxonis/depthai-core into v3_…
asahtik 2caba46
Bump firmware
asahtik 6b00d3c
Merge branch 'v3_visualizer_support' of github.com:luxonis/depthai-co…
asahtik c578a1f
Merge branch 'v3_visualizer_support' of github.com:luxonis/depthai-co…
asahtik fa6471a
Merge branch 'v3_develop' of github.com:luxonis/depthai-core into v3_…
asahtik 2c1d6f0
Merge branch 'v3_visualizer_support' of github.com:luxonis/depthai-co…
asahtik 380c898
Added IMUData protobuf support
asahtik f0012ad
Merge branch 'v3_visualizer_support' of github.com:luxonis/depthai-co…
asahtik f614d76
Moved Record & Replay from jsonschema to protobuf, TODO testing
asahtik 1acbf71
Removed wrapper from recording schema
asahtik fae97f5
Merge branch 'v3_visualizer_support' of github.com:luxonis/depthai-co…
asahtik eddfb12
Merge branch 'v3_visualizer_support' of github.com:luxonis/depthai-co…
asahtik 7b2fac6
WIP: migrate record&replay to protobuf
asahtik fd7b032
Merge branch 'v3_visualizer_support' of github.com:luxonis/depthai-co…
asahtik cfa03f0
Remove unused header
asahtik b8480d8
Merge branch 'v3_develop' of github.com:luxonis/depthai-core into v3_…
asahtik 952914f
Fix replay bugs
asahtik 87ae43b
Bump RVC4 fw [no ci]
asahtik 69d582d
Bump rvc2 fw
asahtik 4f7c7bb
Bump rvc2 fw
asahtik 33b1bd7
Holistic record/replay bugfixes
asahtik eb11ab8
Build camera
asahtik 1764042
Merge branch 'v3_camera_record_n_replay' of github.com:luxonis/deptha…
asahtik ed6b70b
Merge branch 'v3_develop' of github.com:luxonis/depthai-core into v3_…
asahtik a74acc6
Fix build
asahtik 0054a47
Merge branch 'v3_develop' of github.com:luxonis/depthai-core into v3_…
asahtik 801606b
Holistic camera record improvements
asahtik a6a45fe
Merge branch 'v3_develop' of github.com:luxonis/depthai-core into v3_…
asahtik 45aa00b
Merge branch 'v3_develop' of github.com:luxonis/depthai-core into v3_…
asahtik 320bbba
Holistic record fixes
asahtik 29194c1
Bump rvc4 fw
asahtik ce8df2d
Bump rvc2 fw
asahtik 2ab1748
Merge branch 'v3_develop' of github.com:luxonis/depthai-core into v3_…
asahtik b635c72
Fix imgtransformation proto deserialization
asahtik c0560af
Bump rvc2 fw
asahtik aa5977a
Merge branch 'v3_develop' of github.com:luxonis/depthai-core into v3_…
asahtik b1aaabe
Fix example
asahtik a178a16
Merge branch 'v3_develop' of github.com:luxonis/depthai-core into v3_…
asahtik a121df9
Bump rvc4 fw [no ci]
asahtik 8a82faf
Bump rvc2 fw
asahtik 9088650
Merge branch 'v3_develop' of github.com:luxonis/depthai-core into v3_…
asahtik ea2217a
Fix holistic record&replay examples to use Camera instead of color ca…
asahtik 877a90b
Merge branch 'v3_develop' of github.com:luxonis/depthai-core into v3_…
asahtik c6c84ac
Merge branch 'v3_develop' of github.com:luxonis/depthai-core into v3_…
asahtik 7cc30ca
Remove version control markers [no ci]
asahtik 1708e10
Merge branch 'v3_develop' of github.com:luxonis/depthai-core into v3_…
asahtik 6814926
Fix missing timestamp when recording encoded frames
asahtik 25507e2
Merge branch 'v3_develop' of github.com:luxonis/depthai-core into v3_…
asahtik 4e0b436
Added helper functions to Camera [no ci]
asahtik 2c5dd0d
Merge branch 'v3_develop' of github.com:luxonis/depthai-core into v3_…
asahtik 3001ef9
Bump rvc4 fw
asahtik File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
// Includes common necessary includes for development using depthai library | ||
#include "depthai/common/CameraBoardSocket.hpp" | ||
#include "depthai/depthai.hpp" | ||
#include "depthai/pipeline/datatype/ImgFrame.hpp" | ||
#include "depthai/pipeline/node/host/Replay.hpp" | ||
|
||
int main(int argc, char** argv) { | ||
// Create pipeline | ||
auto device = argc > 1 ? std::make_shared<dai::Device>(argv[1]) : std::make_shared<dai::Device>(); | ||
dai::Pipeline pipeline(device); | ||
|
||
// Define source and output | ||
auto camRgb = pipeline.create<dai::node::Camera>()->build(dai::CameraBoardSocket::CAM_A); | ||
|
||
auto outputQueue = camRgb->requestOutput({1280, 720}, dai::ImgFrame::Type::NV12)->createOutputQueue(); | ||
|
||
pipeline.start(); | ||
while(pipeline.isRunning()) { | ||
auto videoIn = outputQueue->get<dai::ImgFrame>(); | ||
|
||
// Get BGR frame from NV12 encoded video frame to show with opencv | ||
// Visualizing the frame on slower hosts might have overhead | ||
cv::imshow("video", videoIn->getCvFrame()); | ||
|
||
int key = cv::waitKey(1); | ||
if(key == 'q' || key == 'Q') { | ||
pipeline.stop(); | ||
} | ||
} | ||
return 0; | ||
} |
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 |
---|---|---|
|
@@ -3,6 +3,7 @@ | |
#include <fstream> | ||
#include <memory> | ||
#include <stdexcept> | ||
#include <utility> | ||
|
||
// libraries | ||
#include <spimpl.h> | ||
|
@@ -178,6 +179,46 @@ NodeRecordParams Camera::getNodeRecordParams() const { | |
params.name = "Camera" + toString(properties.boardSocket); | ||
return params; | ||
} | ||
Camera::Input& Camera::getReplayInput() { | ||
return mockIsp; | ||
} | ||
|
||
std::pair<size_t, size_t> Camera::getMaxRequestedSize() const { | ||
uint32_t maxWidth = 0; | ||
uint32_t maxHeight = 0; | ||
for(const auto& outputRequest : pimpl->outputRequests) { | ||
if(outputRequest.capability.size.value) { | ||
if(const auto* size = std::get_if<std::pair<uint32_t, uint32_t>>(&(*outputRequest.capability.size.value))) { | ||
maxWidth = std::max(maxWidth, size->first); | ||
maxHeight = std::max(maxHeight, size->second); | ||
} else { | ||
throw std::runtime_error("Unsupported size value"); | ||
} | ||
} | ||
} | ||
if(maxWidth == 0 || maxHeight == 0) { | ||
throw std::runtime_error("Invalid max width or height"); | ||
} | ||
return std::make_pair(maxWidth, maxHeight); | ||
}; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think we should actually record maxSize, that is full FOV. |
||
float Camera::getMaxRequestedFps() const { | ||
float maxFps = 0; | ||
for(const auto& outputRequest : pimpl->outputRequests) { | ||
if(outputRequest.capability.fps.value) { | ||
if(const auto* fps = std::get_if<float>(&(*outputRequest.capability.fps.value))) { | ||
maxFps = std::max(maxFps, *fps); | ||
} else if(const auto* fps = std::get_if<std::pair<float, float>>(&(*outputRequest.capability.fps.value))) { | ||
maxFps = std::max(maxFps, std::get<1>(*fps)); | ||
} else if(const auto* fps = std::get_if<std::vector<float>>(&(*outputRequest.capability.fps.value))) { | ||
DAI_CHECK(fps->size() > 0, "When passing a vector to ImgFrameCapability->fps, please pass a non empty vector!"); | ||
maxFps = std::max(maxFps, (*fps)[0]); | ||
} else { | ||
throw std::runtime_error("Unsupported fps value"); | ||
} | ||
} | ||
} | ||
return maxFps == 0 ? 30 : maxFps; | ||
} | ||
|
||
/* | ||
Camera::Output& Camera::getRecordOutput() { | ||
|
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
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's remove before merge IMO