How to use the perception.image.Image.load_data function in Perception

To help you get started, we’ve selected a few Perception examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github BerkeleyAutomation / perception / perception / image.py View on Github external
def open(filename, frame='unspecified'):
        """ Opens a segmentation image """
        data = Image.load_data(filename)
        return SegmentationImage(data, frame)
github BerkeleyAutomation / perception / perception / image.py View on Github external
----------
        filename : :obj:`str`
            The file to load the data from. Must be one of .png, .jpg,
            .npy, or .npz.

        frame : :obj:`str`
            A string representing the frame of reference in which the new image
            lies.

        Returns
        -------
        :obj:`DepthImage`
            The new depth image.
        """
        file_root, file_ext = os.path.splitext(filename)
        data = Image.load_data(filename)
        if file_ext.lower() in COLOR_IMAGE_EXTS:
            data = (data * (MAX_DEPTH / BINARY_IM_MAX_VAL)).astype(np.float32)
        return DepthImage(data, frame)
github BerkeleyAutomation / perception / perception / image.py View on Github external
Parameters
        ----------
        filename : :obj:`str`
            The file to load the data from. Must be one of .png, .jpg,
            .npy, or .npz.

        frame : :obj:`str`
            A string representing the frame of reference in which the new image
            lies.

        Returns
        -------
        :obj:`IrImage`
            The new IR image.
        """
        data = Image.load_data(filename)
        data = (data * (MAX_IR / BINARY_IM_MAX_VAL)).astype(np.uint16)
        return IrImage(data, frame)
github BerkeleyAutomation / perception / perception / image.py View on Github external
Parameters
        ----------
        filename : :obj:`str`
            The file to load the data from. Must be one of .png, .jpg,
            .npy, or .npz.

        frame : :obj:`str`
            A string representing the frame of reference in which the new image
            lies.

        Returns
        -------
        :obj:`PointCloudImage`
            The new PointCloudImage.
        """
        data = Image.load_data(filename)
        return PointCloudImage(data, frame)
github BerkeleyAutomation / perception / perception / image.py View on Github external
Parameters
        ----------
        filename : :obj:`str`
            The file to load the data from. Must be one of .png, .jpg,
            .npy, or .npz.

        frame : :obj:`str`
            A string representing the frame of reference in which the new image
            lies.

        Returns
        -------
        :obj:`NormalCloudImage`
            The new NormalCloudImage.
        """
        data = Image.load_data(filename)
        return NormalCloudImage(data, frame)
github BerkeleyAutomation / perception / perception / image.py View on Github external
Parameters
        ----------
        filename : :obj:`str`
            The file to load the data from. Must be one of .png, .jpg,
            .npy, or .npz.

        frame : :obj:`str`
            A string representing the frame of reference in which the new image
            lies.

        Returns
        -------
        :obj:`ColorImage`
            The new color image.
        """
        data = Image.load_data(filename).astype(np.uint8)
        return ColorImage(data, frame)
github BerkeleyAutomation / perception / perception / image.py View on Github external
Parameters
        ----------
        filename : :obj:`str`
            The file to load the data from. Must be one of .png, .jpg,
            .npy, or .npz.

        frame : :obj:`str`
            A string representing the frame of reference in which the new image
            lies.

        Returns
        -------
        :obj:`BinaryImage`
            The new binary image.
        """
        data = Image.load_data(filename)
        if len(data.shape) > 2 and data.shape[2] > 1:
            data = data[:, :, 0]
        return BinaryImage(data, frame)
github BerkeleyAutomation / perception / perception / image.py View on Github external
Parameters
        ----------
        filename : :obj:`str`
            The file to load the data from. Must be one of .png, .jpg,
            .npy, or .npz.

        frame : :obj:`str`
            A string representing the frame of reference in which the new image
            lies.

        Returns
        -------
        :obj:`GrayscaleImage`
            The new grayscale image.
        """
        data = Image.load_data(filename)
        return GrayscaleImage(data, frame)