Experiments on Kurchenko Grand-Prix tasks using Python & OpenCV. It was also influenced by Darpa Shredder Challenge on early stages. It is a companion project for unshred-tag, web UI that allows to process individual shreds using power of a crowdsourcing
- Install pip
- Checkout codebase from github.
- Run
pip install -r requirements.txt
pip install -e . && cd unshred
- Run it on test file:
python split.py ../src/puzzle.tif
- If everything was ok it should create bunch of files in out/ dir, similar to those from the demo link above.
- Detect and remove background (also background of the scanner)
- Find pieces and separate them
- Ignore crapy pieces (too small at the moment)
- Detect pieces orientation and unify them (straighten and make vertical)
- Save pieces with alpha channel
- Detects some features to be used for future matching: top side of the piece, corners of contour, top/bottommost points, palette, geometry
- Suggest tags (like “has blue ink”)
- Can process files in batch mode
- Output debug info in nifty html with ability to review each detected piece in great detail.
Check features subdir for examples of feature detectors and interfaces they are using. If you have an idea or implementation of good features — contact me!
I've included cropped version of task #1 of Darpa Shredder Challenge for the reference. For original files please visit their website
On my oldie MBP 17" (2.66 Core I7, 8GB, SSD) it's roughly 10 seconds on first task from DARPA (4600x3600 px), 455 pieces.
I've grabbed and implemented first steps of solution from wasabi team.