Camera calibration
Line 13: | Line 13: | ||
=== Take test images === | === Take test images === | ||
− | + | The images must also have the test pattern ''near the corners'' of the images. | |
+ | |||
+ | Tape the test pattern on a solid frame, as a curved pattern will ruin the calibration. | ||
+ | |||
+ | Place the pattern in front of the robot. | ||
+ | |||
+ | Check using [[Robobot_software_description#View_the_stream | motion (Video stremaer)]]. | ||
+ | |||
+ | View the stream using a browser on port 8081, like http://10.197.216.165:8081/, but with the robot IP, move the pattern (or the robot) for an appropriate view: | ||
+ | |||
+ | local@jack:~ $ cd svn/robobot/raubase/build/ | ||
+ | local@jack:~/svn/robobot/raubase/build $ '''motion''' | ||
+ | [0:motion] [NTC] [ALL] conf_load: Processing thread 0 - config file /etc/motion/motion.conf | ||
+ | [0:motion] [NTC] [ALL] motion_startup: Logging to file (/home/local/.motion/motion.log) | ||
+ | ^C | ||
+ | |||
+ | Stop the video streamer (using ctrl-C) and let the '''raubase''' take the image. | ||
+ | |||
+ | |||
+ | local@jack:~/svn/robobot/raubase/build $ '''./raubase -i''' | ||
+ | # UService:: created directory log_20240123_094405.808/ | ||
+ | # UService::setup: Ignoring robot hardware (Regbot and GPIO) | ||
+ | # SpyVision:: disabled in robot.ini | ||
+ | # Video device 0: width=1280, height=720, format=MJPG, FPS=25 | ||
+ | # Camera is running (to stabilize illumination) | ||
+ | # UCam::run: read frame 0/11 | ||
+ | # ready to save | ||
+ | # found '%' in ini[camera][imageName] | ||
+ | # saved image to '''img/img_raw_20240123_094407.424.jpg''' | ||
+ | # saved image to img/img_rec_20240123_094407.424.jpg | ||
+ | # --------- terminating ----------- | ||
+ | # UCam::run: camera released | ||
+ | # UCam:: logfile closed | ||
+ | # UService:: configuration saved to robot.ini | ||
+ | |||
+ | The raubase saves the image in an '''img''' subdirectory, and the raw image name starts with '''img_raw_2024...'''. | ||
+ | |||
+ | Repeat this for 6-10 images with the pattern all around the camera view. | ||
− | |||
− | |||
@todo | @todo |
Revision as of 09:57, 23 January 2024
Back to Robobot
Back to Robobot software description
Camera calibration using openCV
Test pattern
The camera calibration test pattern is found here: https://github.com/opencv/opencv/blob/3.4/doc/pattern.png; print it.
Take test images
The images must also have the test pattern near the corners of the images.
Tape the test pattern on a solid frame, as a curved pattern will ruin the calibration.
Place the pattern in front of the robot.
Check using motion (Video stremaer).
View the stream using a browser on port 8081, like http://10.197.216.165:8081/, but with the robot IP, move the pattern (or the robot) for an appropriate view:
local@jack:~ $ cd svn/robobot/raubase/build/ local@jack:~/svn/robobot/raubase/build $ motion [0:motion] [NTC] [ALL] conf_load: Processing thread 0 - config file /etc/motion/motion.conf [0:motion] [NTC] [ALL] motion_startup: Logging to file (/home/local/.motion/motion.log) ^C
Stop the video streamer (using ctrl-C) and let the raubase take the image.
local@jack:~/svn/robobot/raubase/build $ ./raubase -i # UService:: created directory log_20240123_094405.808/ # UService::setup: Ignoring robot hardware (Regbot and GPIO) # SpyVision:: disabled in robot.ini # Video device 0: width=1280, height=720, format=MJPG, FPS=25 # Camera is running (to stabilize illumination) # UCam::run: read frame 0/11 # ready to save # found '%' in ini[camera][imageName] # saved image to img/img_raw_20240123_094407.424.jpg # saved image to img/img_rec_20240123_094407.424.jpg # --------- terminating ----------- # UCam::run: camera released # UCam:: logfile closed # UService:: configuration saved to robot.ini
The raubase saves the image in an img subdirectory, and the raw image name starts with img_raw_2024....
Repeat this for 6-10 images with the pattern all around the camera view.
@todo