Git Product home page Git Product logo

dauphin1976 / imagetamperingdetection Goto Github PK

View Code? Open in Web Editor NEW

This project forked from pranavj2684/imagetamperingdetection

0.0 0.0 0.0 4.79 MB

An Image Tampering Detection and Localization using MATLAB. Here image tampering is majorly detected by ELA (Error Level Analysis) by identifying the areas where there are different compression levels. Original Picture is roughly at same compression level but a digitally modified image is at different compression levels. Using Lowpass filter that is weiner2 noise is removed from ELA output and using tophat and bothat contour of tampered is region is reconstructed by Morphological structuring.

License: Apache License 2.0

MATLAB 100.00%

imagetamperingdetection's Introduction

imagetamperingdetection

An Image Tampering Detection and Localization using MATLAB. IMAGE TAMPERING DETECTION AND LOCALIZATION USING ELA (Error-Level Analysis)

Step 1: Reading and extracting Metadata of an Image

Step 2: (Error Level Analysis) Error Level Analysis (ELA) permits identifying areas within an image that are at different compression levels. With JPEG images, the entire picture should be at roughly the same level. If a section of the image is at a significantly different error level, then it likely indicates a digital modification. ELA highlights differences in the JPEG compression rate. Regions with uniform colouring, like a solid blue sky or a white wall, will likely have a lower ELA result (darker colour) than high-contrast edges. The things to look for:

Edges: Similar edges should have similar brightness in the ELA result. All high-contrast edges should look similar to each other, and all low-contrast edges should look similar. With an original photo, low-contrast edges should be almost as bright as high-contrast edges. Textures:
Similar textures should have similar colouring under ELA. Areas with more surface detail, such as a close-up of a basketball, will likely have a higher ELA result than a smooth surface.

Surfaces: Regardless of the actual colour of the surface, all flat surfaces should have about the same colouring under ELA.

Look around the picture and identify the different high-contrast edges, low-contrast edges, surfaces, and textures. Compare those areas with the ELA results. If there are significant differences, then it identifies suspicious areas that may have been digitally altered.

Resaving a JPEG removes high-frequencies and results in less differences between high-contrast edges, textures, and surfaces. A very low quality JPEG will appear very dark.

Scaling a picture smaller can boost high-contrast edges, making them brighter under ELA. Similarly, saving a JPEG with an Adobe product will automatically sharpen high-contrast edges and textures, making them appear much brighter than low-texture surfaces. Disadvantages: • A single pixel change, or minor colour adjustment, may not generate a noticeable change in the ELA.

• Since JPEG operates on a grid, a change to any part of the grid will likely impact the entire grid square. You may not be able to identify exactly which pixel in the grid was modified.

• JPEG uses the YUV colour space. High contrast colors in the same grid, such as black and white, orange and blue, or green and purple (opposite ends of the YUV colour space), will usually generate higher ELA values than similar colours in the same grid.

• ELA only identifies what regions have different compression levels. It does not identify sources. If a lower quality image is spliced into a higher quality picture, then the lower quality image may appear as a darker region. • Scaling, recolouring, or adding noise to an image will modify the entire image, creating a higher error level potential.

• If an image is resaved multiple times, then it may be entirely at a minimum error level, where more resaves do not alter the image. In this case, the ELA will return a black image and no modifications can be identified using this algorithm.

• With Photoshop, the simple act of saving the picture can auto-sharpen textures and edges, creating a higher error level potential. This artifact does not identify intentional modification; it identifies that an Adobe product was used. (Remember: if someone needs to download a picture from their camera or resize a picture for the web, they are just as likely to reach for Photoshop as they are to use any other tool.) Technically, ELA appears as a modification because Adobe automatically performed a modification, but the modification was not necessarily intentional by the user.

• As mentioned above, rainbowing is not exclusive to Photoshop. The open source GIMP drawing program may introduce a little rainbowing and some high quality photos may contain rainbowing.

• NOTE: ELA is only one algorithm. The interpretation of results may be inconclusive. It is important to validate findings with other analysis techniques and algorithms.

Step 3: Calculating Luminosity of RGB channel of Entire image Here the luminosity i.e. The intensity of Red green and blue of all the pixels in the entire image is calculated. Here entire image is iterated and maximum value is retrieved from the RGB vectors of Image.

Step 4: Performing 2-D Adaptive Noise - removal Filtering wiener2 lowpass filters an intensity image that has been degraded by constant power additive noise. wiener2 uses a pixel-wise adaptive Wiener method based on statistics estimated from a local neighbourhood of each pixel.

Step 5: Creating Morphological Structuring Element and recreating morphological image using ‘bothat’ and ‘tophat’ operations

Syntax: SE = strel(shape,parameters) Description: SE = strel(shape,parameters) creates a structuring element, SE, of the type specified by shape. Here the Morphological opening and closing of an image is calculated using ‘bothat’ and ‘tophat’ functions.

imagetamperingdetection's People

Contributors

pranavj2684 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.