Homework Help Question & Answers

MATLAB help 75% ▼ Photoshoped Image Original Image 75% ▼ Photoshoped Image Original Image

75% ▼ Photoshoped Image Original Image

MATLAB help

75% ▼ Photoshoped Image Original Image
0 0
Next > < Previous
ReportAnswer #1

startingFolder = pwd; % or 'C:\Program Files\MATLAB' or wherever...

if ~exist(startingFolder, 'dir')

% If that folder doesn't exist, just start in the current folder.

startingFolder = pwd;

end

% Get the name of the file that the user wants to use.

defaultFileName1 = fullfile(startingFolder, '*.*');

[baseFileName1, folder1] = uigetfile(defaultFileName1, 'Select Bicubic file');

defaultFileName2 = fullfile(startingFolder, '*.*');

[baseFileName2, folder2] = uigetfile(defaultFileName2, 'Select Other method file');

if baseFileName1 == 0

% User clicked the Cancel button.

return;

end

fullSourceFileName1 = fullfile(folder1, baseFileName1)

if baseFileName2 == 0

% User clicked the Cancel button.

return;

end

fullSourceFileName2 = fullfile(folder2, baseFileName2)

% Read images to be differenced from source file names

firstImage = imread(fullSourceFileName1);

secondImage = imread(fullSourceFileName2);

% Resize images

firstImageresize = (imresize(firstImage, [504, 504])); % Bicubic Method

secondImageresize = (imresize(secondImage, [504, 504])); % Methods to compare

% Image difference

difference_image = double(secondImageresize) - double(firstImageresize);

imshow(difference_image)

% Saving results

% Create destination filename

destinationFolder = 'C:/Set5 [X2]';

if ~exist(destinationFolder, 'dir')

mkdir(destinationFolder);

end

% Strip off extenstion from input file

[sourceFolder, baseFileNameNoExtenstion, ext] = fileparts(fullSourceFileName1);

% Create jpeg filename. Don't use jpeg format for image analysis!

outputBaseName = [baseFileNameNoExtenstion, '.JPG']

fullDestinationFileName = fullfile(destinationFolder, outputBaseName);

% Write the jpg file. This will convert whatever format you started with to the hated jpg format.

imwrite(difference_image, fullDestinationFileName);

Know the answer?
Add Answer of:
MATLAB help 75% ▼ Photoshoped Image Original Image 75% ▼ Photoshoped Image Original Image
Your Answer: Your Name: What's your source?
Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
Need Online Homework Help?
Ask a Question
Get FREE Expert Answers
WITHIN MINUTES