Make a virtual env. Install requirements.
mkvirtualenv superset
make deps
Followed these steps http://www.learnopencv.com/install-opencv-3-on-yosemite-osx-10-10-x/
Install OpenCV 2 on Mac OSX
brew tap homebrew/science
brew install opencv
Because running in a Python Virtualenv, we need to get access to OpenCV (installed as a system package). This is possible to do by creating a few symlinks.
ln /usr/local/lib/python2.7/site-packages/cv.py cv.py
ln /usr/local/lib/python2.7/site-packages/cv2.so cv2.so
Alternately, could try setting up a Virtualenv with the --system-site-packages
flag.
make test
make run
Detect cards
Find all cards in an image:
python vision.py -c find -f images/game/game001.jpg
Analyze features
Analyze a single card:
python vision.py -c analyze -f images/single-card/green-full-oval-1.png
You can pass the --display
flag to open a window with images analysis steps.
python vision.py -c analyze -f images/single-card/green-full-oval-1.png --display
It's also possible to pass a directory.
vision.py
will iterate over all .png
images in that directory.
python vision.py -c analyze -f images/single-card/
- add more images, and continue tuning algorithm
- rename fns to better explain the pipeline of steps
- detection - find card shaped items in an image
- classifaction - is it a card?
- feature extraction - given a card, what are its features (shape, number, etc)?
- morphology ex (for estimated rectangle shape of set cards)
- Template matching
- Shape Detection
- Square detection
- Circle detection
- OpenCV Python examples