Question

if subtraction and scaling on images is possible in matlab then provide the source code for...

if subtraction and scaling on images is possible in matlab then provide the source code for them??

Homework Answers

Answer #1

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'

Know the answer?
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for?
Ask your own homework help question
Similar Questions
MATLAB CODE REQUIRED Consider the problem of estimating y(0.5) for the boundary-value problem y''+ y' =...
MATLAB CODE REQUIRED Consider the problem of estimating y(0.5) for the boundary-value problem y''+ y' = y + 2, y(0) = 0, y'(1) = 2. Find the solution using 2 approaches: (b) Use finite difference with n = 10.Please provide Matlab code. What is y(0.5) value with Matlab? (c) Using bvp4c. Please provide Matlab code. What is y(0.5) value with Matlab?
Use Matlab to calculate the probabilities in the following scenarios. Provide your code as well as...
Use Matlab to calculate the probabilities in the following scenarios. Provide your code as well as your answer. Hint: You will find the following Matlab functions useful: normcdf(), normrnd() (a) IQ tests are designed in such a way that the mean and standard deviation are equal to 100 and 15 respectively. What is the probability of having an IQ score of 130 or more? (b) What is the probability of having an IQ between 110 and 130? (c) Bolts for...
Please describe in as much detail as possible- Public Meetings As a data source for community...
Please describe in as much detail as possible- Public Meetings As a data source for community health planning from a population viewpoint. Thank you! Just need information on everything about them when doing a data assessment for community health for a population viewpoint. Please provide sufficient information on public community meetings. At least a paragraph or more. Thank you!
Create MATLAB code that will run statistics (min,max,mean,mode) on a selected column (just 1 column, not...
Create MATLAB code that will run statistics (min,max,mean,mode) on a selected column (just 1 column, not all of them). For example, if I want to run the statistics on the column 'age', it will only run it on that column and not the others. The file is cardio_dataset and each column is separated by commas. The sample file is the following: age,gender,height,weight,sys_bp,dia_bp,cholesterol_lvl,gluc_lvl,smoke,alco,active,cardio 50.3917808219178,2,168,62,110,80,1,1,0,0,1,0 55.4191780821918,1,156,85,140,90,3,1,0,0,1,1 51.6630136986301,1,165,64,130,70,3,1,0,0,0,1 48.2821917808219,2,169,82,150,100,1,1,0,0,1,1 47.8739726027397,1,156,56,100,60,1,1,0,0,0,0 60.0383561643836,1,151,67,120,80,2,2,0,0,0,0 60.5835616438356,1,157,93,130,80,3,1,0,0,1,0 61.8739726027397,2,178,95,130,90,3,3,0,0,1,1 48.4054794520548,1,158,71,110,70,1,1,0,0,1,0
find out what customers want, then provide it to them as cheaply and quickly as possible...
find out what customers want, then provide it to them as cheaply and quickly as possible is walmarts?
using matlab please present code for the following (ALL PARTS PLEASE AND THANK YOU) 1. No...
using matlab please present code for the following (ALL PARTS PLEASE AND THANK YOU) 1. No Input/No Output Write a function that has no input and no outputs. This function will simply display some text when it is called. (this is my code, are there suggestions for improvements?) function Display() disp('some text') end 2. 1 Input/No Outputs Write a function with one input and no outputs. This function will simply display a variable that is provided as an input argument....
This is a MATLAB question FOR ELECTRICAL AND ELECTRONIC ENGINEERING Implement a design that solve the...
This is a MATLAB question FOR ELECTRICAL AND ELECTRONIC ENGINEERING Implement a design that solve the problem below in Simulink; KNUST runs on four (4) energy sources, Hydro from ECG, Solar, Thermal and Biomass. The source of power that is selected at any time, is controlled by two (2) sensors, A and B. Hydro is selected if both sensor A and B is on. Solar is selected when sensor only A is on, Thermal is selected when only sensor B...
1. All of the following can provide source data except________. software to process the source data...
1. All of the following can provide source data except________. software to process the source data a scanning device at the grocery store a utility bill received in the mail a bar code reader 2. Sold goods for $650, credit terms net 30 days. Which journal would the company use to record this transaction? sales journal purchases journal cash disbursements journal general journal 3. A customer just charged $150 of merchandise on the company’s own charge card. Which special journal...
MATLAB save output as array this is my code so far, I'm going to need to...
MATLAB save output as array this is my code so far, I'm going to need to save these as arrays or vectors i think to take some statistics on them. how do i save each walkers position relitive to time I should end up with 1000x 1000 matrix i think or 1000 arrays walkers=1000; %walkers=input('how many walkers do you want to simulate?') N = 1000; %N = input('how many steps do you want?') for k= 1:walkers displacement= randn(1,N); x =...
1) Each of the following situations involves a possible violation of the rule on independence. For...
1) Each of the following situations involves a possible violation of the rule on independence. For each situation, (1) decide whether the Code of Professional Conduct has been violated, and (2) briefly explain how the situation violates (or does not violate) the Code of Professional Conduct. (a) Harry Brown is a partner in the Topeka office of Hedley & Co., CPAs. Harry's brother is employed in an audit-sensitive position by Jensen Appliances, a publicly held company in Kansas. Jensen Appliances...
ADVERTISEMENT
Need Online Homework Help?

Get Answers For Free
Most questions answered within 1 hours.

Ask a Question
ADVERTISEMENT