defocus_segmentation icon indicating copy to clipboard operation
defocus_segmentation copied to clipboard

What should one use to get sigle value from the generated map in python np.mean or np.var?

Open CrHasher opened this issue 4 years ago • 3 comments

I wonder which value would indicate better how sharp an image is from the generated map:

sharpness_map = lbpSharpness(img_gray, 21, 0.016)
sharpness = np.mean(sharpness_map)
# (or)
sharpness = np.var(sharpness_map)

Any suggestions?

CrHasher avatar Mar 31 '22 09:03 CrHasher

Seems like np.mean(sharpness_map) is giving good indication of the image sharpness.

cteckwee avatar Apr 05 '22 12:04 cteckwee

Seems like np.mean(sharpness_map) is giving good indication of the image sharpness.

After testing it a bit its what I ended up using.

CrHasher avatar Apr 05 '22 15:04 CrHasher

If you assume the ratio of the sharp region = the global sharpness of the image, the mean would be a good indicator.

xinario avatar Apr 07 '22 03:04 xinario