I have an issue with Image sharpness calculation, iam trying to code the formula below , but iam getting error :
The formula is :
: 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) :
my_image = im2double(imread('lena512.tif'));
my_image1 = my_image(:,:,1);
sharpness = 0*A;
sharpness(i,j)= (temp (i-1,j)) + (temp(i+1,y) -temp(i,j-1)-temp(i,y+1);