-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathembeddwt.py
executable file
·33 lines (28 loc) · 1.32 KB
/
embeddwt.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
from DWT2 import *
from embed import *
if __name__ == '__main__':
imgOriginal = cv2.imread(
"/media/DATA/UDINUS/SMT 6/Advanced Image Processing/Project/Picture1.png")
imgOriginalDWT = waveleteTransform(imgOriginal)
height, width = imgOriginal.shape[:2]
imgWatermark = cv2.imread(
"/media/DATA/UDINUS/SMT 6/Advanced Image Processing/Project/tes.jpeg")
# imgWatermark = cv2.resize(imgWatermark, (width, height))
# imgWatermarkDWT = waveleteTransform(imgWatermark)
# imgWatermarkDWTLL = imgWatermarkDWT[0:height / 2, 0:width / 2]
alpha = 0.004
imgWatermarkedDWT = embed(
imgOriginalDWT, imgWatermark, 0, 0, width / 2, height / 2, alpha)
imgWatermarked = inverseWaveleteTransform(imgWatermarkedDWT)
imgWatermarkedDDWT = waveleteTransform(imgWatermarked)
watermark = extract(imgWatermarkedDDWT[0:height / 2, 0:width / 2],
imgOriginalDWT[0:height / 2, 0:width / 2], alpha)
cv2.imshow("Original", imgOriginal)
# cv2.imshow("OriginalDWT",imgOriginalDWT)
cv2.imshow("Watermark", imgWatermark)
# cv2.imshow("WatermarkDWT",imgWatermarkDWT)
# cv2.imshow("WatermarkedDWT",imgWatermarkedDWT)
cv2.imshow("Watermarked", imgWatermarked)
# cv2.imshow("Watermarked2",imgWatermarkedDDWT)
cv2.imshow("extract", watermark)
cv2.waitKey(0)