Steve on Image Processing

October 23rd, 2007

Upslope area - Summary

Back in March I started writing about an algorithm implementation experiment for computing upslope area. Given an "image" whose pixel values are terrain elevations, the upslope area of a pixel is the area of the uphill terrain that drains through that pixel. I chose a paper that looked promising, and I wrote about my progress as I implemented the paper's techniques in MATLAB. Those implementations are available in an "upslope toolbox" on the MATLAB Central File Exchange.

Some of you have probably been scratching your heads, wondering why I've been writing so much about water flow and terrain analysis in an image processing blog. I want to conclude with some thoughts on that very point.

First, this series illustrates quite a few different image processing algorithm implementation techniques. If you implement image processing algorithms in MATLAB, I think it will be well worth your time to take a look. Here are a few of the useful nuggets you'll find:

  • Using morphological functions to find pixels with certain relationships to their neighbors. For example, using imerode and relational operators to find all pixels that have no downhill neighbors.
  • Using a binary image as a logical mask to index into another image. I use this technique all the time, and you should, too.
  • Using linear indexing to process sets of pixels. (Essential!)
  • Using linear index offsets to find neighbors of a set of pixels ("neighbor indexing").
  • Identifying connected groups of pixels that touch the image border.
  • Using a variety of Image Processing Toolbox functions, such as imregionalmin, roifill, bwselect, etc., to achieve different effects.
  • Using sparse linear systems to solve for pixel values that are linearly related to neighboring pixel values.
  • Visualizing algorithm output:
    • By superimposing a quiver plot on an image.
    • By superimposing one image transparently on another.

I also believe that terrain analysis techniques like this will continue to find application to other kinds of image processing and image analysis problems, just like the watershed transform did. Much of mathematical morphology applied to image processing is about ordering relationships between pixels and their neighbors, and the upslope area problem fits right into that category. In particular, I would guess that the influence and dependence maps will be useful for a variety of problems.

And hey, it was fun! And if I'm going to keeping writing new content here every week, it's just gotta be fun!

Enjoy.

Leave a Reply

Wrap code fragments inside <pre> tags, like this:

<pre class="code">
a = magic(3);
sum(a)
</pre>

If you have a "<" character in your code, either follow it with a space or replace it with "&lt;" (including the semicolon).


Steve Eddins manages the Image & Geospatial development team at The MathWorks and coauthored Digital Image Processing Using MATLAB. He writes here about image processing concepts, algorithm implementations, and MATLAB.

  • Steve: Kezia—Try imrotate.
  • kezia: steve, how to perform rotation of structuring element by 15 degrees. kindly answer my question. thank u kezia...
  • Steve: Tasha—I only accept comments that are relevant to the particular blog post or are questions or comments...
  • Tasha: Steve,I send you a comment here but still didn’t get any reply yet.I did not see my comment posted here...
  • Steve: Carsten—Thanks for your input.
  • Carsten: Another vote for either imtranslate.m, or at least a blurb in the imtransform help why pure translation...
  • Loren Shure: If you look towards the end of the fftfilt program, you will see that there’s a check to see if...
  • Steve: Sonja—My imwritesize submission on the MATLAB Central File Exchange might be helpful. It was posted...
  • Steve: Grant—Sorry, but it won’t be for R2010a. That development deadline has already passed.
  • Sonja: My publisher is wanting images for a new book to be 300 dpi. Only 5 of the 19 images are 300, the rest are...

These postings are the author's and don't necessarily represent the opinions of The MathWorks.