26 const auto edgeLeftStr =
"edge left";
27 const auto edgeRightStr =
"edge right";
28 const auto edgeRgbStr =
"edge rgb";
29 const auto edgeCfgStr =
"edge cfg";
31 xoutEdgeLeft->setStreamName(edgeLeftStr);
48 monoLeft->out.link(edgeDetectorLeft->inputImage);
50 camRgb->video.link(edgeDetectorRgb->
inputImage);
52 edgeDetectorLeft->outputImage.link(xoutEdgeLeft->input);
56 xinEdgeCfg->out.link(edgeDetectorLeft->inputConfig);
57 xinEdgeCfg->out.link(edgeDetectorRight->
inputConfig);
65 auto edgeRightQueue = device.
getOutputQueue(edgeRightStr, 8,
false);
69 std::cout <<
"Switch between sobel filter kernels using keys '1' and '2'" << std::endl;
76 cv::Mat edgeLeftFrame = edgeLeft->
getFrame();
77 cv::Mat edgeRightFrame = edgeRight->
getFrame();
78 cv::Mat edgeRgbFrame = edgeRgb->
getFrame();
81 cv::imshow(edgeLeftStr, edgeLeftFrame);
82 cv::imshow(edgeRightStr, edgeRightFrame);
83 cv::imshow(edgeRgbStr, edgeRgbFrame);
85 int key = cv::waitKey(1);
92 std::cout <<
"Switching sobel filter kernel." << std::endl;
94 std::vector<std::vector<int>> sobelHorizontalKernel = {{1, 0, -1}, {2, 0, -2}, {1, 0, -1}};
95 std::vector<std::vector<int>> sobelVerticalKernel = {{1, 2, 1}, {0, 0, 0}, {-1, -2, -1}};
97 edgeCfgQueue->send(cfg);
101 std::cout <<
"Switching sobel filter kernel." << std::endl;
103 std::vector<std::vector<int>> sobelHorizontalKernel = {{3, 0, -3}, {10, 0, -10}, {3, 0, -3}};
104 std::vector<std::vector<int>> sobelVerticalKernel = {{3, 10, 3}, {0, 0, 0}, {-3, -10, -3}};
106 edgeCfgQueue->send(cfg);