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

Semantic segmentation colours not in the seg_rgbs.txt #2358

Closed
ivannson opened this issue Dec 25, 2019 · 6 comments
Closed

Semantic segmentation colours not in the seg_rgbs.txt #2358

ivannson opened this issue Dec 25, 2019 · 6 comments
Labels

Comments

@ivannson
Copy link

ivannson commented Dec 25, 2019

I am collecting some segmentation images, but upon displaying them, I found that the colours in my segmentation image do not correspond to any colours specified in seg_rgbs.txt.

This is the image produced:
Screenshot 2019-12-25 at 17 22 23

Data collection code snippet:

responses = client.simGetImages([
            airsim.ImageRequest("2", airsim.ImageType.DepthPerspective, compress = False, pixels_as_float = True),  #depth visualization image
            airsim.ImageRequest("0", airsim.ImageType.Scene, compress = False), #png format
            airsim.ImageRequest("0", airsim.ImageType.Segmentation, False, False)])

filename = 'images/segmentation/' + 'segmentation' + str(file_sequence)
        img1d = np.fromstring(responses[2].image_data_uint8, dtype=np.uint8) #get numpy array
        img_rgb = img1d.reshape(responses[2].height, responses[2].width, 3) #reshape array to 4 channel image array H X W X 3
        img_rgb = np.flipud(img_rgb) #original image is fliped vertically

        np.save(filename, img_rgb)

By looking at the colours, for example top left quadrant with a building in dark yellow, I get [203 174 42] as the rgb values, however this colour doesn't seem to correspond to any label seg_rgbs.txt.

@TDYbrownrc
Copy link

I am having similar issues. What version of Unreal engine are you using? I have seen this behavior on 4.19 and 4.23.

@ivannson
Copy link
Author

@TDYbrownrc I'm using 4.22.

The work around that I'm using right now is using infrared camera instead of segmentation view.

@averyehorvath
Copy link

I pulled in the latest changes of Airsim and updated to Unreal 4.24 and that fixed it for me

@jonyMarino
Copy link
Collaborator

@ivannson could you check?

@rajat2004
Copy link
Contributor

#2845 fixed this problem

@lucafei
Copy link

lucafei commented Oct 31, 2020

hello, @ivannson do you have checked the workaround #2845? For me i have also met this problem that colors in my segmentation image are not same with the RGB value specified in seg_rgbs.txt.

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

No branches or pull requests

8 participants