how to test for a specific watermark in an image with python2.7

331 views Asked by At

there is this project am currently working on, which requires me to watermark every uploaded image. i have tried series of examples online, but they are not giving me what i really want as result

for example

i have an image A with image B watermarked on it, the two images are of the same dimensions. i applied opacity of 0.5 on image B before placing it on image A

now, i would really appreciate if anyone could help with a boolean function to check if image A has already been watermarked with image B before watermarking it.

thanks.

2

There are 2 answers

1
primitivist On

This depends on several factors that you'll need to provide more information for.

For instance, how complex are these images? Is there a lot of noise? Are the images that are uploaded similar in any way, or are they heterogenous? Are the watermarks always the same, or are they different?

As a general principle for extracting objects from images, you should look into processes such as color deconvolution, thresholding, and blob extraction.

In short--some sample images would go a long way...

0
phourxx On

yeah, finally found a dubious way to solve the problem, by hiding a specific text on the alpha layer of the image after watermarking it using steganography.

so on every upload, i get the image, iterate through the lowest pixels of the image's alpha layer, then compare the result to the text. if the result matches the text, definitely, the image has been watermarked.