Here is another variation in Python/OpenCV that does outline font for the watermark. Result = cv2.addWeighted(photo, 1, tiled_text, blend, 0)Ĭv2.imwrite("text_img_rot.png", text_rot)Ĭv2.imwrite("lena_tiled_rotated_text_img.jpg", result) Tiled_text = np.tile(text_rot, (yrepeats,xrepeats,1)) # tile the rotated text image to the size of the input Text_img = cv2.putText(text_img, text, (pad,ht+pad), cv2.FONT_HERSHEY_SIMPLEX, scale, (255,255,255), thickness) # add text to black background image padded all around (wd, ht), baseLine = cv2.getTextSize(text, cv2.FONT_HERSHEY_SIMPLEX, scale, thickness) Return cv2.warpAffine(image, M, (nW, nH)) # perform the actual rotation and return the image # adjust the rotation matrix to take into account translation # compute the new bounding dimensions of the image M = cv2.getRotationMatrix2D((cX, cY), -angle, 1.0) # (i.e., the rotation components of the matrix) # angle to rotate clockwise), then grab the sine and cosine # grab the rotation matrix (applying the negative of the # grab the dimensions of the image and then determine the center Blend the tiled, rotated text image with the input image.Tile out the rotated text image to the size of the input.Here is one way to do that in Python/OpenCV. Zoom in and you will find that not only lines but text and rounded symbols are curved and also name and rounded symbol with different opacity. That'd be a great help.ĮDIT1: If you look at this Example of Shutterstock. If someone can show me a way of doing the same in python. Note: I have gone through this link for watermark using Imagemagick but I need it in python. Thus, I'm only left to create a custom dataset doing the same watermark like from these websites and that's why I need to create same watermark like them on images from unsplash and so.Ĭan anyone please help me create same watermark which we can get from Shutterstock and Adobe Stock. I founded out that the resolutions, images are changed which makes it more worse. So, when I try to do same image using reverse image search. Thus I need to create a dataset from these websites Shutterstock, Adobe Stock, Fotolia and Canstock and manymore. After doing some homework, I got to this Google AI Blog which makes things worse. I am trying to create a GAN model which will remove watermark.
0 Comments
Leave a Reply. |