I have an issue with Image sharpness calculation, iam trying to code the formula below , but iam getting error :
The formula is :
where
.and
: represents the horizontal/vertical gradient at pixel (x,y) obtained via the Sobel filter.then S is :
.and there is an issue with image gradient, if the image has no same hieght width the equation will not work ??
I have the code below for L(x,y) :
clear all;
my_image = im2double(imread('lena512.tif'));
my_image1 = my_image(:,:,1);
A=my_image1;
B=nan(size(A)+2);
B(2:end-1,2:end-1)=A;
sharpness = 0*A;
for i=2:size(A,1)+1,
for j=2:size(A,2)+1,
tmp(2,2)=nan;
sharpness(i,j)= (temp (i-1,j)) + (temp(i+1,y) -temp(i,j-1)-temp(i,y+1);
end
end
2 Comments
Direct link to this comment
https://se.mathworks.com/matlabcentral/answers/504843-image-sharpness-calculation#comment_795912
Direct link to this comment
https://se.mathworks.com/matlabcentral/answers/504843-image-sharpness-calculation#comment_795912
Direct link to this comment
https://se.mathworks.com/matlabcentral/answers/504843-image-sharpness-calculation#comment_795963
Direct link to this comment
https://se.mathworks.com/matlabcentral/answers/504843-image-sharpness-calculation#comment_795963
Sign in to comment.