Jump to content
    1. Welcome to GTAForums!

    1. GTANet.com

    1. GTA Online

      1. Updates
      2. Find Lobbies & Players
      3. Guides & Strategies
      4. Vehicles
      5. Content Creator
      6. Help & Support
    2. Red Dead Online

      1. Blood Money
      2. Frontier Pursuits
      3. Find Lobbies & Outlaws
      4. Help & Support
    3. Crews

    1. Grand Theft Auto Series

      1. Bugs*
      2. St. Andrews Cathedral
    2. GTA VI

    3. GTA V

      1. Guides & Strategies
      2. Help & Support
    4. GTA IV

      1. The Lost and Damned
      2. The Ballad of Gay Tony
      3. Guides & Strategies
      4. Help & Support
    5. GTA San Andreas

      1. Classic GTA SA
      2. Guides & Strategies
      3. Help & Support
    6. GTA Vice City

      1. Classic GTA VC
      2. Guides & Strategies
      3. Help & Support
    7. GTA III

      1. Classic GTA III
      2. Guides & Strategies
      3. Help & Support
    8. Portable Games

      1. GTA Chinatown Wars
      2. GTA Vice City Stories
      3. GTA Liberty City Stories
    9. Top-Down Games

      1. GTA Advance
      2. GTA 2
      3. GTA
    1. Red Dead Redemption 2

      1. PC
      2. Help & Support
    2. Red Dead Redemption

    1. GTA Mods

      1. GTA V
      2. GTA IV
      3. GTA III, VC & SA
      4. Tutorials
    2. Red Dead Mods

      1. Documentation
    3. Mod Showroom

      1. Scripts & Plugins
      2. Maps
      3. Total Conversions
      4. Vehicles
      5. Textures
      6. Characters
      7. Tools
      8. Other
      9. Workshop
    4. Featured Mods

      1. Design Your Own Mission
      2. OpenIV
      3. GTA: Underground
      4. GTA: Liberty City
      5. GTA: State of Liberty
    1. Rockstar Games

    2. Rockstar Collectors

    1. Off-Topic

      1. General Chat
      2. Gaming
      3. Technology
      4. Movies & TV
      5. Music
      6. Sports
      7. Vehicles
    2. Expression

      1. Graphics / Visual Arts
      2. GFX Requests & Tutorials
      3. Writers' Discussion
      4. Debates & Discussion
    1. Announcements

    2. Support

    3. Suggestions

*DO NOT* SHARE MEDIA OR LINKS TO LEAKED COPYRIGHTED MATERIAL. Discussion is allowed.

GTA V camera calibration parameters


yt1024
 Share

Recommended Posts

HI, does any on know how to gain the calibration parameters of camera.

By the way, a demo of changing from depth to point cloud will be greatly appreciated.

Link to comment
Share on other sites

Are you trying to do 3D reconstruction? The non-cooperative method for getting camera parameters is usually via feature-matching from multiple camera angles. You basically pass feature-extraction convolutions over your source images, and look for matches. If you have enough candidates, you can do a best fit for camera parameters and camera origins. Understanding projection matrices and optimization methods is basically a prerequisite here.

 

If you are working with a game, however, you can usually get projection matrix directly. If you are using something like RenderDoc to grab the depth buffer, you can usually grab the matrix parameters that are passed into the shader as well. Typically, you'll either have a transformation (model view) and a projection matrix, or just one matrix that is already a matrix product of these two. Either way, if you know how these matrices are constructed, you should be able to extract camera parameters. Although, you might have to do a bit of math to convert into whatever format your reconstruction software takes.

 

The point-cloud construction is fairly straight forward, though. Again, the assumption here is that you have the projection matrix, either from camera parameters or directly extracted from the engine. Compute gradient of your depth map. This gives you the X and Y components of the normal vectors in the screen space. Set the Z component to 1 and normalize. This gives you a full normal map to go along with your depth map. Now you need to back-project from screen space to world space. Each point on the depth map becomes a point in your cloud along with its normal. Keep in mind that normals are projected slightly differently from point coordinates. You can look up how normals and points are transformed from world space to screen space in pretty much any shader, and do the inverse. And that's it. You now have a point-cloud with normals. If you collect that data for multiple camera angles, you can run this through Poisson reconstruction, or whatever you plan to do with these.

 

Btw, I'd be surprised if somebody hasn't done a good chunk of this work already. Seems like extracting color/depth buffers + projection matrix from a game via RenderDoc, and generating world-space point clouds for these would be something somebody did as a project. I'd check github to see if there is either code you can use directly, or maybe just some bits and pieces you can use for inspiration.

Prior to filing a bug against any of my code, please consider this response to common concerns.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • 1 User Currently Viewing
    0 members, 0 Anonymous, 1 Guest

×
×
  • Create New...

Important Information

By using GTAForums.com, you agree to our Terms of Use and Privacy Policy.