8

I am trying to find a good solution to detect if a UIImage is blurry. I have looked around quite a bit and most solutions are not swift ready or not too iOS friendly. I am trying to find a solution I can easily adopt in one of my iOS projects to detect if an image coming from the camera is blurry.

Any solution out there?

zumzum
  • 17,984
  • 26
  • 111
  • 172
  • I cant give you a programmatic solution. But have you tried to compare neighboring pixels in a certain radius? An image is blurry if pixel share a very similar rgb value to the next and to the next and so on. Theoretically, wouldnt you just need to compare the pixels and check if they fall in a certain threshold? – arvidurs Nov 15 '17 at 22:26
  • I saw some discussions on that approach. Probably I didn't understand how to actually accomplish that in Swift. – zumzum Nov 15 '17 at 22:44
  • There are plenty of good solutions. Just none that I know of that do the legwork for you. https://stackoverflow.com/a/7766036/793607 – HalR Nov 16 '17 at 17:00
  • 2
    Possible duplicate of [Is there a way to detect if an image is blurry?](https://stackoverflow.com/questions/7765810/is-there-a-way-to-detect-if-an-image-is-blurry) – Pibben Oct 18 '19 at 11:43

0 Answers0