Posted by
noone on
Oct 12, 2024; 12:42pm
URL: http://official-rtab-map-forum.206.s1.nabble.com/stereo-example-tp10512p10531.html
which header let me set the fps ? i did the fourcc but it did not work , the idea with opencv to make elp cameras work without overloading the bios is the follow the arrange is very important , first camera resolution then fps then FOURCC
this is the CameraStereoVideo.cpp you mentioned and i modified the example kindly check it at
https://pastebin.com/yBCUT7YP i used pastbin because the message would be so long

if (src_ == CameraVideo::kUsbDevice)
{
if (stereoModel_.isValidForProjection())
{
if (capture_.isOpened())
{
capture_.set(CV_CAP_PROP_FRAME_WIDTH, stereoModel_.left().imageWidth() * (capture2_.isOpened() ? 1 : 2));
capture_.set(CV_CAP_PROP_FRAME_HEIGHT, stereoModel_.left().imageHeight());
if (capture2_.isOpened())
{
capture2_.set(CV_CAP_PROP_FRAME_WIDTH, stereoModel_.right().imageWidth());
capture2_.set(CV_CAP_PROP_FRAME_HEIGHT, stereoModel_.right().imageHeight());
}
}
}
else if (_width > 0 && _height > 0)
{
if (capture_.isOpened())
{
capture_.set(CV_CAP_PROP_FRAME_WIDTH, _width * (capture2_.isOpened() ? 1 : 2));
capture_.set(CV_CAP_PROP_FRAME_HEIGHT, _height);
if (capture2_.isOpened())
{
capture2_.set(CV_CAP_PROP_FRAME_WIDTH, _width);
capture2_.set(CV_CAP_PROP_FRAME_HEIGHT, _height);
}
}
}
// Set the FOURCC codec after setting the width and height
capture_.set(CV_CAP_PROP_FOURCC, CV_FOURCC('M', 'J', 'P', 'G'));
if (capture2_.isOpened())
{
capture2_.set(CV_CAP_PROP_FOURCC, CV_FOURCC('M', 'J', 'P', 'G'));
}
}