Skip to content

Instantly share code, notes, and snippets.

@deltheil
Last active January 3, 2016 23:49
Show Gist options
  • Save deltheil/8537114 to your computer and use it in GitHub Desktop.
Save deltheil/8537114 to your computer and use it in GitHub Desktop.
Find circles centers with QuickBlob (a C library for blob detection)
# Get QuickBlob here: https://github.com/keenerd/quickblob
#
# QuickBlob comes as a C library. To use it within your own
# program you need to implement a few functions:
# https://github.com/keenerd/quickblob/blob/a2502b0/quickblob.h#L52-L72
#
# QuickBlob comes with a command-line tool that depends on DevIL library
# but you are free to use your own image processor while integrating the
# library into your program.
cd /path/to/quickblob
# 1. Download the input image
curl -o circles.jpg http://i.imgur.com/qJJsWD3.jpg
# 2. Use `csv-blobs` convenient tool (keep in mind it depends on DevIL library)
./csv-blobs white circles.jpg > out.csv
# This gives you the coordinates and size (radius here):
# X,Y,size,color
# 55.48,8.23,56,white
# 24.46,71.00,56,white
# 52.65,100.93,55,white
# 3. Visualize the outputs
python sample/show-blobs.py out.csv circles.jpg out.png
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment