urbste / MultiCol-SLAM

This repository contains a multi-fisheye camera SLAM. The underlying SLAM system is based on ORB-SLAM.
604 stars 220 forks source link

Changing the number of cameras #38

Closed BW25 closed 5 years ago

BW25 commented 5 years ago

I am attempting to change the number of cameras that MultiCol SLAM uses as input.

So far in multi_col_slam_lafida.cpp I altered LoadImagesAndTimestamps to resize vstrImageFilenames to hold input from two cameras, not three.

vstrImageFilenames.resize(2); //Formerly 3

I also commented out the statement that would normally put the path to the third image in the vector.

//vstrImageFilenames[2].push_back(path2imgs + '/' + pathimg3);

Unfortunately, I am now getting errors after the images have loaded, in the main loop. Is there a way to alter MultiCol SLAM to take a different number of cameras as input? Thank you.

Error output below, with annotations noting where the errors were found to occur in debugging.

Start processing sequence ... Images in the sequence: 734

     //This error occurs in cTracking, GrabImageSet, in the else statement

Framebuffer with requested attributes not available. Using available framebuffer. You may see visual artifacts.---Feature Extraction (85ms) - ImageId: 0---

    //The program reaches the end of the main loop and repeats
    //Printed in cTracking, GrabImageSet, in the else statement

---Feature Extraction (33ms) - ImageId: 1---

    //This error occurs in cTracking in the call to Track()

---matching time (12)--- nr:1157 [sm::SampleConsensusModel::getSamples] Can not select 8 unique points out of 0! [sm::RandomSampleConsensus::computeModel] No samples could be selected!

    //This error occurs after the call to TrackMultiColSLAM before it reaches the end of the main loop.

OpenCV Error: Assertion failed (size.width>0 && size.height>0) in imshow, file /home/denald/software/opencv-3.1.0/modules/highgui/src/window.cpp, line 281 terminate called after throwing an instance of 'cv::Exception' what(): /home/denald/software/opencv-3.1.0/modules/highgui/src/window.cpp:281: error: (-215) size.width>0 && size.height>0 in function imshow

Aborted (core dumped)

BW25 commented 5 years ago

I found the issue. In MultiCamSys_Calibration.yaml, I had forgotten to change CameraSystem.nrCams from 3 to 2. Thanks!

sooroosh commented 3 years ago

Hi, Can anyone suggest how to change the number of cameras in the system to 4 ? I have changed: CameraSystem.nrCams in the MultiCamSys_Calibration.yaml to 4 and added the parameters for the 4th camera. Added InteriorOrientationFisheye3.yaml for the 4th camera. put the images for the 4tch camera in cam3 directory of the dataset and changed images_and_timestamps.txt respectively. changed the following lines in the mult_col_slam_lafida.cpp : line 173 to: vstrImageFilenames.resize(4); line 188 till 200:

            string pathimg1, pathimg2, pathimg3; pathimg4;
            if (!(iss >> timestamp >> pathimg1 >> pathimg2 >> pathimg3 >> pathimg4))
                break;
            vTimestamps.push_back(timestamp);
            vstrImageFilenames[0].push_back(path2imgs + '/' + pathimg1);
            vstrImageFilenames[1].push_back(path2imgs + '/' + pathimg2);
            vstrImageFilenames[2].push_back(path2imgs + '/' + pathimg3);
            vstrImageFilenames[3].push_back(path2imgs + '/' + pathimg4);
        }
        ++cnt;

    }
}

However, when I run the program it only shows 3 windows with images for the first 3 cameras, does anyone know what am I missing here ?

@urbste @Andersw88