def _to_bgra_array(self, image):
    'Convert a CARLA raw image to a BGRA numpy array.'
    if (not isinstance(image, carla.Image)):
        raise ValueError('Argument must be a carla.sensor.Image')
    array = np.frombuffer(image.raw_data, dtype=np.dtype('uint8'))
    array = np.reshape(array, (image.height, image.width, 4))
    return array
Convert a CARLA raw image to a BGRA numpy array.
def _to_bgra_array(self, image):
    
    if (not isinstance(image, carla.Image)):
        raise ValueError('Argument must be a carla.sensor.Image')
    array = np.frombuffer(image.raw_data, dtype=np.dtype('uint8'))
    array = np.reshape(array, (image.height, image.width, 4))
    return array