I want to conclude that image is forged or not depending on below code.Please suggest solution.

5 ビュー (過去 30 日間)
function ela = generate_ela(filename)
if nargin > 1 | nargin < 1
error('usage: generate_ela(filename)');
end
img_orig = filename;
ula = imfinfo(img_orig);
disp(ula);
orig = imread(img_orig);
%msgbox(filename);
tempfile = 'H:\temp.jpg';
imwrite(orig,tempfile,'jpeg','Quality',73);
temp = imread(tempfile);
%delete(tempfile);
idiff = uint8(abs(double(orig)-double(temp))*30);
me = max(max(max(idiff)));
idiff = uint8(double(idiff)*255/double(me));
imwrite(idiff,'ela.jpg');
figure;
imshow(idiff);
end
  3 件のコメント
Walter Roberson
Walter Roberson 2018 年 9 月 16 日
The resulting image mostly detects sharp edges. It would be difficult to relate that to image forgery. For example run your code on car1.jpg
Pranav Joshi
Pranav Joshi 2018 年 9 月 21 日
@jonas Forged in the sense whether original image is tampered or not i.e edited in photoshop or any other editing tool

サインインしてコメントする。

回答 (1 件)

Image Analyst
Image Analyst 2018 年 9 月 16 日
Looks like you're just seeing the image images are equal or not. So you can bail on that code and just simply use isequal():
if isequal(orig, temp)
% No forgery
else
% Forgery - images don't match.
end

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by