Closed PeterQFR closed 1 year ago
Example Code that doesn't work: NB depthtemp is a depth node initialised elsewhere.
xoutRGB_= pipeline.create<dai::node::XLinkOut>();
xoutRGB_->setStreamName("rgb_preview");
xoutRGB_->input.setBlocking(false);
xoutRGB_->input.setQueueSize(1);
rgb_ = pipeline.create<dai::node::ColorCamera>();
rgb_->setFps(1.0f);
rgb_->setResolution(dai::ColorCameraProperties::SensorResolution::THE_1080_P);
rgb_->setInterleaved(false);
rgb_->setColorOrder(dai::ColorCameraProperties::ColorOrder::BGR);
rgb_->setPreviewSize(416, 416);
xoutNN_ = pipeline.create<dai::node::XLinkOut>();
xoutNN_->setStreamName("detections");
xoutBBDepthMapping_ = pipeline.create<dai::node::XLinkOut>();
xoutBBDepthMapping_->setStreamName("boundingboxes");
spatialDetector_ = pipeline.create<dai::node::YoloSpatialDetectionNetwork>();
spatialDetector_->setConfidenceThreshold(CONFIDENCE_THRESHOLD);
spatialDetector_->input.setBlocking(false);
spatialDetector_->inputDepth.setBlocking(false);
spatialDetector_->setBoundingBoxScaleFactor(0.5);
spatialDetector_->setDepthLowerThreshold(100);
spatialDetector_->setDepthUpperThreshold(20000);
spatialDetector_->setNumClasses(80);
spatialDetector_->setCoordinateSize(4);
spatialDetector_->setAnchors({10, 14, 23, 27,37, 58, 81, 82, 135, 169, 344, 319});
spatialDetector_->setAnchorMasks({{"side26", {1, 2, 3}}, {"side13", {3, 4, 5}}});
spatialDetector_->setIouThreshold(0.5f);
spatialDetector_->setBlobPath(path_);
//Comments here turn on or off rotation of depth image to see if that affects CPU.
// depthRotation_ = pipeline.create<dai::node::ImageManip>();
colorRotation_ = pipeline.create<dai::node::ImageManip>();
/* depthRotation_->initialConfig.setRotationRadians(M_PI_2);
depthRotation_->initialConfig.setFrameType(dai::ImgFrame::Type::RAW16);
depthRotation_->inputImage.setBlocking(false);
depthRotation_->inputImage.setQueueSize(1);
*/
colorRotation_->initialConfig.setRotationRadians(M_PI_2);
colorRotation_->initialConfig.setFrameType(dai::ImgFrame::Type::BGR888p);
colorRotation_->inputImage.setBlocking(false);
colorRotation_->inputImage.setQueueSize(1);
//depth_temp_->depth.link(depthRotation_->inputImage);
rgb_->preview.link(colorRotation_->inputImage);
colorRotation_->out.link(spatialDetector_->input);
//depthRotation_->out.link(spatialDetector_->inputDepth);
depth_temp_->depth.link(spatialDetector_->inputDepth);
spatialDetector_->input.setBlocking(false);
spatialDetector_->input.setQueueSize(1);
spatialDetector_->inputDepth.setBlocking(false);
spatialDetector_->inputDepth.setQueueSize(1);
spatialDetector_->boundingBoxMapping.link(xoutBBDepthMapping_->input);
spatialDetector_->out.link(xoutNN_->input);
spatialDetector_->passthrough.link(xoutRGB_->input);
Actually this is for depthai-core will move the issue there.
Possibly related to #625
I am running a spatialImageDetector node and as my cameras are mounted 90 degrees to normal I rotate the depth and rgb images 90 degrees using a imagemanip node. when doing so the LeonRT maxes out to 100% and a CPU trap is triggered.
In my debug output from the node:
If I disable using the ImageManipNodes and just pipe depth and rgb preview directly to the spatial detector I do not get an issue with the CPU.
The code works on earlier commit 02c304803aabaced594e8173152c6dedb260cd06
but this error appears on a newer commit on the main branch 690b6a63
I am use a DepthAI Pro.