This is a repository for Camera/Radar data collection tools, including operating the sensors, image/radar data preprocessing, sensor calibration.
- Install Anaconda and MATLAB.
- Clone this repository to your local laptop.
- Setup Python environment in Anaconda Prompt:
cd cr-data-collector conda create --name datacol --file requirements.txt
- Download Spinnaker Python SDK
- Download Spinnaker Python SDK: https://www.flir.com/products/spinnaker-sdk/
- DOWNLOAD NOW => DOWNLOAD FROM BOX => Windows => Latest Python Spinnaker =>
x86:
spinnaker_python-1.23.0.27-cp36-cp36m-win32.zip
/ x64:spinnaker_python-1.23.0.27-cp36-cp36m-win_amd64.zip
- Activate conda env:
activate datacol
- Unzip downloaded Python SDK and follow
README.txt
"1.1 Installation for Windows". - Install MATLAB Engine API for Python by following the instruction: https://www.mathworks.com/help/matlab/matlab_external/install-the-matlab-engine-for-python.html
-
Activate conda env:
activate datacol
-
Run script:
python run_datacol.py
-
Set configurations:
There are several configurations need to be set as follows. If you input nothing, it will use the default values.
- Base directory: the place to store collected data. Default to be
D:\RawData
. - Sequence number: the number of sequences to be collected. Default to be 1. (if == 1, sequence name is needed; else, use
onrd_xxx
) - Sequence name: the name of the current sequence. Does not have default value.
- Frame rate: the frame rate of the camera. Default to be 30 FPS.
- Number of images: the number of images need to be collected in this sequence. Default to be 30.
Here is an example output of running this script:
(datacol) D:\data-collection-tools\cr-data-collector>python run_datacol.py Enter base directory (default='D:\RawData'): Enter sequence number (default=1): 3 Enter frame rate (default=30): Enter number of images (default=30): Input configurations: Base Directory: D:\RawData\2019_06_26 Sequence Number: 3 Sequence Name: ['2019_06_26_onrd012', '2019_06_26_onrd013', '2019_06_26_onrd014'] Framerate: 30 Image Number: 30 Are the above configurations correct? (y/n) y ......
- Base directory: the place to store collected data. Default to be
-
When all the configurations are set, press enter to start recording.
We use ROS to calibrate our camera(s).
ROS Kinetic installation instructions can be found here: http://wiki.ros.org/kinetic/Installation.
After install ROS, download Spinnaker SDK for our BlackFly S Cameras: http://wiki.ros.org/spinnaker_sdk_camera_driver. Follow the instructions to install drivers and run camera.
- Refer to http://wiki.ros.org/camera_calibration for the details first.
- Start ROS server:
roscore
- Start camera acquisition:
roslaunch spinnaker_camera_driver camera.launch
- Run camera calibration:
rosrun camera_calibration cameracalibrator.py --size 8x6 \\ --square 0.033 image:=/camera/image_raw camera:=/camera
- Move camera around the checkerboard to collect enough images and click "Calibrate" button.
- After calibration finished, click "Save" button.
- Copy calibration results to a desired destination:
cp /tmp/calibrationdata.tar.gz /mnt/nas_crdataset/
- Refer to http://wiki.ros.org/camera_calibration/Tutorials/StereoCalibration for the details first.
- Start ROS server:
roscore
- Start camera acquisition:
roslaunch spinnaker_camera_driver stereo.launch
- Run camera calibration:
rosrun camera_calibration cameracalibrator.py --approximate 0.1 \\ --size 8x6 --square 0.033 right:=/stereo/right/image_raw \\ left:=/stereo/left/image_raw right_camera:=/stereo/right \\ left_camera:=/stereo/left
- Move camera around the checkerboard to collect enough images and click "Calibrate" button.
- After calibration finished, click "Save" button.
- Copy calibration results to a desired destination:
cp /tmp/calibrationdata.tar.gz /mnt/nas_crdataset/