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

Camera information #6

Closed
JD-ETH opened this issue Apr 2, 2020 · 3 comments
Closed

Camera information #6

JD-ETH opened this issue Apr 2, 2020 · 3 comments

Comments

@JD-ETH
Copy link

JD-ETH commented Apr 2, 2020

Is there a way to extract the camera information? Intrinsic parameters: focal length and image center. (Doesn't seem to have distortion). Thanks!

@ZacRavichandran
Copy link
Member

Yep, this can be done through tesse-interface using a CameraInformationRequest. This gives you the vertical field of view and camera resolution from which the focal length can be extracted.

The simulator uses a pinhole camera model, so there's no distortion.

Here's an example:

>>> from tesse.env import Env
>>> from tesse.msgs import CameraInformationRequest
>>> env = Env()
>>> camera_params = env.request(CameraInformationRequest())
>>> print(camera_params.metadata)

<TESSE_Agent_CameraInfo_v0.5>
  <camera_info>
    <name>rgb_left</name>
    <id>0</id>
    <parameters height='240' width='320' fov='60'/>
    <position x='-0.05' y='0' z='0'/>
    <rotation x='0' y='0' z='0' w='1'/>
    <draw_distance near='0.05' far='50'/>
  </camera_info>
  <camera_info>
    <name>rgb_right</name>
    <id>1</id>
    <parameters height='240' width='320' fov='60'/>
    <position x='0.05' y='0' z='0'/>
    <rotation x='0' y='0' z='0' w='1'/>
    <draw_distance near='0.05' far='50'/>
  </camera_info>
  <camera_info>
    <name>segmentation</name>
    <id>2</id>
    <parameters height='240' width='320' fov='60'/>
    <position x='-0.05' y='0' z='0'/>
    <rotation x='0' y='0' z='0' w='1'/>
    <draw_distance near='0.05' far='50'/>
  </camera_info>
  <camera_info>
    <name>depth</name>
    <id>3</id>
    <parameters height='240' width='320' fov='50'/>
    <position x='-0.05' y='0' z='0'/>
    <rotation x='0' y='0' z='0' w='1'/>
    <draw_distance near='0.05' far='50'/>
  </camera_info>
  <camera_info>
    <name>3pv</name>
    <id>4</id>
    <parameters height='240' width='320' fov='90'/>
    <position x='0' y='0.7' z='-1.2'/>
    <rotation x='0.1100685' y='0' z='0' w='0.993924'/>
    <draw_distance near='0.3' far='150'/>
  </camera_info>
  <camera_info>
    <name>instance_segmentation</name>
    <id>5</id>
    <parameters height='240' width='320' fov='60'/>
    <position x='0.05000019' y='0' z='0'/>
    <rotation x='0' y='0' z='0' w='1'/>
    <draw_distance near='0.05' far='50'/>
  </camera_info>
</TESSE_Agent_CameraInfo_v0.5>

@JD-ETH
Copy link
Author

JD-ETH commented Apr 3, 2020

perfect, thanks!

@YLD2306
Copy link

YLD2306 commented Apr 2, 2021

@JD-ETH @ZacRavichandran Hello, may I ask you how to calculate its matrix with these camera data?

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

No branches or pull requests

3 participants