The Unshredder
Instagram engineering challenge 'The Unshredder' implemented in Factor.
It works by comparing the chrominance of adjacent pixels at the edges of each stripe next to each other stripe.
This gives a score for each possible stripe pair. These scores are then summed for every combination of all the stripes as a full image.
The lowest of these is the most likely full, unshredded image.
Installing
Clone the project somewhere on your Factor root. It will then be available to use with USE: unshredder
or similar.
Usage
The unshred
word expects an image object on the stack and will leave a (hopefully) unshredded image.
Testing
To run the tests make sure the vocabulary is loaded (USE: unshredder
) and then "unshredder" test
. If there are no errors, then all is well.
License
Code is BSD license, same as Factor.
The orangutan test image is licensed under Creative Commons 2.0 attribution. The original by Humberto Moreno can be found here.