How to give camera calibration file to pylon_camera_node
I have been using pylon camera with ROS wrapper for Pylon camera, when I launch the camera node it gives a warning like :
Camera not calibrated
Now after this, I tried to calibrate the camera, but camera_calibration did not work with the chess board arrangements.
Is there some other way around for getting a calibration file, if someone could share this file, It will be a great help.
update :
I now have a calibration file but now I am stuck with how to connect it to default.launch in the pylon_camera package.
output : [ INFO] [1547464209.748992565]: CameraInfoURL needed for rectification! ROS-Param: '/pylon_camera_node/camera_info_url' = 'file://$(find pylon_camera)/config/ost.yaml' is invalid!
[ WARN] [1547464209.749079541]: Will only provide distorted /image_raw images!
[ INFO] [1547464209.752437458]: Startup settings: encoding = 'mono8', binning = [1, 1], exposure = 10000, gain = 0, gamma = 1, shutter mode = default_shutter_mode
[ INFO] [1547464209.752918934]: Start image grabbing if node connects to topic with a frame_rate of: 5 Hz
[ INFO] [1547464209.753128267]: Camera not calibrated
below is the .yaml calibration file :
image_width: 4024
image_height: 3036
camera_name: pylon_camera
camera_matrix:
rows: 3
cols: 3
data: [9504.116474, 0.000000, 1931.294425, 0.000000, 9545.602763, 1286.856136, 0.000000, 0.000000, 1.000000]
distortion_model: plumb_bob
distortion_coefficients:
rows: 1
cols: 5
data: [0.050703, 1.882744, -0.018441, 0.009456, 0.000000]
rectification_matrix:
rows: 3
cols: 3
data: [1.000000, 0.000000, 0.000000, 0.000000, 1.000000, 0.000000, 0.000000, 0.000000, 1.000000]
projection_matrix:
rows: 3
cols: 4
data: [9649.875977, 0.000000, 1945.998948, 0.000000, 0.000000, 9690.111328, 1269.925242, 0.000000, 0.000000, 0.000000, 1.000000, 0.000000]
I am not able to load this file with the pylon camera node, help me with this.
Asked by Prof. xavier on 2019-01-14 03:43:49 UTC
Answers
You should check the documentation at github/pylon_camera.
Common parameters
- camera_info_url The CameraInfo URL (Uniform Resource Locator) where the optional intrinsic camera calibration parameters are stored. (and don't forget the file://)
The parameter has to be an absolute path (without any commands like '$(find pylon_camera)').
Asked by NEngelhard on 2019-01-14 04:09:56 UTC
Comments
I knew about this parameter but I couldn't figure out which file will I have to link to this parameter.
Asked by Prof. xavier on 2019-01-14 04:33:46 UTC
The question is updated with the latest progress, please help me with this.
Asked by Prof. xavier on 2019-01-14 06:14:44 UTC
Comments
Camera calibration parameters are specific to a single camera, they are very sensitive to manufacturing differences. Different cameras of exactly the same model will be similar but not close enough for machine vision. I think you need to work on the camera_calibration some more, this does work.
Asked by PeteBlackerThe3rd on 2019-01-14 04:35:54 UTC
I tried to work with camera_calibration but the chess board does not calibrate, i mean the calibration node opens but nothing like normal calibration happens.
Asked by Prof. xavier on 2019-01-14 04:44:16 UTC
Okay, what you have just described is the problem we need to fix. Can you describe the type (size and number of squares) of calibration target you're using. Does it have a white border? what happens when you show it to the camera?
Asked by PeteBlackerThe3rd on 2019-01-14 05:27:33 UTC
Currently the camera is in a fixed setup, this is relevant because when chess board is kept under the camera, the board is not that far from the camera. Because of this camera can not see anything else but the board, board covers all of the camera. when running the camera node, nothing happens.
Asked by Prof. xavier on 2019-01-14 05:36:26 UTC
That sounds like the problem. the camera_calibration node needs to see the border of the chess board pattern to determine the orientation of the board. It sounds like you will have to either remove the camera from the setup to calibrate it or print a very small chess board.
Asked by PeteBlackerThe3rd on 2019-01-14 05:51:38 UTC
okay, I got my camera to calibrate, how do I connect this file to the launch file.
Asked by Prof. xavier on 2019-01-14 06:03:42 UTC
Can you post the contents of the YAML file
Asked by PeteBlackerThe3rd on 2019-01-14 06:36:06 UTC
yes, I have done the updating. And you were just right about the problem and it solved my first issue. Thank you for this. Now I am not able to load this file with pylon node.
Asked by Prof. xavier on 2019-01-14 06:41:21 UTC
Do you want to check that ''file://$(find pylon_camera)/config/ost.yaml' is the correct location of the file?
Asked by PeteBlackerThe3rd on 2019-01-15 07:02:31 UTC