I am currently using opencv, image and pygame for capturing frames from a hd webcam. What I want to achieve is to check if the captured frames are focused or not. This is aka focus testing but I couldn't come up with a solution in Python. IMHO problem can be reduced to determining the blurness percentage of each pixel and come up with a decision. What is the name of this algorithm I am seeking for ? Does anyone have any experience implementing similar algorithms in Python ?
I would appreciate any guidance.