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

0 Byte Images #2089

Closed
Baldins opened this issue Jul 19, 2019 · 2 comments
Closed

0 Byte Images #2089

Baldins opened this issue Jul 19, 2019 · 2 comments

Comments

@Baldins
Copy link

Baldins commented Jul 19, 2019

Hi,

while collecting images I get some of them of size 0 B.
Does someone know why it happens and what can I do for not let this happening anymore?

Thanks in advance!!!

@AloshkaD
Copy link
Contributor

This is a common problem, especially with drones. Add a sanity check to the image acquisition method that will generate a black image if your pipeline requires a continuous image stream, and you will lose a one or few frames but your pipeline won't break. Here's a sample code

responses = self.simGetImages([ImageRequest(0, ImageType.DepthPerspective, True, False)],vehicle_name)
        if (responses[0] == None):
            print("Camera is not returning image, please check airsim for error messages")
            sys.exit(0)
        img1d = np.array(responses[0].image_data_float, dtype=np.float)
        img1d = 255/np.maximum(np.ones(img1d.size), img1d)
        if (len(img1d) != (144*256)):
            print('The depth camera returned bad data so Im creating zero array to not break the training')
            img1d=np.ones(144*256)
            img2d = np.reshape(img1d,(144, 256))```

@Baldins
Copy link
Author

Baldins commented Jul 25, 2019

Thank you! This is great! :)

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

2 participants