3 ms·
Ask HN: How could this forgery detection script be optimized?
So, I was reading about this doctored photo in the NYT Magazine:
http://minnesota.publicradio.org/collections/special/columns/news_cut/archive/2009/07/fakery_in_the_times.shtml
And I recalled seeing this blog post and python script a while back:
http://code.google.com/p/coding-experiments/source/browse/trunk/Python/detect_copymove.py
I grabbed the script and image in question from the NYT. I ran the script, and sure enough, several blocks of pixels came back as being copied.
Problem was–the script took almost 5 minutes to analyze the image.
Just curious if it could be optimized or, better yet, easily rewritten in C to be much faster.
- gorramit 17y agoAs the author says, the script is rather adhoc. The script errors out for me, but from the comments, the basic procedure is to break up a low-resolution version of the image into blocks, and then cluster these blocks on some criterion. Let me see if I can cook up something for you after work :) The simplest speedup I can see is to memoize the distance function calls.