-
Notifications
You must be signed in to change notification settings - Fork 92
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
How to save compressed images #80
Comments
Hey @collinabidi import time
def image_callback(self):
# get uncompressed fpv cam image
request = [airsim.ImageRequest("fpv_cam", airsim.ImageType.Scene, False, False)]
response = self.airsim_client_images.simGetImages(request)
img_rgb_1d = np.fromstring(response[0].image_data_uint8, dtype=np.uint8)
img_rgb = img_rgb_1d.reshape(response[0].height, response[0].width, 3)
# for saving, you can do :
cv2.imwrite(time.strftime("%Y%m%d-%H%M%S") + ".png", img_rgb) |
Can you share your python snippet as well? |
The only modification I've made is changing the |
Depht images? I thought we were only allowed to get rgb images from the front camera? |
I think he might be generating a dataset, afai can tell. |
I'm attempting to record both RGB and Depth images at the same time using two cameras. However, when I run the modified baseline_race.py script, saving the images uncompressed seems to be too much for my computer to handle.
When I try to save the compressed images, I get the error:
ValueError: cannot reshape array of size 122900 into shape (240, 320, 3)
I'm wondering how to get the dimensions of the compressed image so I can properly save it.
Additionally, help with efficiently saving both RGB and Depth images from two cameras would be greatly appreciated.
The text was updated successfully, but these errors were encountered: