We are working with the C++ multiCameraServer with a GRIP pipeline. Within the loop we have a simple wrapper around the generated GRIP pipeline (where grep::InfinteRecharge is an unmodified C++ pipeline generated by GRIP):
class Pipeline : public grip::InfiniteRecharge, cs::CvSource {
public:
Pipeline(const wpi::Twine& name, const cs::VideoMode& mode) : cs::CvSource(name, mode) { }
void Process(cv::Mat& mat) override {
grip::InfiniteRecharge::Process(mat);
PutFrame(*GetCvErodeOutput());
}
};
And then in the main there is some code like:
SwitchedCameraConfig debugOutput = { "debug", "debug" };
Pipeline* pipeline = new Pipeline("debug", cameras[0].GetVideoMode());
auto debugCamera = StartSwitchedCamera(debugOutput);
if (cameras.size() >= 1) {
std::thread([&] {
frc::VisionRunner<Pipeline> runner(cameras[0], pipeline, [&](Pipeline &pipeline) {
*snip some contour bounding box code, that writes to network tables
Just trying to add a second network stream that would allow us to watch a masked stream (or any other cv::Mat we wanted to see.
Am I going the wrong direction? (just trying to keep things working with the framework, but not quite sure where to add the output).
Thanks for your time