You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Dears, thanks for you great job first. When I try add watermask of image, the output image quality degradation. But when I use watermask of text, the output is good, but text version is not robut for crop operation. Some code like following:
"import time
Dears, thanks for you great job first. When I try add watermask of image, the output image quality degradation. But when I use watermask of text, the output is good, but text version is not robut for crop operation. Some code like following:
"import time
加水印
import cv2
from imwatermark import WatermarkEncoder
tic = time.time()
bgr = cv2.imread('pic/ori_senwang.png')
wm = '@guofei9987威尼斯'
encoder = WatermarkEncoder()
encoder.set_watermark('bytes', wm.encode('utf-8'))
bgr_encoded = encoder.encode(bgr, 'dwtDctSvd') # dwtDct
print('take time:', time.time()-tic)
cv2.imwrite('output/test_wm.png', bgr_encoded)
解水印
import cv2
from imwatermark import WatermarkDecoder
bgr1 = cv2.imread('output/test_wm.png')
bgr1 = bgr1#[:1200, :800, ...]
decoder = WatermarkDecoder('bytes', 8*len(wm.encode('utf-8')))
watermark = decoder.decode(bgr1, 'dwtDctSvd')
print(watermark.decode('utf-8', 'replace'))"
The text was updated successfully, but these errors were encountered: