• Stars
    star
    1,158
  • Rank 40,041 (Top 0.8 %)
  • Language
    Jupyter Notebook
  • Created about 7 years ago
  • Updated over 2 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Project for Digital Image Processing

Automatic watermark detection and removal

This was a project that was built as part of project for CS663 (Digital Image Processing). This is a crude Python implementation of the paper "On The Effectiveness Of Visible Watermarks", Tali Dekel, Michael Rubinstein, Ce Liu and William T. Freeman, Conference on Computer Vision and Pattern Recongnition (CVPR), 2017.

Rough sketch of the algorithm

A watermarked image J is obtained by imposing a watermark W over an unwatermarked image I with a blend factor . Specifically, we have the following equation:

Where p = (x, y) is the pixel location. For a set of K images, we have:

Although we have a lot of unknown quantities (), we can make use of the structural properties of the image to determine its location and estimate its structure. The coherency of and W over all the images can be exploited to solve the above problem with good accuracy. The steps followed to determine these values are:

  • Initial watermark estimation and detection
  • Estimating the matted watermark
  • Compute the median of the watermarked image gradients, independently in the x and y directions, at every pixel location p.
  • Crop W_m to remove boundary regions by computing its magnitude and taking the bounding box of the edge map. The initial estimated watermark is estimated using Poisson reconstruction. Here is an estimated watermark using a dataset of 450+ Fotolia images.

watermark_est

  • Watermark detection: Obtain a verbose edge map (using Canny edge detector) and compute its Euclidean distance transform, which is then correlated with to get the Chamfer distance from each pixel to the closest edge. Lastly, the watermark position is taken to be the pixel with minimum distance in the map.

Multi-image matting and reconstruction

  • Estimate keeping fixed.
  • Watermark update - Update the value of keeping the rest fixed.
  • Matte update - Update the value of keeping the rest fixed.

Please refer to the paper and supplementary for a more in-depth description and derivation of the algorithm.

Results

Here are some of the results for watermarked and watermark removed images:




However, this is a rough implementation and the removal of watermark leaves some "traces" in form of texture distortion or artifacts. I believe this can be corrected by appropriate parameter tuning.

More information

For more information, refer to the original paper here

Disclaimer

I do not encourage or endorse piracy by making this project public. The code is free for academic/research purpose. Please feel free to send pull requests for bug fixes/optimizations, etc.

More Repositories

1

Image-Quilting-for-Texture-Synthesis

An implementation of the Image Quilting for Texture Synthesis algorithm by Alexei A. Efros and Willian T. Freeman
Python
83
star
2

objects-that-sound

Unofficial Implementation of Google Deepmind's paper `Objects that Sound`
Python
82
star
3

Adversarial-Pose-Estimation

A PyTorch implementation of the paper 'Adversarial PoseNet: A Structure-aware Convolutional Network for Human Pose Estimation' (https://arxiv.org/pdf/1705.00389v2.pdf)
Python
40
star
4

BC-regularized-GAIL

Official implementation of the paper `Augmenting GAIL with BC for sample efficient imitation learning` in PyTorch
Python
25
star
5

CS251

All our CS251 assignments
HTML
11
star
6

STNAdversarial

Code for "MA 3 : Model Agnostic Adversarial Augmentation for Few Shot learning"
Python
9
star
7

Crop-Disease-Detection

Used a modified AlexNet architecture for classification of 38 classes of healthy and diseased crops.
Java
6
star
8

Reward-bias-in-GAIL

Official implementation of the paper `Addressing reward bias in Adversarial Imitation Learning with neutral reward functions` in Tensorflow.
Python
4
star
9

gym-minigrid

The gym minigrid environment with some more custom grids
Python
4
star
10

Learn-to-Flap-v1

An extensive survey of methods for training a Flappy Bird AI (CS403 course project)
Python
3
star
11

bootstrap-themes

HTML
2
star
12

CS763

Computer Vision assignments
Python
1
star
13

CS316

CS316 assignments
C
1
star
14

MiniWebApps

CSS
1
star
15

Variational-Autoencoder-with-Arbitrary-Conditioning

PyTorch implementation (unofficial) of the ICLR 2019 paper 'Variational Autoencoder with Arbitrary Conditioning'
Python
1
star
16

G.R.A.S.P.

ITSP Project 2016
Python
1
star