TL;DR
G2D is an open-source tool that transforms Grand Theft Auto V (GTA V) into a high-fidelity data generator for computer vision research. By tapping directly into the game’s engine, it allows researchers to capture hyper-realistic urban imagery with perfect 6DOF ground truth poses across diverse weather, lighting, and traffic conditions.
What Problem Does This Paper Address?
Training and evaluating computer vision algorithms—specifically those dealing with geometry like Structure-from-Motion (SfM) and Visual SLAM—requires massive datasets with precise "ground truth" (the exact position and orientation of the camera).
Collecting this data in the real world is a logistical nightmare. High-precision sensors like differential GPS or LiDAR are expensive, and capturing the same street corner under varying conditions (e.g., clear day vs. rainy night) is time-consuming and often impossible to align perfectly. Furthermore, recent studies have shown that standard local feature detectors struggle significantly when environmental conditions change. The authors created G2D to bridge this gap, providing a way to generate "hyper-realistic" synthetic data where every variable is under the researcher's control.
Methods
G2D is built upon Scripthook V, a library that allows developers to access the native functions of the GTA V game engine. Unlike previous approaches that acted as "middleware" to intercept graphics commands and reconstruct meshes, G2D communicates directly with the game's internal state.
The workflow consists of three main components:
- Trajectory Creation: Users define a "sparse trajectory" by selecting vertices on a 2D map of the game world. G2D then automatically interpolates these to create a "dense trajectory"—a continuous path the camera will follow.
- Environmental Manipulation: A dedicated "condition tool" allows users to toggle weather (clear, rain, snow), time of day (daytime at 12:00 or nighttime at 23:00), and traffic/pedestrian density on the fly.
- Automated Retracing and Capture: Because the trajectory and environmental tools are independent, G2D can automatically retrace the exact same 6DOF path multiple times under different conditions. During this process, it captures frames at a standard video rate (60 fps) and logs the precise camera pose for every single frame.
The authors also implemented a clever "Unit Conversion" trick to map game units to meters. By measuring the average walking stride of the game's protagonist in game units and comparing it to the average human male stride (0.762m), they determined that 1 game unit is approximately 0.85 meters.
Datasets
The authors introduced a new dataset captured in the "Little Seoul" region of the GTA V map. It is divided into three blocks:
- Blk A: 7,372 images.
- Blk B: 6,092 images.
- Blk C: 7,658 images.
For their SfM demonstration, they used subsets of these images (roughly 300-400 per block) captured under clear, daytime conditions with zero traffic density.
Key Insights and Ideas
- Native Access vs. Middleware: By using native function calls, G2D avoids the errors associated with recovering poses from recorded meshes. It gets the "truth" directly from the engine.
- Perfect Alignment: The ability to retrace a trajectory means researchers can generate datasets where the only difference between two image sequences is the weather or lighting. This is a powerful tool for isolating why an algorithm might fail in the rain or at night.
- User-in-the-loop: While the capture is automated, the tool supports a "Third-person view mode" where a user can manually control the camera orientation while the protagonist follows the path, allowing for more natural, human-like camera movements.
Key Results
To prove G2D's utility, the authors ran the captured data through COLMAP, a state-of-the-art SfM pipeline. They used RANSAC to align the COLMAP reconstructions with the game's coordinate system.
The results showed that the synthetic data was highly effective for 3D reconstruction. As shown in Table 2 of the paper, the median error for camera positions was remarkably low:
- Blk A: 0.19m median error.
- Blk B: 0.07m median error.
- Blk C: 0.13m median error.
Limitations and Future Work
While the paper demonstrates strong results, a few limitations are inherent to this approach:
- Sim-to-Real Gap: While GTA V is visually impressive, there is still a domain gap between synthetic textures and real-world physics/lighting that might affect some deep learning models.
- Static vs. Dynamic: The SfM tests were performed with zero traffic density. Real-world urban environments are full of moving objects (cars, people) which present a much greater challenge for geometry-based vision.
- Software Dependency: The tool relies on Scripthook V and a specific version of GTA V, meaning updates to the game could potentially break the tool.
The authors have made G2D and the source code publicly available, encouraging the community to modify it for their own specific research needs.
Summary updated