Skip to content

homingos/QR-replacer-utility

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

QR Code Replacer Utility

with alpha-blending

A Python-based utility to detect, remove, and seamlessly replace QR codes within images using image processing algorithms.

This utility can be used to replace a QR at any position from a source image with the desired target QR. It works by operating differently for target QR's with background and without background.

Python OpenCV NumPy

Features

i) Robust Detection: Uses multi-strategy detection (Grayscale, Adaptive Thresholding, Inverted)

ii) Object Removal (Inpainting): Clean removal of the original QR code using the Telea inpainting algorithm

iii) Perspective Warping: Maps the new QR code to the exact 3D perspective of the original marker using Homography

iv) Alpha Blending: Supports transparent PNGs for the new marker, supporting graceful blending

v) Smart Contrast: Automatically detects dark backgrounds and inverts the new QR code colors (Black ↔ White) to ensure visibility.

Getting Started

  • Clone the repo
git clone https://github.com/homingos/QR-replacer-utility.git
  • install the requirements
python3 -m pip install -r requirements.txt
  • The script currently uses all samples images in the IMAGES folder. You can modify this behaviour in the script's driver code.
if __name__ == "__main__":
    ....
  • get to src folder
  • run the script
python3 main.py
  • now check the output files generated with prefix output_ in the src folder for corressponding images.

Pipeline

About

A Python-based utility to detect, remove, and seamlessly replace QR codes within images

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages