I am studying referring to this post.
How to remove hidden marks from images using python opencv?
Unlike the content of the post...
On the contrary, I'd like to know how to write that hidden K2222xxxxxxxxxx in that HSV SPACE. Using the following source code, I changed the zkLdo.png image to cv2.cvtColor(copy, cv2.COLOR_BGR2HSV), and then separated it into channels, and inserted the hidden watermarking "K2222xxxxxxxxxx" like the captures image above, but the result did not come out the same as like that(The typed text in the image is not clearly visible, but you can see them when you look closely anyway...) Is there anyone who can advise on this matter? :)
added text in the HSV channel
Checking the result
import numpy as np
img = cv2.imread("D:\DOWN\zkLdo.png")
b, g, r = cv2.split(img) # split into B,G,R spaces
#b = cv2.GaussianBlur(b, None, 8)
copy = img.copy()
hsv_image = cv2.cvtColor(copy, cv2.COLOR_BGR2HSV)
out = cv2.cvtColor(hsv_image, cv2.COLOR_HSV2BGR)
bb, gg, rr = cv2.split(out) # split into B,G,R spaces
position = (10,100)
COLRED = (90,94,105) # RGB RED
COLCBLUE = (255, 0, 0) # RGC Blue
COLXXX = (35, 135, 141)
COLCRAY = (139, 160, 160)
COLTEST = (125, 50, 50)
HSV = cv2.putText(
bb, #numpy array on which text is written
"1234567890", #text
position, #position at which writing has to start
cv2.FONT_HERSHEY_SIMPLEX, #font family
2, #font size
COLTEST, #font color
2) #font stroke
cv2.imwrite('D:\DOWN\outputttt.png', cv2.merge((r,g,bb)))
plt.imshow(cv2.merge((r,g,bb)), cmap='gray')
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…