Skip to Main Content Skip to Search
File Exchange
MATLAB Newsgroup
Link Exchange
  Blogs  
 Contest 
MathWorks.com

Steve on Image Processing

May 21st, 2007

How do you spell “l”?

Early in my graduate school days, I once spent a couple of days poring over code listings trying to find the cause of a mysterious bug. Eventually I discovered that the code had a "1" somewhere it should have had an "l". (Or maybe it was the other way around.) With the low-resolution displays and line-printers we were using at the time, it was almost impossible to distinguish between these characters.

I remembered this episode last week when I noticed this comment in some Image Processing Toolbox code:

/*
 * This is the algorithm "Create L from Candidates," bottom of column 2,
 * page 532 to top of column 1, page 533.  The following changes have
 * been made to the printed version of the algorithm:
 *   -  Script "L" replaced by "ell"
 *   -  "r" replaced by "c"
 *   -  "l" replaced by "p" (because SLE never names variables "l"!)
 *   -  "c" replaced by "num_candidates"
 *   -  fixed typo in paper:  "RemoveL([k-1],w,r)" should have been
 *      "Remove(L[k-1],L[k],w,r)."
 */

Yes, that's right - I was so frustrated by that grad school experience that I've never used a lowercase "l" as a variable name since then!

The last bullet in the comment highlights a difficult debugging issue. When you are implementing an algorithm based on a published description, and the implementation doesn't work, the problem might just be in the published description and not in your code. In this particular case, it was clear that the paper had a typo because the original text didn't make sense in context. Sometimes, though, you just aren't that lucky.

4 Responses to “How do you spell “l”?”

  1. Richard Brown replied on :

    Reminds me of frustrations experienced with ML’s default monospace font in Windows where ‘1′ looks the same as ‘l’. This one has got me many a time

  2. Steve replied on :

    Richard - Thanks for your comment. I forwarded it to the Desktop team for their consideration.

  3. Hari replied on :

    Hi steve,
    Thank you very much for this blog. This is very informative and through this I am learning easily much about the ways in which the Image processing toolbox functions work. Just, I am wondering whether you are attending the Mathworks Aerospace and Defense Conference which is scheduled from Jun 5 to Jun 6 in Manhattan Beach, CA.
    - Hari

  4. Steve replied on :

    Hi Hari - Thanks for your nice comments. I will not be attending the upcoming Aerospace and Defense conference. The next conference I attend will probably be the next IEEE International Conference on Image Processing in the fall.

Leave a Reply


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.

  • erik: “The two-dimensional Gaussian is the only radially symmetric function that is also separable” i...
  • huda: Hye.. I’m new to this image processing things.. I was told to make an image segmentation of a picture.....
  • Steve: Collin—There are functions that might be useful for the task. You might want to take a look at roifill.
  • Steve: Lori—Sure, multiple Handle Graphics objects can be combined in one plot. If you want to use imshow to...
  • collin: Hi steve, Could I erase the lines detected from an image. is there any function? thank you!
  • Lori: Is there a way to superimpose a small image onto a larger plot? I’m doing some geographical maps and...
  • Steve: WS—Because they are used twice. Here’s an example: A 1-by-5 flat structuring element can be...
  • WS: What I don’t understand is, why some decomposed structuring elements are listed twice?
  • Steve: Eman—In my completely biased opinion, I think that MATLAB (with the Image Processing Toolbox) is a...
  • Steve: Gene— sum(bw(:)) / numel(bw)

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

Related Topics