Image processing library integration to Rhino (scikit-image, OpenCV, Emgu CV, etc)?

Hello,

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.
  • SimpleCV: Pretty basic but might do the job.

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:

  1. Has anyone ever integrated such a library to work with Rhino IronPython scripts? If so, do you have installation guides, etc?
  2. 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…

Anybody has ever done something similar?

Hi bmartin,
i’m trying to integrate Emgu CV (or something similar) into Ironpython, too.
Have you got some new about your try?

Hello,

I did not continue and found a workaround for my particular problem. That would be very good though and if you do it, I will surely test it!

Good luck!

Bruno

Anybody succeeded in integrating an image processing library into Rhino in the last 2 years?

Hi @bmartin,

Anything that supports .NET should do it. I see there is .NET support for Emgu CV. There are others (from a quick Google search).

https://imageprocessor.org/

http://www.rasteredge.com/how-to/csharp-imaging/imaging-processing/

https://devblogs.microsoft.com/dotnet/net-core-image-processing/

I’m sure there are others.

– Dale

Hi bmartin,

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.