2
\$\begingroup\$

I'm trying to measure sharpness through a script in order to measure sharpness across different devices.

My methodology:

  • I have a pattern with pure white and black stripes like this: enter image description here
  • I use HD printing, matte, no reflection or texture
  • I take a picture in exactly the same conditions

When I take the picture with a device, I then analyse the picture pixel by pixel. Of course, the picture will never be perfect but as testing conditions will always be the same, I should be able to compare sharpness.

So what I measure:

  • the amount of pixels in pure white (usually close to 0)
  • the amount of pixels in pure black (usually close to 0)
  • the amount of pixels in grey
  • the amount of pixels for everything else For each of those measurements, I have the amount of unique colors (in LAB format) as well as the sum of all pixels for each type of color.

From what I see with my eyes and what the pixels are saying, I see some common trends but I also see different directions I could take.

Some discoveries:

  • the number of distinct greys seems to give a good indication about sharpness (less distinct greys = more sharpness)
  • the difference of light greys (when L from lab color is >50) and dark greys (when L from lab color is <50) also seems to give a hint about sharpness/contrast as when the difference between both is big, sharpness is better

Do you have ideas of the criterias I should use to measure sharpness?

Thanks

\$\endgroup\$
12
  • 3
    \$\begingroup\$ Do you measure both tangentially and sagittally? Most lenses will differ slightly in each direction. Some lenses differ significantly between the two, especially near the edges and corners of the frame. \$\endgroup\$
    – Michael C
    Commented Jun 6, 2021 at 13:31
  • 3
    \$\begingroup\$ If you really want to do it right \$\endgroup\$
    – Michael C
    Commented Jun 6, 2021 at 14:02
  • 1
    \$\begingroup\$ Are you measuring lenses in the abstract without a camera? If not, the reality is that the camera will also affect your measurements to some degree. If you are using an auto focus camera and lens combination, you can save yourself a lot of wheel re-inventing by using existing products that already do this. One relatively inexpensive product I've used is Reikan FoCal focal-iq.com . If you're still determined to do it yourself, take a look at some of their analysis results like focal-iq.com/lenses/… \$\endgroup\$ Commented Jun 6, 2021 at 15:57
  • \$\begingroup\$ @MichaelC I have horizontal & vertical bars but as I'm looking at pixels values programmatically I take the easy route by measuring any deviation from the original white and black stripes \$\endgroup\$
    – Laurent
    Commented Jun 6, 2021 at 18:43
  • \$\begingroup\$ @user10216038 Thanks for the suggestion, I should have pointed out that I'm testing smartphone cameras which means that I can't run any software like for dslr? I need somehow to reverse engineer what the camera is measuring, compare with real life observation until the scripts produces something ok. \$\endgroup\$
    – Laurent
    Commented Jun 6, 2021 at 18:46

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Browse other questions tagged or ask your own question.