xinario / defocus_segmentation

LBP-based segmentation of defocus blur

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

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

CrHasher opened this issue · 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?

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

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.

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