def _runImp(self):
        if self._show_ui:
            self._image_file = str(QFileDialog.getOpenFileName (None, "Open Normal Image File", self._root_dir, "Image File (*.png *.jpg *.bmp)" ))

        if self._image_file is "":
            return

        self._scene.setImageFile(self._image_file)
        N_32F = colorToNormal(self._scene.image())
        self._scene.setNormal(N_32F)
        self._input_info = self._image_file
        self._root_dir = os.path.dirname(self._image_file)
Example #2
0
def loadNormal(file_path):
    C_8U = loadRGBA(file_path)
    if C_8U is None:
        return None

    A_8U = alpha(C_8U)
    rgb_8U = rgb(C_8U)
    rgb_8U = cv2.bilateralFilter(rgb_8U, 5, 0.1, 5)
    C_8U[:, :, :3] = rgb_8U
    C_8U[:, :, 3] = A_8U
    N_32F = colorToNormal(C_8U)
    N_32F = cv2.GaussianBlur(N_32F, (0, 0), 0.5)
    return N_32F, A_8U
Example #3
0
def loadNormal(file_path):
    C_8U = loadRGBA(file_path)
    if C_8U is None:
        return None

    A_8U = alpha(C_8U)
    rgb_8U = rgb(C_8U)
    rgb_8U = cv2.bilateralFilter(rgb_8U, 5, 0.1, 5)
    C_8U[:, :, :3] = rgb_8U
    C_8U[:, :, 3] = A_8U
    N_32F = colorToNormal(C_8U)
    N_32F = cv2.GaussianBlur(N_32F, (0, 0), 0.5)
    return N_32F, A_8U
    def _runImp(self):
        if self._show_ui:
            self._image_file = str(
                QFileDialog.getOpenFileName(None, "Open Normal Image File",
                                            self._root_dir,
                                            "Image File (*.png *.jpg *.bmp)"))

        if self._image_file is "":
            return

        self._scene.setImageFile(self._image_file)
        N_32F = colorToNormal(self._scene.image())
        self._scene.setNormal(N_32F)
        self._input_info = self._image_file
        self._root_dir = os.path.dirname(self._image_file)