It's been well documented that blurry images are the most damaging thing that a NeRF can receive. With that in mind, it's critical to select only the sharpest images to be used in a NeRF. However, depending on your dataset, it can be extremely tedious going through each image manually.
I received a link to FocusFrameFinder to greatly streamline the process. It auto culls blurry images, at the percentage determined by you! For instance, if you want it to remove 50% of the blurriest images, it will do so.
But don't worry about it deleting images. It merely shifts them into a new folder that can be viewed prior to deletion, so you can ensure that nothing important was deleted. Even if you want to manually review the final image set, this can serve as a helpful first round tool to reduce unusable images.
Once you have installed FocusFrameFinder, here's how to use it!
Fire up your terminal and run:
python focusframefinder.py
You'll be prompted to enter your image directory. Type in the full path, and hit
Enter
🏞.Let the program do its thing! It will calculate the focus measure for each image. (Don't worry, we've got a loading bar to keep you company! 🥳)
Once done, you'll see some nifty stats about your image focus measures - minimum, maximum, average, and median 📊. This will help you set your blurriness threshold.
You'll be prompted to enter the percentage of blurriest frames you want to move. Type it in and hit
Enter
🎯.Sit back and relax! Your blurry frames will be moved to a new sub-folder called
blurry
📦.
It uses the Variance of Laplacian method, which is the same one that Instant NGP utilizes as part of its transform.json process. It ascribes a "focus measure" score to each individual image to rank its sharpness.
For those curious, it is under an MIT license, so people are able to utilize it how they like. The Github page can be found here!
With datasets with shallow depth of fields, I would recommend manually checking each frame manually. I've seen Laplacian get confused by bokeh in an image and marking it as blurry, when the subject is sharp. That also being said, if you're using shallow depth of field images, NeRFs might not be the best use.
I love seeing innovations that help make sharper NeRFs for everyone! If you're building a tool that might help people create NeRFs, please get in touch with me!