Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Strange camera_info #500

Open
5 tasks done
HowardWhile opened this issue Oct 5, 2019 · 1 comment
Open
5 tasks done

Strange camera_info #500

HowardWhile opened this issue Oct 5, 2019 · 1 comment

Comments

@HowardWhile
Copy link

HowardWhile commented Oct 5, 2019

ISSUE TEMPLATE ver. 0.3.0

  1. Which TurtleBot3 you have?

    • Waffle Pi
  2. Which ROS is working with TurtleBot3?

    • ROS 1 Kinetic Kame
  3. Which SBC(Single Board Computer) is working on TurtleBot3?

    • Raspberry Pi 3
  4. Which OS you installed in SBC?

    • Raspbian
  5. Which OS you installed in Remote PC?

    • Ubuntu 16.04 LTS (Xenial Xerus)

Hi ROBOTIS

When I try to initial raspberry pi camera by command.

roslaunch turtlebot3_bringup turtlebot3_rpicamera.launch

I found the camera parameter at "turtlebot3_bringup/camera_info/turtlebot3_rpicamera.yaml" is a little weird.

below is the parameters in the file.

image_width: 640
image_height: 480
camera_name: camera
camera_matrix:
  rows: 3
  cols: 3
  data: [322.0704122808738, 0, 199.2680620421962, 0, 320.8673986158544, 155.2533082600705, 0, 0, 1]
distortion_model: plumb_bob
distortion_coefficients:
  rows: 1
  cols: 5
  data: [0.1639958233797625, -0.271840030972792, 0.001055841660100477, -0.00166555973740089, 0]
rectification_matrix:
  rows: 3
  cols: 3
  data: [1, 0, 0, 0, 1, 0, 0, 0, 1]
projection_matrix:
  rows: 3
  cols: 4
  data: [329.2483825683594, 0, 198.4101510452074, 0, 0, 329.1044006347656, 155.5057121208347, 0, 0, 0, 1, 0]

the camera_matrix look like below

001.png

Refer to the description in opencv, (cx, cy) is a principal point that is usually at the image center.

And Consider the image length and width is 640x480.

(199.26, 155.25) is a little far from the image center (320, 240).

So I tried to recalculate the camera parameters follow this tutorials. The new parameters as follows:

image_width: 640
image_height: 480
camera_name: camera
camera_matrix:
  rows: 3
  cols: 3
  data: [509.002395, 0.000000, 327.562293, 0.000000, 506.358721, 245.259233, 0.000000, 0.000000, 1.000000]
distortion_model: plumb_bob
distortion_coefficients:
  rows: 1
  cols: 5
  data: [0.183372, -0.312891, -0.001562, 0.005458, 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: [521.060059, 0.000000, 331.136252, 0.000000, 0.000000, 521.592163, 244.694909, 0.000000, 0.000000, 0.000000, 1.000000, 0.000000]

Now I can calculate the correct tag posture through this camera_info.

The tag detection algorithm I use is this

Best Regards, and provide these messages for you.

@JaehyunShim
Copy link
Contributor

@HowardWhile

Thank you very much. I tested as your advice and I've got a result similar to yours. We will discuss it in the team and update our package. Thank you so much for your contribution.

Regards,
Ryan

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants