colormap for openings in crack

I have this image and i would like to produce a colormap.
this is an edge detected image of a crack on concrete. I have already found the distances and coordinate points between each pixel. Now what I would like to do is create a colormap between the edges showing according to the crack opening distances.
Any ideas of how I can go about doing this?
I've thought about plotting straight lines with different line colors but it doesn't look as nice.

Answers (1)

Display, with imshow(), the distance map of the region in between the lines. Use caxis() to tell it what value each end of the colormap should correspond to. Then create a colormap to correspond to the distances, e.g. jet(256). Then call colormap(yourColorMap). For example (untested)
imshow(distanceMapImage, []);
axis on;
caxis([0, 10]);
colormap(jet(256));
colorbar;
Post your distance map if you can't figure it out.

11 Comments

this is the file I will be using for the colormap. It's in a cell array but just use the first array. In the array, the first column is the distance value while the next 4 columns are the [x1 y1 x2 y2] coordinates corresponding to that distance.
I don't really understand how to assign a different color for each distance. Could you please help me on this or suggest a different method on how to do this?
Thank you so much
You didn't attach anything. Please attach a .mat file with your Euclidean Distance Transform image. I don't know why you go it in a list and what the two coordinates mean. Just give me the image.
sorry i forgot to attach it
There is no distance image in there. Where is the Euclidean Distance Transform image?
after plotting the coordinates from the file i get this image. is that what you wanted?
Image Analyst
Image Analyst on 30 Aug 2014
Edited: Image Analyst on 30 Aug 2014
I don't see any distances. All the values between the outlines appear to be the same value (distance). Where is the image where the pixels between the outlines have the value of the distance to the outline? In other words, the Euclidean Distance Transform? Wait - did you just pick each boundary point and calculate the distance to every other boundary point and record the minimum distance it found, instead of using bwdist()?
I didn't use a distance transform to find the distances but did you want something like this?
Well do you want something that's brighter in the middle (because the middle is farthest from the sides) and goes down to zero as the pixels get closer to the sides and the distance becomes zero?
Then you need to get a binary image of just branches. Solid, not outlines. You can do this by connecting the open ends and calling imfill. Then call bwdist() and colormap().
Duncan, haven't heard back from you. Did you get it figured out?

Sign in to comment.

Asked:

on 29 Aug 2014

Commented:

on 10 Sep 2014

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!