Question
function ImTest(imageToBeTested) %ImTest Checks the correctness percentage of the original image. Assumes %image is on a 0 255 scale. Do no rely on this entirely,
function ImTest(imageToBeTested)
%ImTest Checks the correctness percentage of the original image. Assumes
%image is on a 0 255 scale. Do no rely on this entirely, it will be more
%helpful the less errors are visable in your image.
load('check_data.mat')
s1=sum(imageToBeTested(:,:,1));
s2=sum(imageToBeTested(:,:,2));
s3=sum(imageToBeTested(:,:,3));
s4=sum(imageToBeTested(:,:,1),2);
s5=sum(imageToBeTested(:,:,2),2);
s6=sum(imageToBeTested(:,:,3),2);
s7=[s1,s2,s3];
s8=[s4;s6;s5];
val1=mean(abs(checkerR-s7))./256;
val2=mean(abs(checkerC-s8))./256;
error=(val1+val2)/2;
fprintf('Error is roughly %3.2f ',error);
end
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started