Skip to content

Commit

Permalink
allow setting input height
Browse files Browse the repository at this point in the history
  • Loading branch information
MRo47 committed Sep 27, 2024
1 parent cf5d2aa commit d572a1b
Showing 1 changed file with 11 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
#include <memory>
#include <string>
#include <vector>
#include <optional>

#include "depthai-shared/common/CameraBoardSocket.hpp"
#include "depthai/device/DataQueue.hpp"
Expand Down Expand Up @@ -65,6 +66,9 @@ class Detection : public BaseNode {
if(ph->getParam<bool>("i_disable_resize")) {
width = ph->getOtherNodeParam<int>(socketName, "i_preview_width");
height = ph->getOtherNodeParam<int>(socketName, "i_preview_height");
} else if(inputWidth.has_value() && inputHeight.has_value()) {
width = inputWidth.value();
height = inputHeight.value();
} else {
width = imageManip->initialConfig.getResizeConfig().width;
height = imageManip->initialConfig.getResizeConfig().height;
Expand Down Expand Up @@ -132,6 +136,12 @@ class Detection : public BaseNode {
ptPub = setupOutput(pipeline, ptQName, [&](dai::Node::Input input) { detectionNode->passthrough.link(input); });
}
};

void setInputDimensions(int width, int height)
{
inputWidth = width;
inputHeight = height;
}
/**
* @brief Closes the queues for the DetectionNetwork node and the passthrough.
*/
Expand Down Expand Up @@ -173,6 +183,7 @@ class Detection : public BaseNode {
std::shared_ptr<dai::DataOutputQueue> nnQ, ptQ;
std::shared_ptr<dai::node::XLinkOut> xoutNN;
std::string nnQName, ptQName;
std::optional<int> inputWidth, inputHeight;
};

} // namespace nn
Expand Down

0 comments on commit d572a1b

Please sign in to comment.