Becoming an Image Ninja with help from Dewald Esterhuizen
- Posted: Jul 17, 2013 at 6:00 AM
- 18,117 Views
- 1 Comment
Loading User Information from Channel 9
Something went wrong getting user information from Channel 9
Loading User Information from MSDN
Something went wrong getting user information from MSDN
Loading Visual Studio Achievements
Something went wrong getting the Visual Studio Achievements
Today's we're going to highlight a series of posts from Dewald Esterhuizen. He's been posting a number of great image/bitmap examples that I thought you all might enjoy. Filters, etc are all the rage now right (okay, so maybe I'm a little behind...)
This article serves to provides a detailed discussion and implementation of a Stained Glass Image Filter. Primary topics explored include: Creating Voronoi Diagrams, Pixel Coordinate distance calculations implementing Euclidean, Manhattan and Chebyshev methods. In addition, this article explores Gradient Based Edge Detection implementing thresholds.
Zurich: Block Size 15, Factor 4, Euclidean
Stained Glass Image Filter
The Stained Glass Image Filter detailed in this article operates on the basis of implementing modifications upon a specified sample/input image, producing resulting images which resemble the appearance of stained glass artwork.
A common variant of stained glass artwork comes in the form of several individual pieces of coloured glass being combined in order to create an image. The sample source code employs a similar method of combining what appears to be non-uniform puzzle pieces. The following list provides a broad overview of the steps involved in applying a Stained Glass Image Filter:
- Render a Voronoi Diagram – Through rendering a Voronoi Diagram the resulting image will be divided into a number of regions. Each region being intended to represent an individual glass puzzle piece. The following section of this article provides a detailed discussion on rendering Voronoi Diagrams.
- Assign each Pixel to a Voronoi Diagram Region – Each pixel forming part of the source/input image should be iterated. Whilst iterating pixels determine the region to which a pixel should be associated. A pixel should be associated to the region whose border has been determined the nearest to the pixel. In a following section of this article a detailed discussion regarding Pixel Coordinate Distance Calculations can be found.
- Determine each Region’s Colour Mean – Each region will only express a single colour value. A region’s colour equates to the average colour as expressed by all the pixels forming part of a region. Once the average colour value of a region has been determined every pixel forming part of that region should be set to the average colour.
- Implement Edge Detection – If the user configuration option indicates that edge detection should be implemented, apply Gradient Based Edge Detection. This method of edge detection has been discussed in detailed in a following section of this article.
What's really awesome about his posts is the detail he goes into on the concepts behind the code. And of course, he releases the source and sample apps for each.
Here's another recent post.
This article illustrates and provides a discussion and implementation of Image Oil Painting Filters and related Image Cartoon Filters.
Sunflower: Oil Painting, Filter 5, Levels 30, Cartoon Threshold 30
Image Oil Painting Filter
The Image Oil Painting Filter consists of two main components: colour gradients and pixel colour intensities. As implied by the title when implementing this image filter resulting images are similar in appearance to images of Oil Paintings. Result images express a lesser degree of image detail when compared to source/input images. This filter also tends to output images which appear to have smaller colour ranges.
Four steps are required when implementing an Oil Painting Filter, indicated as follows:
- Iterate each pixel – Every pixel forming part of the source/input image should be iterated. When iterating a pixel determine the neighbouring pixel values based on the specified filter size/filter range.
- Calculate Colour Intensity - Determine the Colour Intensity of each pixel being iterated and that of the neighbouring pixels. The neighbouring pixels included should extend to a range determined by the Filter Size specified. The calculated value should be reduced in order to match a value ranging from zero to the number of Intensity Levels specified.
- Determine maximum neighbourhood colour intensity – When calculating the colour intensities of a pixel neighbourhood determine the maximum intensity value. In addition, record the occurrence of each intensity level and sum each of the Red, Green and Blue pixel colour component values equating to the same intensity level.
- Assign the result pixel – The value assigned to the corresponding pixel in the resulting image equates to the pixel colour sum total, where those pixels expressed the same intensity level. The sum total should be averaged by dividing the colour sum total by the intensity level occurrence.
That it? Oh no, not even close. Check out these other articles he's written;
That should give you enough data, information and, hopefully, knowledge toward your image ninja journey...