if subtraction and scaling on images is possible in matlab then provide the source code for them??
MATLAB Code:
close all
clear
clc
img1 = imread('img1.png');
img2 = imread('img2.png');
% Subtraction
img_diff = imsubtract(img1, img2);
figure
subplot(131), imshow(img1), title('Image 1')
subplot(132), imshow(img2), title('Image 2')
subplot(133), imshow(img_diff), title('Difference Image')
% Scaling
img1_scaled = imresize(img1, 2);
figure
subplot(121), imshow(img1), title('Input Image')
subplot(122), imshow(img1_scaled), title('Scaled Image')
imwrite(img1_scaled, 'img1_scaled.png')
Test Images:
Input File 'img1.png'
Input File 'img2.png'
Output File 'img1_scaled.png'
Get Answers For Free
Most questions answered within 1 hours.