aitorzip / DeepGTAV

A plugin for GTAV that transforms it into a vision-based self-driving car research environment.
GNU General Public License v3.0
1.11k stars 275 forks source link

captured screen color changes #81

Open jackspp opened 6 years ago

jackspp commented 6 years ago

captured screen color changes and looks like img1: also, when i set gtav to fullscreen, it capture only black: like img2: img_62 img_50

jackspp commented 6 years ago

hope you could offer some suggestion to solve this problem, thanks!

jackspp commented 6 years ago

i am running this on window8

jackspp commented 6 years ago

also, if i change frame to other values, it would look like this img_0

fuenwang commented 6 years ago

My guess is that, the first problem is because the channel order of RGB is maybe RGB or BGR. So you can try to alternate the channel order of collected images and see the changes. For the second problem, the screenshot method of repo owner use is to capture the window of desktop by win32 api. However, in full screen mode, the api are not working. You can adjust to window mode( borderless) and it will work fine.

IanKirwan commented 6 years ago

In GTAV menu/settings/display you can set the display to borderless window with the dimensions of your display/GPU. So you can get effective full screen and still capture images.

If you change your capture frame size you will need to also change the size values if it is processed with frame2numpy to the same values otherwise you get garbled images.

Sometimes GTAV does strange things with colour but if you get it consistently then the RGB BGR issue mentioned above might be to blame.

xiaoli-chen commented 6 years ago

do remember, matplotlib is using RGB, and opencv is using BGR for plotting the image, you can use opencv to convert it easily.