예제 #1
0
    def __doubleClickedItem(self, item):
        if self.radioBtn1.isChecked():
            self.image = Image.reversal(item.data(), self.copyMode)
        elif self.radioBtn2.isChecked():
            self.image = Image.addNoise(item.data(),
                                    self.noiseMode, self.noiseParams)
        elif self.radioBtn3.isChecked():
            self.image = Image.filtering(item.data(),
                                    self.filterMode, self.filterParams)
        elif self.radioBtn4.isChecked():
            self.image = Image.multiplyHSVPixels(item.data(), self.hsvConvParams)
        elif self.radioBtn5.isChecked():
            self.image = Image.rotate(item.data(), self.rotateParams)
        else:
            pass

        self.imgView.setCvImage(self.image)
        self.selectedItem = item
예제 #2
0
    def __clickedRunButton(self):
        self.setEnabled(False)
        for file in self.imageFiles:
            if self.radioBtn1.isChecked():
                image = Image.reversal(file, self.copyMode)
            elif self.radioBtn2.isChecked():
                image = Image.addNoise(file,
                                    self.noiseMode, self.noiseParams)
            elif self.radioBtn3.isChecked():
                image = Image.filtering(file,
                                    self.filterMode, self.filterParams)
            elif self.radioBtn4.isChecked():
                image = Image.multiplyHSVPixels(file, self.hsvConvParams)
            elif self.radioBtn5.isChecked():
                image = Image.rotate(file, self.rotateParams)
            cv2.imwrite(self.__makeNewFileName(file), image)

        QMessageBox.information(None, "処理完了",
                            "画像処理を施した画像複製が完了しました。")
        self.setEnabled(True)