We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
I've used some portion of your code. In Client what I did to save the camera images:
cam_bp = world.get_blueprint_library().find('sensor.camera.rgb') cam_bp.set_attribute("image_size_x",str(800)) cam_bp.set_attribute("image_size_y",str(600)) cam_bp.set_attribute("fov",str(105)) cam_location = carla.Location(2,0,1) cam_rotation = carla.Rotation(0,90,0) cam_transform = carla.Transform(cam_location,cam_rotation) ego_cam = world.spawn_actor(cam_bp,cam_transform,attach_to=ego_vehicle, attachment_type=carla.AttachmentType.Rigid) def to_bgra_array(image): """Convert a CARLA raw image to a BGRA numpy array.""" array = np.frombuffer(image.raw_data, dtype=np.dtype("uint8")) array = np.reshape(array, (image.height, image.width, 4)) return array def to_rgb_array(image): """Convert a CARLA raw image to a RGB numpy array.""" array = to_bgra_array(image) # Convert BGRA to RGB. array = array[:, :, :3] array = array[:, :, ::-1] return array def image_callback(image): print("Image is coming") image_no = image.frame image_rgb = to_bgra_array(image) path = '~/output/' + str(image_no) cv2.imwrite(path +'.jpg', image_rgb) ego_cam.listen(lambda image: image_callback(image))
The text was updated successfully, but these errors were encountered:
No branches or pull requests
I've used some portion of your code.
In Client what I did to save the camera images:
The text was updated successfully, but these errors were encountered: