|
|
@ -190,7 +190,7 @@ class Ui_MainWindow(QMainWindow):
|
|
|
|
self.file.setTitle(_translate("MainWindow", "文件"))
|
|
|
|
self.file.setTitle(_translate("MainWindow", "文件"))
|
|
|
|
self.actionOpen_pic.setText(_translate("MainWindow", "打开图片"))
|
|
|
|
self.actionOpen_pic.setText(_translate("MainWindow", "打开图片"))
|
|
|
|
|
|
|
|
|
|
|
|
def openpic(self):
|
|
|
|
def openpic(self): #打开需要修改的图像
|
|
|
|
print(cv2.__file__)
|
|
|
|
print(cv2.__file__)
|
|
|
|
address = QFileDialog.getOpenFileName(self, "选取图片", "./", "Image files(*.png *.jpg *.jpeg *.gif);;all files(*.*)")
|
|
|
|
address = QFileDialog.getOpenFileName(self, "选取图片", "./", "Image files(*.png *.jpg *.jpeg *.gif);;all files(*.*)")
|
|
|
|
self.filename = address[0]
|
|
|
|
self.filename = address[0]
|
|
|
@ -203,7 +203,7 @@ class Ui_MainWindow(QMainWindow):
|
|
|
|
cv2.imwrite('./tempPic.png', self.newPic)
|
|
|
|
cv2.imwrite('./tempPic.png', self.newPic)
|
|
|
|
# print("2")
|
|
|
|
# print("2")
|
|
|
|
|
|
|
|
|
|
|
|
def save(self):
|
|
|
|
def save(self): # 保存修改后的图像
|
|
|
|
saveAddress = QFileDialog.getSaveFileName(self, "保存文件", "./", "Image files(*.png *.jpg *.jpeg *.gif);;all files(*.*)")
|
|
|
|
saveAddress = QFileDialog.getSaveFileName(self, "保存文件", "./", "Image files(*.png *.jpg *.jpeg *.gif);;all files(*.*)")
|
|
|
|
print(saveAddress[0])
|
|
|
|
print(saveAddress[0])
|
|
|
|
if saveAddress[0]:
|
|
|
|
if saveAddress[0]:
|
|
|
|