SixQuant / Nowatermark
Licence: mit
remove watermark. 去除图片中的水印
Stars: ✭ 373
Programming Languages
python
139335 projects - #7 most used programming language
Projects that are alternatives of or similar to Nowatermark
Imaginary
Fast, simple, scalable, Docker-ready HTTP microservice for high-level image processing
Stars: ✭ 4,107 (+1001.07%)
Mutual labels: watermark
Autocrop
😌 Automatically detects and crops faces from batches of pictures.
Stars: ✭ 320 (-14.21%)
Mutual labels: opencv
Poseflow
PoseFlow: Efficient Online Pose Tracking (BMVC'18)
Stars: ✭ 330 (-11.53%)
Mutual labels: opencv
Mobilenet Ssd Realsense
[High Performance / MAX 30 FPS] RaspberryPi3(RaspberryPi/Raspbian Stretch) or Ubuntu + Multi Neural Compute Stick(NCS/NCS2) + RealSense D435(or USB Camera or PiCamera) + MobileNet-SSD(MobileNetSSD) + Background Multi-transparent(Simple multi-class segmentation) + FaceDetection + MultiGraph + MultiProcessing + MultiClustering
Stars: ✭ 322 (-13.67%)
Mutual labels: opencv
Perceptron
A flexible artificial neural network builder to analyse performance, and optimise the best model.
Stars: ✭ 370 (-0.8%)
Mutual labels: opencv
Libfaceid
libfaceid is a research framework for prototyping of face recognition solutions. It seamlessly integrates multiple detection, recognition and liveness models w/ speech synthesis and speech recognition.
Stars: ✭ 354 (-5.09%)
Mutual labels: opencv
Fingers Detection Using Opencv And Python
A simple Fingers Detection (or Gesture Recognition) using OpenCV and Python with background substraction 简单手势识别
Stars: ✭ 337 (-9.65%)
Mutual labels: opencv
Text Image Augmentation
Geometric Augmentation for Text Image
Stars: ✭ 333 (-10.72%)
Mutual labels: opencv
Blind Watermark
Watermark added to the frequency domain by Fourier transform
Stars: ✭ 344 (-7.77%)
Mutual labels: watermark
Emotion
😄 Recognizes human faces and their corresponding emotions from a video or webcam feed. Powered by OpenCV and Deep Learning.
Stars: ✭ 324 (-13.14%)
Mutual labels: opencv
Facemoji
😆 A voice chatbot that can imitate your expression. OpenCV+Dlib+Live2D+Moments Recorder+Turing Robot+Iflytek IAT+Iflytek TTS
Stars: ✭ 320 (-14.21%)
Mutual labels: opencv
Php Opencv Examples
Tutorial for computer vision and machine learning in PHP 7/8 by opencv (installation + examples + documentation)
Stars: ✭ 333 (-10.72%)
Mutual labels: opencv
Yoloface
Deep learning-based Face detection using the YOLOv3 algorithm (https://github.com/sthanhng/yoloface)
Stars: ✭ 339 (-9.12%)
Mutual labels: opencv
Pythonsift
A clean and concise Python implementation of SIFT (Scale-Invariant Feature Transform)
Stars: ✭ 374 (+0.27%)
Mutual labels: opencv
Cmake Templates
Some CMake Templates (examples). Qt, Boost, OpenCV, C++11, etc 一些栗子
Stars: ✭ 368 (-1.34%)
Mutual labels: opencv
nowatermark
Overview
remove watermark. 根据水印模板图片自动寻找并去除图片中对应的水印,利用 Python 和 OpenCV 快速实现。
Install
Mac OS Install OpenCV for Python3
- with-python3用来告诉homebrew用来让opencv支持python3,
- C++11 用来告诉homebrew提供c++11支持,
- with-contrib 用来安装opencv的contrib支持。
$ brew install opencv3 --without-python --with-python3 --c++11 --with-contrib
Verifying the installation:
import cv2
print(cv2.__version__)
If you got this error: "ImportError: No module named 'cv2'", then your symlink might be corrupted, you need to link your opencv to python site-packages:
$ brew link --force opencv3
Install nowatermark
$ pip3 install nowatermark
Usage
from nowatermark import WatermarkRemover
path = './data/'
watermark_template_filename = path + 'anjuke-watermark-template.jpg'
remover = WatermarkRemover()
remover.load_watermark_template(watermark_template_filename)
remover.remove_watermark(path + 'anjuke3.jpg', path + 'anjuke3-result.jpg')
remover.remove_watermark(path + 'anjuke4.jpg', path + 'anjuke4-result.jpg')
Original
Removed watermark
Procedure
Feature Matching(特征匹配)
- 对水印模板图片进行了一些初始化处理,比如二值化后去除非文字部分等
- 尝试了 OpenCV 的多种算法
- 比如 ORB + Brute-Force,即蛮力匹配,对应 cv2.BFMatcher() 方法
- 比如 SIFT + FLANN,即快速最近邻匹配,对应 cv2.BFMatcher() 方法
- 比如 Template Matching,即模板匹配,对应 cv2.matchTemplate() 方法
- 最后发现 Template Matching 最简单方便,效果也最好。
- 如果水印位置固定的话则可以跳过Feature Matching(特征匹配),直接进行下一步的Inpainting(图片修复)
Inpainting(图片修复)
- 修复图片前需要做一些前置处理
- 首先要得到图片的去水印 Mask 图片,即和待处理图片一样大小的除了水印部分的文字部分外其他部分全部是黑色的位图
- 因为前面对水印做了二值化等处理,最终效果发现会有水印轮廓,所以需要对 Mask 图片做一次膨胀处理覆盖掉轮廓
- 选用了Telea在2004年提出的Telea算法,即基于快速行进(FMM)的修复算法
- 对应 cv2.inpaint(img, mask, 5, cv2.INPAINT_TELEA)
- 对应论文:An Image Inpainting Technique Based on the Fast Marching Method (2004)
Todo
- 由于某些图片的水印和背景图片相似程度太高,如何提高水印位置的识别正确率
- 改进修复图片算法,可以考虑用深度学习来做做看?
- Google CVPR 2017, 《On the Effectiveness of Visible Watermarks》这个据说很牛的,回头可以读一读
License
Note that the project description data, including the texts, logos, images, and/or trademarks,
for each open source project belongs to its rightful owner.
If you wish to add or remove any projects, please contact us at [email protected].