I am using Mathematica to explore the face detection feature of Core Image on Mac OS X Lion. To do this I have an Objective-C program which captures images from the iSight camera, runs face detection and logs the coordinates of any detected features, and then saves the image to the clipboard. I then switch to Mathematica and paste the captured image into one variable, and copy-and-paste the logged feature coordinates into another.
I've written a simple Mathematica function that can subsequently produce a "normalized" face image, but it would be helpful to be able to draw graphics on top of an image in order to visualize where features are and how they're oriented. When I naively try this I get the error: "Image is not a graphics primitive or directive."
Is there a simple way to draw (or composite) graphics on top of an image?
Answer
Show
can combine Image
and Graphics
:
a = ExampleData[{"AerialImage", "Oakland2"}];
b = Graphics[{Red, Thick, Circle[{400, 400}, 300]}];
Show[a, b]
In this way you can do it in a programmatic way. But you can also do this manually and interactively via right-click menu access to Drawing Tools:
Comments
Post a Comment