ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question
1

camera calibration algorithm

asked 2019-01-20 08:33:20 -0500

updated 2019-02-03 10:53:24 -0500

Hello everyone ! I wanted to calibrate my camera ( Bus 001 Device 002: ID 058f:3881 Alcor Micro Corp.) screen I did everything that was written in this article

and tried with this video

But nothing happened

My algorithm of actions 1) git clone image_pipeline in folder src in catkin_ws 2) entered the folder catkin_ws then catkin_make 3) roscore in another terminal 4) source .devel/setup.bash 5) rosdep install camera_calibration

until this step everything is fine

6) then i checked what topics are running rostopic list (and now i have first trouble) i saw only
/rosout /rosout_agg (screen) although must see /camera/camera_info /camera/image_raw

then I leave it without attention and went to the next step. In a little window picture freezes and I saw in terminal bunch of errors with title: error data jpeg or something like that Camera calibration window doesn't see images from camera

screen 1 screen 2

Edit1 ___________________________________________________________________________________

New algorithm:

1)roscore

2)

alishka@alishka-HP:~$ roslaunch image_proc image_proc.launch
 ... logging to /home/alishka/.ros/log/fa2ad5b8-1f2e-11e9-8599-74e54303b47d/roslaunch-alishka-HP-6132.log
Checking log directory for disk usage. This may take awhile.
Press Ctrl-C to interrupt
Done checking log file disk usage. Usage is <1GB.

[/opt/ros/kinetic/share/image_proc/launch/image_proc.launch] requires the 'manager' arg to be set
The traceback for the exception was written to the log file

On this step I've already have a problem

3) rosrun nodes ( Hope I done it right)

 alishka@alishka-HP:~$ rosrun image_view image_view image:="camera/camera_raw
[ INFO] [1548265051.286360438]: Using transport "raw"

alishka@alishka-HP:~$ rosrun image_view image_view image:="camera/camera_info"
`[ INFO] [1548265273.871833006]: Using transport "raw"

Window freezes screen

    alishka@alishka-HP:~$ rostopic list
/camera/camera_inffo
/camera/camera_raw
/image_view_1548265232817137361/output
/image_view_1548265232817137361/parameter_descriptions
/image_view_1548265232817137361/parameter_updates
/image_view_1548265273554483909/output
/image_view_1548265273554483909/parameter_descriptions
/image_view_1548265273554483909/parameter_updates
/rosout
/rosout_agg

Edit 2

I've done camera calibration. I used a usb_cam package The whole problem was in terrible usb camera. I bought a new camera Logitech c615 and it worked perfectly

I edited cpp file where for source node was chosen video0 instead of video 1 in .launch file I did the same

Algorithm (If needed): 1) catkin_make and catkin_make install in a catkin_ws folder 2)roscore 3)source setup.bash in catkin_ws/devel in a folder 4) rosrun usb_cam usb_cam_node 5)rosrun camera_calibration cameracalibrator.py –size 8×6 –square 0.028 image:=/usb_cam/image_raw camera:=/usb_cam that's it Thanks to peteblackerthe3rd for help.

edit retag flag offensive close merge delete

Comments

Hi @Alishka2k15, I have similar camera module as you. I am just very curious if the calibration matrix you have works for me too. Can you share the intrinsic calibration matrix that you have.

Thanks!

NAGALLA DEEPAK gravatar image NAGALLA DEEPAK  ( 2021-04-05 06:58:46 -0500 )edit

1 Answer

Sort by » oldest newest most voted
4

answered 2019-01-20 13:30:33 -0500

updated 2019-01-24 06:04:34 -0500

Why are you building camera_calibration from source? It's part of the standard full installation of ROS, or you could install it using apt-get.

You describe the step

5) rosdep install camera calibration

Then your next step is so check the topics, but you haven't actually launched any nodes yet so we wouldn't expect any topics apart from the standard roscore ones.

To use the camera calibration package you'll first need to start a node to connect to your camera and publish its images on a topic, you have to get this working before even looking at camera calibration. Then you can start on section 3.1 of the tutorial to calibrate your camera.

One last hint, saying things like

bunch of errors with title: error data jpeg or something like that

is not very helpful. Please provide a full copy any paste of any error messages in future.

Update

Just to be clear, you're trying to determine the calibration parameters of your camera? The commands in your update are trying to run the image_proc pipeline, this is used to undistort images when you already know the camera calibration, but will not help you find that calibration in the first place.

The page you originally linked to describes the correct process for camera calibration. As stated in section 3.1 you have you start your camera driver node which you already have working then run the command:

rosrun camera_calibration cameracalibrator.py --size 8x6 --square 0.108 image:=/my_camera/image camera:=/my_camera

To start the calibrator, updating the command so that the calibration size and shape matches the one you're using. Follow the on screen instructions and after collecting enough images you should be able to calculate and save the calibration parameters for your camera. When this process is completed then you can setup your camera node again so it is using the new calibration data then test it using the image_proc pipeline.

Hope this makes sense.

edit flag offensive delete link more

Comments

Thank you for your helping. Your answer is very helpful ! About errors , I'll add exact errors soon. I realized my mistakes. I want to try again, can I ask you for help if something goes wrong?

Alishka2k15 gravatar image Alishka2k15  ( 2019-01-22 12:33:52 -0500 )edit

No problem, as away that why we're here.

PeteBlackerThe3rd gravatar image PeteBlackerThe3rd  ( 2019-01-22 12:55:13 -0500 )edit

I did it again with publishing the nodes (I think) , but i can't launch image_proc. Added new edits above. What I'm supposed to do?

Alishka2k15 gravatar image Alishka2k15  ( 2019-01-23 12:00:27 -0500 )edit

Sorry, It’s my first practice with ROS, so I can be very slow in some situations. I launched usb_cam_test and it was fine , in window I could see images from camera in real-time, so i thought that I just need to launch image_proc and some nodes , and it will be enough, but no

Alishka2k15 gravatar image Alishka2k15  ( 2019-01-23 12:22:22 -0500 )edit

Thanks for help. Now i know more and can move on. Спасибо большое ( on Russian language) Added new edits above

Alishka2k15 gravatar image Alishka2k15  ( 2019-02-03 08:31:39 -0500 )edit

Question Tools

3 followers

Stats

Asked: 2019-01-20 08:33:20 -0500

Seen: 614 times

Last updated: Feb 03 '19