webcam error
hamidreza07 opened this issue · comments
When running the Python script main_slam.py
with the following command for webcam mode:
python3 -O main_slam.py
I encountered the following error:
Traceback (most recent call last):
File "main_slam.py", line 115, in <module>
slam.track(img, img_id, timestamp) # main SLAM function
File "/home/hamid/Desktop/vio/new/2/pyslam/slam.py", line 133, in track
return self.tracking.track(img, frame_id, timestamp)
File "/home/hamid/Desktop/vio/new/2/pyslam/slam.py", line 511, in track
f_cur = Frame(img, self.camera, timestamp=timestamp)
File "/home/hamid/Desktop/vio/new/2/pyslam/frame.py", line 281, in __init__
self.kps = kps_data[:,:2]
IndexError: too many indices for array: array is 1-dimensional, but 2 were indexed
could you please help me?
Hi,
thanks for your feedback. Can you please share some info about your OS (specific config) and the install procedure you used?
Hi,
Thank you for your prompt response. I'm currently using Ubuntu 18.04 as my operating system, and I've set up a Conda environment to handle the installation process (I followed the installation procedure outlined in the README file).
-
Operating System: Ubuntu 18.04
-
Environment: Conda Environment
-
python version: 3.6.10
Best regards.
As reported in the main README, pyslam is based on Python and is not designed to have real-time performances. If you want to use your webcam, please, follow the instructions in the README.
https://github.com/luigifreda/pyslam#camera-settings
For convenience, I report them here.
If you want to use your camera, you have to:
- calibrate it and configure WEBCAM.yaml accordingly
- record a video (for instance, by using save_video.py in the folder calibration)
- configure the [VIDEO_DATASET] section of config.ini in order to point to your video.
The above notes are reported in the config.ini
https://github.com/luigifreda/pyslam/blob/master/config.ini#L101