Comments (17)
@cipri-tom yeah I did. I just overwrote mono_tum.cc with this code:
#include <iostream>
#include <algorithm>
#include <fstream>
#include <chrono>
#include <opencv2/core/core.hpp>
#include <opencv2/opencv.hpp>
#include <System.h>
using namespace std;
int main(int argc, char **argv)
{
if(argc != 3)
{
cerr << endl << "Usage: ./path_to_PF_ORB path_to_vocabulary path_to_settings path_to_dev_video" << endl;
return 1;
}
cv::VideoCapture cap(1);
if (!cap.isOpened())
{
cerr << endl <<"Could not open camera feed." << endl;
return -1;
}
// Create SLAM system. It initializes all system threads and gets ready to process frames.
ORB_SLAM2::System SLAM(argv[1],argv[2],ORB_SLAM2::System::MONOCULAR,true);
cout << endl << "-------" << endl;
cout << "Start processing sequence ..." << endl;
// Main loop
int timeStamps=0;
for(;;timeStamps++)
{
//Create a new Mat
cv::Mat frame;
//Send the captured frame to the new Mat
cap>>frame;
// Pass the image to the SLAM system
SLAM.TrackMonocular(frame, timeStamps);
}
// Stop all threads
SLAM.Shutdown();
// Save camera trajectory
SLAM.SaveKeyFrameTrajectoryTUM("KeyFrameTrajectory.txt");
return 0;
}
Just note the VideoCapture cap(1) may change on your system depending on where your USB cam (or other cam) is publishing images. Mine just happened to be /dev/video1 (webcam was /dev/video0). Let me know if this helps.
from orb_slam2.
@akashshar path_to_PF_ORB
is the path to the binary resulted when you compile this project/file
from orb_slam2.
Hey. Did you have any success with this ?
from orb_slam2.
That's exactly what I was thinking of doing! Thank you!
However, I was worrying of the timeStamps
parameter. Is it just so the SLAM can order the frames or they have to be more accurate ? I see you're just incrementing them so I suppose it's the former, i.e. used just for ordering without the need of accuracy.
from orb_slam2.
@cipri-tom Yeah, honestly that was the only part that was confusing when I was reading through the initial code (mono_tum.cc), but I figured I would give it a shot with an increment every frame. Thankfully it worked, so I think your assessment is correct in that it is just for ordering. It's possible that this is off base, but I haven't seen what I would consider poor performance doing it this way, so you should be okay.
from orb_slam2.
@notenti Thank you so much! It is working on Windows 10 too. Build with Visual Studio 15.
One think I still cannot do is to use ORBvoc.bin, in order to increase speed...
from orb_slam2.
Hi @notenti,
It works, thank you very much
from orb_slam2.
Hi @notenti, I managed to speed up loading with ORBvoc.bin.
But pagonlin and webcam still slow..
from orb_slam2.
@notenti thanks for the code. What do you mean by path_to_PF_ORB? What argument should I pass here?
Thanks!
from orb_slam2.
@akashshar @cipri-tom is correct
from orb_slam2.
Do you guys have a unity 3d sample of this work?
from orb_slam2.
Hi @notenti,Thank you so much!
It works, thank you very much
from orb_slam2.
Hi, could anyone help me to clarify what are these inputs: ./path_to_PF_ORB path_to_vocabulary path_to_settings path_to_dev_video?
if you could give an example it will be great, thank you
from orb_slam2.
@Jasonzhang11111 it's been a while since I've looked at this code, but I'm fairly certain path_to_PF_ORB
is just the binary you get as a result of compiling the project. path_to_vocabulary
and path_to_setting
are most likely configuration files or configuration folders that ORB_SLAM uses...you will want to double check that, though. Really not sure what path_to_dev_video
is. My first thought was that it was the /dev/videoX
interface, but I really am not sure. Sorry I couldn't be more helpful!
from orb_slam2.
Thank you @notenti for your help.
I also realise inconsistency in the original code. argv[3] and argv[4] are never being used. And although there are four inputs, the code checks if number of inputs are equal to 3! It is a little bit confusing.
from orb_slam2.
Hello everyone,
i would like to overwrite mono_tum.cc as well, when i do then i compile from terminal using g++ (i'm on ubuntu 16.04) but i receive 'fatal error: System.h: No such file or directory'. The library is in the same directory but i think something different has to be do, Can you explain me how to modify single files without re-build everything? Thanks for the help and sorry for the off-topic!
from orb_slam2.
Hi @notenti, I managed to speed up loading with ORBvoc.bin.
But pagonlin and webcam still slow..
@carlosfarinhas were you able to solve this issue? I am actually not able to get live feed when I am using pangolin at all. Was wondering if you solved this.
Thank you very much!!
from orb_slam2.
Related Issues (20)
- running command build_ros.sh error HOT 1
- Why use float Type to store Descriptor Distances
- Failed to open settings file...
- ROS noetic ./build_ros.sh problems HOT 7
- I got an error when I tried to compile orb_slam2 with ubuntu22.
- I am getting this error while building the ORB_SLAM2 file please help.. I m running this on NVIDIA JETSON ORIN NANO
- Build failed on Ubuntu 22.04 and ros2 humble
- Stereo baseline of Da Vinci Xi surgical robot
- camera postion please ?
- Why not do `mpCurrentKeyFrame->AddMapPoint(pMP, i)` after `pMP->AddObservation(mpCurrentKeyFrame, i)` during LocalMapping::ProcessNewKeyframe ?
- KeyFrameTrajectory.txt?
- Fix cmake to work with new version of opencv please? I have 4.5.4 HOT 1
- Program does not go forward after initialization while doing rgb-d example.
- compilation issue -- ORB_SLAM2/Thirdparty/g2o/g2o/types/../core/openmp_mutex.h:30:10: fatal error: ../../config.h: No such file or HOT 2
- Running Stereo Node Error
- /usr/bin/ld: Cannot find -lEigen3::Eigen
- When using a undistored image as input image
- C++ Version and OpenCV version
- Gazebo and ORBSLAM
- Run Tracking, Local Mapping, and Loop Closure on a single thread
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from orb_slam2.