From bc394d4b86b22f0f7770c95c0010a927bc5d8444 Mon Sep 17 00:00:00 2001 From: darksouls4 <1627517214@qq.com> Date: Sun, 4 Aug 2019 12:49:27 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E4=B8=80=E4=B8=AA=E9=97=AA?= =?UTF-8?q?=E9=80=80bug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- BlindWatermark/BlindWatermark.py | 8 ++++---- GUI/BlindWatermark/BlindWatermark.py | 8 ++++---- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/BlindWatermark/BlindWatermark.py b/BlindWatermark/BlindWatermark.py index 1ee9360..83663d7 100644 --- a/BlindWatermark/BlindWatermark.py +++ b/BlindWatermark/BlindWatermark.py @@ -310,14 +310,14 @@ def extract(self,filename,out_wm_name): extract_wm_Y[wm_index] = extract_wm_Y.copy() extract_wm_U[wm_index] = extract_wm_U.copy() extract_wm_V[wm_index] = extract_wm_V.copy() - cv2.imwrite(out_wm_name,extract_wm.reshape(64,64)) + cv2.imwrite(out_wm_name,extract_wm.reshape(self.wm_shape[0],self.wm_shape[1])) path,file_name = os.path.split(out_wm_name) if not os.path.isdir(os.path.join(path,'Y_U_V')): os.mkdir(os.path.join(path,'Y_U_V')) - cv2.imwrite(os.path.join(path,'Y_U_V','Y'+file_name),extract_wm_Y.reshape(64,64)) - cv2.imwrite(os.path.join(path,'Y_U_V','U'+file_name),extract_wm_U.reshape(64,64)) - cv2.imwrite(os.path.join(path,'Y_U_V','V'+file_name),extract_wm_V.reshape(64,64)) + cv2.imwrite(os.path.join(path,'Y_U_V','Y'+file_name),extract_wm_Y.reshape(self.wm_shape[0],self.wm_shape[1])) + cv2.imwrite(os.path.join(path,'Y_U_V','U'+file_name),extract_wm_U.reshape(self.wm_shape[0],self.wm_shape[1])) + cv2.imwrite(os.path.join(path,'Y_U_V','V'+file_name),extract_wm_V.reshape(self.wm_shape[0],self.wm_shape[1])) if __name__=="__main__": diff --git a/GUI/BlindWatermark/BlindWatermark.py b/GUI/BlindWatermark/BlindWatermark.py index 0a62389..7773636 100644 --- a/GUI/BlindWatermark/BlindWatermark.py +++ b/GUI/BlindWatermark/BlindWatermark.py @@ -327,14 +327,14 @@ def extract(self,filename,out_wm_name): extract_wm_Y[wm_index] = extract_wm_Y.copy() extract_wm_U[wm_index] = extract_wm_U.copy() extract_wm_V[wm_index] = extract_wm_V.copy() - cv2.imwrite(out_wm_name,extract_wm.reshape(64,64)) + cv2.imwrite(out_wm_name,extract_wm.reshape(self.wm_shape[0],self.wm_shape[1])) path,file_name = os.path.split(out_wm_name) if not os.path.isdir(os.path.join(path,'Y_U_V')): os.mkdir(os.path.join(path,'Y_U_V')) - cv2.imwrite(os.path.join(path,'Y_U_V','Y'+file_name),extract_wm_Y.reshape(64,64)) - cv2.imwrite(os.path.join(path,'Y_U_V','U'+file_name),extract_wm_U.reshape(64,64)) - cv2.imwrite(os.path.join(path,'Y_U_V','V'+file_name),extract_wm_V.reshape(64,64)) + cv2.imwrite(os.path.join(path,'Y_U_V','Y'+file_name),extract_wm_Y.reshape(self.wm_shape[0],self.wm_shape[1])) + cv2.imwrite(os.path.join(path,'Y_U_V','U'+file_name),extract_wm_U.reshape(self.wm_shape[0],self.wm_shape[1])) + cv2.imwrite(os.path.join(path,'Y_U_V','V'+file_name),extract_wm_V.reshape(self.wm_shape[0],self.wm_shape[1])) self.valueChanged.emit(100) if __name__=="__main__":