I read that article, and it’s very good! But it didn’t explain how detect atmospheric blurring, since it’s not actually blurring, it’s distortion. To quote that article
even if the sharpest image is very clear, it may still be distorted in varying degrees around the frame So you can’t just score the frames by sharpness.
Assuming all images are compared to a reference shot as you suggested, how is the reference shot selected?
I’ve actually got my own ideas about how it could be done, but this is coming from a background in computer science, not from astronomy, so I don’t trust my solution.