Skip to content

Copy-move forgery detection on digital images using Python Language

License

Notifications You must be signed in to change notification settings

nagyistge/image-copy-move-detection

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

24 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Copy-Move Detection on Digital Image using Python

This is an implementation of python script to detect a copy-move manipulation attack on digital image based on Overlapping Blocks.

This script is implemented with a modification of two algoritms publicated in a scientific journals:

  1. Duplication detection algorithm, taken from Exposing Digital Forgeries by Detecting Duplicated Image Region; Fast and smooth attack detection algorithm on digital image using principal component analysys, but sensitive to noise and post region duplication process (explained in the paper above)
  2. Robust detection algorithm, taken from Robust Detection of Region-Duplication Forgery in Digital Image; Slower and having rough result attack detection algorithm but are considered robust towards noise and post region duplication process

By modify those algorithm, this script will have a tolerance regarding variety of the input image (i.e. the result will be both smooth and robust, with a trade-off in run time)

Example of original and forgered image

Original image

Original image

Forgered image

Forgered image

GUI

GUI screenshoot

By default, the script will log entire detection process like so: Log screenshoot

Getting Started

Make sure you already have:

Also the required python libraries:

Starting

Running GUI version

  1. Run main_GUI.py
  2. A new window will apear, click open file and choose your image
  3. Click detect and the detection process will start
  4. After done, the detection result will be written in your CLI, while the result image will be shown in GUI

Running CLI version

By default, you can run it using main_CLI.py. But you can also modify it, or even make your own python script with the format below:

  1. Make sure to import CopyMoveDetection package
  2. Directly call function detect or detect_dir and give the proper parameter

Your scirpt will likely looks like so:

import CopyMoveDetection

# To detect all images on a single folder, use detect_dir function
CopyMoveDetection.detect_dir('your/directory/path/', 'your/result/directory/' [, blockSize])

# To detect single image on a certain path, use detect function
CopyMoveDetection.detect('your/directory/path/', 'your_image.png', 'your/result/directory/' [, blockSize])

If blockSize parameter was not given, the default value would be 32 (integer).

Built With

Authors

License

This project is licensed under the MIT License - see the LICENSE.md file for details

Acknowledgments

I mainly learnt how to do PCA on image using Python from here written by Jan Erik Solem, but the page has been erased. Shortly after knowing the page was gone, I found that the author are now founder & CEO at Mapillary (Hail, and hat tip).

About

Copy-move forgery detection on digital images using Python Language

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Python 100.0%