I am generating images (thumbnails) from a video every 3 seconds. Now I need to discard/remove all the similar images. Is there a way I could this?
I generate thumbnails using FFMPEG. I read about various image-diff solutions like given in this SO post, but I do not want to do this manually. How and what parameters should be considered that could tell if a particular image is similar to other images present.
Advertisement
Answer
You can calculate the Structural Similarity Index between images and based on the score keep or discard an image. There are other measures you can use, but basically a method that returns a score. Try PIL or OpenCV https://pillow.readthedocs.io/en/3.1.x/reference/ImageChops.html?highlight=difference https://www.pyimagesearch.com/2017/06/19/image-difference-with-opencv-and-python/