For a difficult new project I have, I will need to extract geometric information about eye glasses directly from 2D pictures in order to reverse-engineer their 3D model as closely as possible. These pictures will be taken in a very controlled environment (object always having same position/orientation w.r.t. camera, lightning condition, uniform background, etc.).
As we will have hundreds of glasses to model, it will be necessary to be able to extract these features (mostly contours or regions) as automatically as possible in order to feed them to the Rhino primitive construction functions. That’s where image processing capability comes in! Googling a little, I found the following libraries having Python API.
SciKit-image: The most open license model, free for commercial development. Also has more features than SimpleCV (but less than Emgu CV).
Emgu CV: Wrapper to the whole OpenCV library but not free for commercial development. Maybe the most complete solution.
I remember that integrating NumPy and SciPy to Rhino was a difficult process needing some IronPython eggs ( Scipy and Numpy, Trying to import NumPy… ) so here are my questions:
Has anyone ever integrated such a library to work with Rhino IronPython scripts? If so, do you have installation guides, etc?
If not, do you have advice? Are some of the proposed libraries utterly incompatible with Rhino? What do you see as the main difficulties lying head?
I know this is a very open question and would welcome any hindsight before exploring the issue further…
I am working on a similar project for importing scanned mesh data in a
custom Grasshopper Component. A few years ago I wrote some comoponents that worked with Emgu CV and realtime Kinect Point Data from a v1 camera.
In my current project I am looking to:
-recrop rhino viewport based on glyph tracking
-use Emgu CV for facemark, and face detection
-convert facial features to reference points on scan
-model my project on top
I have successfully imported a rhino viewport, used face detection on it, and output a tracked image. My only suggestion so far, is to write your components on anything but Mac, as Emgu CV only distributes a license for 64bit for non Mac. I haven’t even been able to run Emgu CV Hello World on Mac.