Article from Theodore Gray, Co-founder, Director of User Interfaces
Full Article: http://blog.wolfram.com/2008/12/01/the-incredible-convenience-of-mathematica-image-processing/
Here’s a clown fish, and a command that breaks it into 40-pixel squares.
By the way, we’re seeing another neat thing about the integration of images with Mathematica’s typeset input/output system. This result isn’t an image, it’s a list of images. Lists are general things in Mathematica, and lists of images are no exception. For example, here are the image patches in reverse order.
And here they are sorted by average pixel value (roughly by brightness):
And here are the images sorted into a scatter plot where the x axis represents the red component, the y axis represents the green component, and the size represents the blue component. (Image processing commands are fully integrated and compatible with charting commands. This is, after all, Mathematica, where one comes to expect things to work with each other.)
See how all the green patches are smooth and all the red patches are high-contrast? It might be interesting to look at these patches in a similarity network rather than a scatter plot. Here’s some code to do that.
This function identifies patches that are similar in color, then connects them into a network. The parameter says how many neighbors to look at before building the network.
Remember how we made a Manipulate to play with the contrast of an image? How about a Manipulate to play with the number of neighbors?
No comments:
Post a Comment