/unshred

Experiments on darpa shredder challenge tasks using python & opencv.

Primary LanguagePythonMIT LicenseMIT

unshred

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

Installation

  • 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.

What it can (at the moment)

  • 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.

Development

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!

Requirements

Source files

I've included cropped version of task #1 of Darpa Shredder Challenge for the reference. For original files please visit their website

Speed

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.

Further reading

I've grabbed and implemented first steps of solution from wasabi team.