introlab / rtabmap

RTAB-Map library and standalone application
https://introlab.github.io/rtabmap
Other
2.85k stars 787 forks source link

how to change camera resolution in rtabmap #299

Closed pras2020 closed 6 years ago

pras2020 commented 6 years ago

Hello All

i hav a stereo camera which stream in 2 resolution 1280 720 and 1920 1080. But i could see only 1280 * 720 in the viewer. how can i change to 1080 in rtabmap

matlabbe commented 6 years ago

Which driver are you using? USB driver (side-by-side stereo)? If so, there are no options in the GUI to do this right now, the default resolution is taken when opening the stream. As rtabmap is using cv::VideoCapture class from OpenCV, you may be able to force a resolution by hard-coding it in the code: https://github.com/introlab/rtabmap/blob/60499e895f00019b249daf5b5cf5ece9448037e3/corelib/src/CameraStereo.cpp#L1363-L1365 After successfully opened, you could set this (from this link):

capture_.set(cv::CAP_PROP_FRAME_WIDTH, valueX); // valueX = your wanted width 
capture_.set(cv::CAP_PROP_FRAME_HEIGHT, valueY); // valueY = your wanted heigth