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

color and depth not synchronized #34

Open
chmnsk opened this issue Jul 15, 2018 · 8 comments
Open

color and depth not synchronized #34

chmnsk opened this issue Jul 15, 2018 · 8 comments

Comments

@chmnsk
Copy link

chmnsk commented Jul 15, 2018

Hi,

after successfully building and binding GTAVisionExport with my steam version GTA 5, I gathered some color and depth data. I checked those data, and find that sometimes depth and color data are not synchronized well... Here is a sample.

img_depth_concat_y_screenshot_16 07 2018

It happens when I shake view(camera) or other characters (or car) moves.
Is there any way to solve this problem? To get synchronized data?

Thanks!

@bachw433
Copy link

wait longer time right after Game.pause(true) can greatly improve this situation. (e.g., Script.wait(100), )
But actually, it will still exist about 1 frame offset between RGB scene and depth.
anyone solve this problem ?

@JiamingSuen
Copy link

JiamingSuen commented Aug 15, 2018

setting Game.TimeScale to zero resolves this issue.

            // slow down time to minimize moving pixel drift.
            Game.TimeScale = 0;
            CaptureTiff();
            Script.Wait(1); // for some reason this is necessary.
            Game.TimeScale = 1;

@bachw433
Copy link

on nice!!!!!! thx, it bothered me almost 2 weeks!!!
but how's Game.TimeScale really doing? is it like a switch?
any where do you get instructions of these functions? I can't find it in the script.

@JiamingSuen
Copy link

Game.TimeScale = 0 slows down the GTA world time, you may give any number between (0, 1).
It also took me a while to figure this out, glad it helps.

@bachw433
Copy link

bachw433 commented Aug 23, 2018

@JiamingSuen
the other problem is there's a little bit distortion on the outer ring of color image.
it would be very visible when a pole (or something like that stands near the boarder).
did you solve it?

notice the pole on the left side. In color image, the pole is arched.
0823_info1610_color
0823_info1610_depth

@JiamingSuen
Copy link

I'm not observing this issue on my machine, maybe a little tweak on camera FOV or render resolution would be helpful.

@bachw433
Copy link

bachw433 commented Aug 30, 2018

After doing some research, I found that lens distortion is GTAV's default setting according to this article.
And it can't be tweak in the game setting option.

The only way to turn it off is to modify the rendering parameters by some MOD tool. (here I use openIV)

  1. open the file timecycle_mods_1.xml in the path: Grand Theft Auto V \ update \ update.rpf / common / data / timecycle
    (open the update.rpf by openIV )

  2. within the block modifier name="NG_first"
    turn the following 2 parameters into 0
    <lens_dist_coeff>
    <lens_dist_cube_coeff>
    Then, there's no lens distortion in your first-person view.

Hope this information would be useful for someone who needs the perfect pixel-matching data between color image and depth image.

@ricgao
Copy link

ricgao commented Jul 8, 2019

After doing some research, I found that lens distortion is GTAV's default setting according to this article.
And it can't be tweak in the game setting option.

The only way to turn it off is to modify the rendering parameters by some MOD tool. (here I use openIV)

  1. open the file timecycle_mods_1.xml in the path: Grand Theft Auto V \ update \ update.rpf / common / data / timecycle
    (open the update.rpf by openIV )
  2. within the block modifier name="NG_first"
    turn the following 2 parameters into 0
    <lens_dist_coeff>
    <lens_dist_cube_coeff>
    Then, there's no lens distortion in your first-person view.

Hope this information would be useful for someone who needs the perfect pixel-matching data between color image and depth image.

Thanks!
I found another mod works in a similar way:
https://www.gta5-mods.com/misc/no-chromatic-aberration-lens-distortion-1-41

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

4 participants