Quote Originally Posted by Schoembie View Post
Hi Aubrey, I would love to know how you manage to create a proper 3D Grayscale from a photo? Which software are you using?
Hi
There are any number of ways to do it.
GIMP, Photoshop or any other image processing program can do it.
Blender can but Blender has an almost impossible learning curve unfortunately.
(for me anyway)
Programmatically I have done it in using the Microsoft "Visual Studio" development suite.
If I were to make a serious attempt to emulate the ArtCAM process I would use PHP and the Imagick library processing functionality simply because I "speak" fluent PHP and use it every day.
The fact that most web servers are FAR more powerful than my PC also makes the PHP route far more attractive.
However it is not simply a case of making it Greyscale and using the image to generate the height-map and then generating the tool path G-code.
If it was then that would be easy (relatively speaking anyway).
For example if we took an image of a Japanese Geisha girl and did a simple Greyscale conversion and used that to generate a tool path then consider this:
Her face is white which then translates into a shallow cut.
BUT her lips are a dark red which converts to a grey that is pretty dark.
A dark grey translates to a much deeper tool path which would mean that her lips would be indented and that would give a ridiculous looking result when machined.
ArtCAM somehow got around that using a processing step between generating the Greyscale and generating the tool path.
That process probably takes a look at the surrounding topography and somehow figures out that if a darker area (the lips in this case) is surrounded by a much lighter area (the white face) then the Heightmap for the lips needs to be inverted.
In other words it needs to be shallower than the "face" and "stick out" of the "face".
This is what they have gotten right in ArtCAM (and other expensive utilities) but I have not been able to find an open source project that has this sort of algorithm.
Once I know HOW they do it then emulating the process in PHP, Visual Studio or whatever would be relatively easy.
It would involve some pretty convoluted decision processing in the code but that is what computers do for us.
So what we need is someone who has the knowledge of just how the conversion from Greyscale to Heightmap works and to share that insight with us so that we can carry on and get this thing done.
The "obvious" approach is to establish the outer perimeter of the "face" and invert the direction of sudden and large changes towards the darker greys - that would work on the lips but what about the eyes?
On the eyes the makeup is darker than the face but the eyes are in fact recessed into the surface of the face so there a "simple single" processing rule would not give the required result.
Everyone needs to remember that humans recognize that it is a face and "knows" that the lips protrude and the eyes are recessed but all a computer "sees" is a shade of grey for one pixel.
We need an algorithm that will allow the conversion process to do what a human does so easily and that is where the difficulty is.
Computers without a program written by a human are infinitely less intelligent than even an ant so somehow we have to be able to "tell" it what to do programmatically.
ArtCam and others have figured that out - we need to know HOW they do it.