nju-luke / watermarking

This is a project for watermarking using DWT and SVD。
18 stars 7 forks source link

how to embed a watermark into a colorful image not a grayscale #2

Closed wuguowei19880907 closed 5 years ago

wuguowei19880907 commented 5 years ago

@nju-luke hello! this is my code to do it ,but i find the watermarked.jpg has visible difference with the source jpg.


image = cv2.imread("timg.jpg")  # the timg.jpg is the source
B, G, R = cv2.split(image)
watermarking = watermarking()
# watermarking.watermark()
R = watermarking.watermark(R)
image = cv2.merge((B.astype(np.float), G.astype(np.float), R.astype(np.float)))
cv2.imwrite("hehe.jpg", image)  # the hehe.jpg is the watermaked.jpg

timg the timg.jpg hehe the hehe.jpg

nju-luke commented 5 years ago

Adding a watermark based on the wavelet transform has essentially modified the frequency information within the image, so the picture before and after watermarking will be slightly different.

wuguowei19880907 commented 5 years ago

thanks , i get it

Adding a watermark based on the wavelet transform has essentially modified the frequency information within the image, so the picture before and after watermarking will be slightly different.