Loren on the Art of MATLAB

March 31st, 2009

Technique for Visual Image Comparison

Recently Steve wrote an interesting post entitled Image Overlay Transparency that I found quite interesting.

Contents

The Idea

The idea is to plot one image on top of the other, exposing pieces of the buried image by making parts of the top image transparent. Here's a teaser for you to look at.

Other Techniques?

Do you have some other techniques for visual image comparison that you find helpful? Post them here.


Get the MATLAB code

Published with MATLAB® 7.8

4 Responses to “Technique for Visual Image Comparison”

  1. Oliver Woodford replied on :

    In my work I often have an image and some 1-d metric for each pixel in the image, which I then want to overlay on the image. I do this by making the image greyscale and using the metric to overlay colour, using a colormap like jet. I use my SC function (on the FEX) to do this for me, using the ‘prob’ or ‘prob_jet’ colormaps.

  2. Oliver Woodford replied on :

    Here is an example of what I was talking about above:
    http://www.robots.ox.ac.uk/~ojw/images/prob_demo.png
    One of the benefits of using SC to do this is that it allows a colorbar to be added (with the correct colours and scale).

  3. Loren replied on :

    Oliver-

    Nice technique!

    –Loren

  4. Mike Garrity replied on :

    This is called a “matrix wipe”. It can be really effective if you add a slider to let the user control the amount of wipe. Also, being able to choose different wipes is useful.

    http://en.wikipedia.org/wiki/Wipe_(transition)

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).


Loren Shure works on design of the MATLAB language at The MathWorks. She writes here about once a week on MATLAB programming and related topics.

  • Jun: I totally can not believe it, Loren. You are really helpful. Thank you so much, MATLAB master!
  • Loren: Wow folks- Always lots of interest when there’s a quickie to try out! I will only make 2 general...
  • Loren: Jun- ismember is your friend here: >> [aa,ind] = ismember(Array2,Arra y1) aa = 1 1 1 1 1 1 1 ind = 1 2 1 4 4 3...
  • Dan: I like the first way better than the second way. Combining the arrays into one and running any is nice, although...
  • James Myatt: How about I = (a == 0 | b == 0); a(I) = []; b(I) = [];
  • Tunc: Hello Loren, love your blog because of such inspiring and challenging comments to such ’small’...
  • Pekka Kumpulainen: Here is my tradeoff. I usually want to keep the original variables as they are most probably...
  • Iain: Followup: Of course, to allow NaNs (counting them as non-zero): mask = (a~=0) & (b~=0); The mask says “a...
  • Matt Fig: I would usually go with something like this: y = a&b; x = a(y); y = b(y); But I was surprised to find...
  • kk: c=all([a;b]) a(c) a(b)

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