# Edge detection as image fidelity test

This post is a quick follow-up to Dithering, a very interesting post by Cris Luengo, developer of DIPimage, a free Matlab image analysis toolbox.

Dithering is a graphic method that arranges black and white pixels in an image with certain patterns, to make it appear as though there are many intermediate gray levels. It is used when working with limited palettes. In his post Cris compares several algorithms that perform dithering.

As I commented in the post, after reading it I thought of a way to quantify the effectiveness of the various methods in replicating the original image: we can use Canny and Sobel filters to detect edges on the dithered results, and on the original. I show some of these in the image matrix below:

Looking at these results I argued that the structure-aware dithering did a much better job at preserving the edges in the original and the Canny and Sobel picked up on this (as do our eyes when we look at the results in the top row).

# Image processing tips for geoscientists – 1

Today I would like to show a way to quickly create a pseudo-3D display from this map:

Original image

The map is a screen capture of a meandering river near Galena, Alaska, taken in Google Earth. I love this image; it is one of my favorite maps for several reasons. First of all it is just plainly and simply a stunningly beautiful image. Secondly, and more practically, the meanders look not too dissimilar to what they would appear on a 3D seismic time slice displayed in grayscale density which is great because it is difficult to get good 3D seismic examples to work with. Finally, this is a good test image from the filtering standpoint as it has a number of linear and curved features of different sizes, scales, and orientation.The method I will use to enhance the display is the shift and subtract operation illustrated in The Scientist and Engineer’s Guide to Digital Signal Processing along with other 3×3 edge modification methods. The idea is quite simple, and yet extremely effective – we convolve the input image with a filter like this one:

```0  0  0
0  1  0
0  0 -1```