We're in need of a library to do raster image to vector conversion, in the form of a Windows DLL.
Given an in-memory 2-color black-and-white monochrome image (composed of an array of bytes mapping to the image's individual pixels, the image's width in pixels, and the image's height in pixels), the library is expected to return a set of closed vector shapes closely approximating the original image.
Target is Windows. 32 and 64-bit flavors of Windows XP and Vista at a minimum, with a strong desire for Windows 2000 compatibility.
This is a programmer-centric project, and your buyer contact will be a software engineer.
A rough listing of requirements / design guidelines.
* Automatic. This will be applied on a per-frame basis to video files. Hence, it can't be driven on a frame-by-frame basis by user-input.
* Speed. Again, this will be applied on a per-frame basis to video files. The requirement *isn't* real-time. However, it needs to be reasonably fast.
* Memory Leak-free. Again, this will be applied on a per-frame basis to video files - memory leaks are not acceptable, given how frequently this will be run.
* Thread safe - can be called on multiple threads simultaneously.
* Closed shapes. The return data set will be composed of closed shapes made up of lines and quadratic curves. The expectation is the vectorized data will be composed of additive closed shapes defining "filled" space and subtractive closed shapes for defining "holes".
* Outline-able. We expect whole regions to be composed of a single shape - in addition to the filled shape, the vectors will also be used to highlight the edges of the image objects.
* Clockwise shape definitions. Vertices for the closed shapes are expected to be specified in a clockwise ordering.
* Space efficient output. One of the key reasons we're looking to vectorize the existing black-and-white images is to reduce the size of the data set compared to lossless compressed PNG encoding.
* High fidelity. We don't expect a perfect representation of the original image - that said, we do expect a very close approximation. The image data is primarily people, and an accurate approximation (including tricky features such as hair) is an important requirement.
* Scalable. The vector representation will be scaled to a wide range of sizes - hence, "shortcuts" to fake approximating the form will not be acceptable.
* Well Written, Maintainable Code. We will likely find need to internally extend and refactor this library - it's important we can follow the logic and cleanly update the code.
* Written in C / C++. Performance and maintainability are key requirements for us. We are amenable, however, to reasonable arguments to allow this code to be written in another appropriate language (C#, for example).
* Consumable in C, C++, and C#. The library needs to be consumable by C, C++, and C# applications. We don't expect this to introduce any complication to a properly written DLL.
The required target is Windows. 32 and 64-bit flavors of Windows XP and Vista at a minimum, with a strong desire for Windows 2000 compatibility. Considered a bonus if re-targetable onto Linux and OS X.
The current runtime environment is a Windows XP 64-bit machine, running on a quad-core Core2 processor with 4 gigs of memory. This is mentioned to give you a rough idea of what to expect from the current runtime environment - don't consider this a fixed-and-final target to code against.
And just to make it clear - simply drawing lines between each of the edge pixels to fake vectorization is *not* considered acceptable. The images *will* contain curves, and we fully expect any acceptable solution will properly handle those regions using quadratic curves.
* * *
Per feedback, a bit more explanation of what's being asked for, using images to illustrate the input and outputs of the library.
Imagine this is the input image:
<img src="[url removed, login to view]">
Now here's how it should be (ideally) processed:
<img src="[url removed, login to view]">
Note that there are 2 closed shapes - Shape 0 is the body (a filled shape), while the Shape 1 is the gap between the actor's legs (a subtractive shape). The two shapes together define a set of vectors that accurately re-creates the original image.
In this case, the library would have taken the input image data and returned the two closed vector shapes, allowing the caller to generate that image (first draw shape 0 filled with orange, then draw shape 1 filled with white, then draw shape 0 as a black line, then draw shape 1 as a black line).