Ejemplo n.º 1
0
    def process_lut(self, image_path, meta_path=None):
        """
        Takes a raw data image and converts it to a 8 bit RGB image with for visual inspection.
        Images are applied with an hand crafted image enhancement process including a gamma correction and
        contrast enhancement. This approach reimplements the process for the images in cam_stereo_left_lut.
        """
        image_raw = read_tiff_image(image_path)
        if meta_path is not None:
            meta = read_meta_file(meta_path)
        else:
            meta = None
        if self.DEBUG:
            check_image(image_raw)
        image = self.decompand_lut[image_raw]

        if parse_day_night(meta):
            image_lut = self.daytime_lut[image]
        else:
            image_lut = self.nighttime_lut[image]
        image_bayer = cv2.cvtColor(image_lut, cv2.COLOR_BAYER_GB2BGR)

        image_bit = np.right_shift(image_bayer, 8).astype(np.uint8)
        image_bit = apply_clahe_8bit(image_bit)
        self.PC.rectifyImage(image_bit, image_bit)
        return image_bit
Ejemplo n.º 2
0
 def process_rect_gated(self, image_path):
     """
     Takes a raw data gated image and converts it to a rectified 10 bit grayscale image
     """
     image_raw = read_tiff_image(image_path)
     if self.DEBUG:
         check_image(image_raw)
     self.PC.rectifyImage(image_raw, image_raw)
     return image_raw
Ejemplo n.º 3
0
 def process_rect_decompand(self, image_path):
     """
     Takes a raw data image and converts it to a decompanded rectified 16 bit image.
     """
     image_raw = read_tiff_image(image_path)
     image_bayer = cv2.cvtColor(image_raw, cv2.COLOR_BAYER_GB2BGR)
     self.PC.rectifyImage(image_bayer, image_bayer)
     image_decomp = self.decompand_lut[image_bayer]
     return image_decomp
Ejemplo n.º 4
0
 def process_rect(self, image_path):
     """
     Takes a raw data image and converts it to a rectified 12 bit RGB image
     """
     image_raw = read_tiff_image(image_path)
     if self.DEBUG:
         check_image(image_raw)
     image_bayer = cv2.cvtColor(image_raw, cv2.COLOR_BAYER_GB2BGR)
     self.PC.rectifyImage(image_bayer, image_bayer)
     return image_bayer
Ejemplo n.º 5
0
 def process_rect_lut_gated8(self, image_path):
     """
     Takes a raw data gated image and converts it to a rectified bit shifted 8 bit grayscale image
     """
     image_raw = read_tiff_image(image_path)
     if self.DEBUG:
         check_image(image_raw)
     image_raw = self.gated_lut[image_raw]
     image_raw = np.right_shift(image_raw, 2).astype(np.uint8)
     clahe = cv2.createCLAHE(clipLimit=2.0, tileGridSize=(8, 8))
     return clahe.apply(image_raw)
Ejemplo n.º 6
0
    def process_rect8(self, image_path):
        """
        Takes a raw data image and converts it to a 8 bit RGB image with for visual inspection.
        Images are only rectified and bitshifted.
        """
        image_raw = read_tiff_image(image_path)
        if self.DEBUG:
            check_image(image_raw)
        image_bayer = cv2.cvtColor(image_raw, cv2.COLOR_BAYER_GB2BGR)
        self.PC.rectifyImage(image_bayer, image_bayer)
        image_bit = np.right_shift(image_bayer, 4).astype(np.uint8)

        return image_bit