BlurDetect DevLog — Day 1
BlurDetect is an Adobe Lightroom extension that allows you to discard all blurry photos from your catalogue during import. Follow along at https://github.com/jchau623/BlurDetect.
Start of the project.
I’ve completed the method of detecting blurriness of an image. I used the variance of the Laplacian function to produce a score on how blurry or sharp an image is. The higher the variance, the “sharper” it is. I’ve found it doesn’t work very well as-is.
The script performs slightly better when performed on JPEG images rather than Adobe DNG (RAW) files.
Next step is to normalize image brightness and contrast and observe how it affects the score. Hopefully it will improve accuracy. Although I can’t see how it could help lower the score for the first photo, as increasing brightness and contrast (which would be the effect of normalizing on that photo) should raise the score.
Another issue is how to integrate Python scripts into Lua. Lightroom plugins are written in Lua, and the work I have so far is written in Python. There exists (existed?) a Lua->Python bridge called lunatic-python but pip couldn’t find the package. An alternative is to call os.execute in Lua, but as I intend on processing images as they are imported, possibly thousands, I’m concerned about the performance hit of having to load the python script each time I load in a new image. Unfortunately I couldn’t find a way to import RAW photos in Lua — otherwise OpenCV is available on Lua too.