Question: Implement template _ matching _ SSD . m , and try to find the best threshold value for einstein 1 . jpg and einstein 2

Implement template_matching_SSD.m, and try to find
the best threshold value for einstein1.jpg and einstein2.jpg (save the output images as einstein1_ssd_output.jpg, einstein1_ssd_match.jpg, einstein2_ssd_output.jpg, einstein2_ssd_match.jpg)
PLEASE DO THIS IN MatLab using the pseudocode below
lab05_task2.m:
name = 'einstein1';
%name = 'einstein2';
img = im2double(imread(sprintf('%s.jpg', name)));
template = im2double(imread('template.jpg'));
%% SSD
threshold =???;
[output, match]= template_matching_SSD(img,template, threshold);
figure, imshow(output ./ max(output(:))); title('SSD output');
figure, imshow(match); title('SSD match');
imwrite(output ./ max(output(:)),
sprintf('%s_ssd_output.jpg', name));
imwrite(match, sprintf('%s_ssd_match.jpg', name));
template_matching_SDD.m:
for u =1+ shift_u : size(I1,2)- shift_u
for v =1+ shift_v : size(I1,1)- shift_v
x1=???; x2=???;
y1=???; y2=???;
patch = I1(y1:y2, x1:x2);
% SSD
value =???;
output(v, u)= value;
end
end
match =(output < threshold);

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!