Digital Image Forensics
Midterm Exam
Digital Image Forensics (GNM – 2347)
Note: Please follow below instructions carefully:
• You can ask me questions for clarification by email.
• You can refer to textbook/lecture slides/materials posted on blackboard.
• You can refer to the corresponding class-work assignments to find Matlab/Octave commands, if needed. I
have also provided all the commands that you’d need in the appendix.
• Upload your solutions to blackboard by the due date.
• If you need additional time, you can email me. .
- Take 25 images with your own digital camera/smartphone and apply realistic photo-manipulations of the
following types to each image:
• Copy-move forgery
• Image splicing
Create three folders Original, Copy-move and Splicing and store the original and manipulated images in their
respective folders. Upload the folders to Google drive and share the link.
- Take any 5 images from the 25 original images that you captured, convert to grayscale, and then apply the
following point operations:
• Thresholding (you can pick a reasonable threshold as per your choice)
• Digital Negative
• Histogram Equalization
For each image, create a subplot of 4 X 2 and show the original image, image resulted from thresholding, the
digital negative and the histogram equalized image, along with their corresponding histograms (see appendix
for Matlab/Octave commands). Save the subplot for each image as .png files and submit the subplots (you will
have 5 subplots corresponding to the 5 images).
- Take any 5 images from the original images and apply the edge detecting and blurring filters (Use the filters
given in the appendix). Save the filter outputs as .png images. For each image, submit the original image and
the two filter outputs.4. Take an image from the 25 original images and apply translation, flip, vertical and horizontal shear to the image
(see appendix for Matlab/Octave commands). Save the outputs as .png images and include with your
submission.
Appendix:
• To apply point operations, you can use the following commands:
- X = rgb2gray(imread(‘path to image’)); %Provide the path to the image file
- subplot(4, 2, 1), imshow(X);
- subplot(4, 2, 2), imhist(X);
- Y = (X > threshold); %Provide an integer from 0 to 255 for threshold
- subplot(4, 2, 3), imshow(Y);
- subplot(4, 2, 4), imhist(Y);
- subplot(4, 2, 5), imshow(255 – X); %Digital Negative
- subplot(4, 2, 6), imhist(255 – X);
- subplot(4, 2, 7), imshow(histeq(X)); %Histogram Equalization
- subplot(4, 2, 8), imhist(histeq(X));
• To apply blurring and edge-detecting filters, you can use the following commands:
- X = rgb2gray(imread(‘path to image’)); %Provide the path to the image file
- H1 = 1/169 * ones(13);
- Y = imfilter(X, H1);
- imshow(Y);
- H2 = [ -1 -1 -1 -1 -1; -1 -1 -1 -1 -1; -1 -1 24 -1 -1; -1 -1 -1 -1 -1; -1 -1 -1 -1 -1 ]
- Z = imfilter(X, H2);
- imshow(Z);
• You can use the following commands to apply the geometric operations:
- X = rgb2gray(imread(‘path to image’)); %Provide the path to the image file
- figure(1), imshow(flip(X, 1)); %Flip
- figure(2), imshow(flip(X, 2));
- Y1 = uint8(imtranslate(X, 90, 100, ‘crop’); %Translation
- Y2 = uint8(imtranslate(X, 90, 100, ‘wrap);
- figure(3), imshow(Y1);
- figure(4), imshow(Y2);
- T1 = maketform( ‘affine’, [1 0 0; 0.8 1 0; 0 0 1] ); %Horizontal Shear
- T2 = maketform( ‘affine’, [1 0.9 0; 0 1 0; 0 0 1] ); %Vertical Shear
- Z1 = imtransform( X, T1);
- Z2 = imtransform( X, T2);
- figure(5), imshow(Z1);
- figure(6), imshow(Z2);
- Digital Image Forensics