How to change binary pattern to a 3 colour pattern?

1 回表示 (過去 30 日間)
Rafael Madrid
Rafael Madrid 2014 年 8 月 26 日
コメント済み: Rafael Madrid 2014 年 8 月 27 日
I have this fringe pattern I'm using for Fourier Pofilometry and I want to try using a colour pattern so that it will go Red Green Blue, ie, The first black will now be red, the first white will now be blue, the 2nd black will be green, etc. Can someone show me this?

採用された回答

Image Analyst
Image Analyst 2014 年 8 月 26 日
Try something like this (taken from my Image Segmentation Tutorial:
% Label each blob with 8-connectivity, so we can make measurements of it
[labeledImage, numberOfBlobs] = bwlabel(binaryImage, 8);
% Apply a variety of pseudo-colors to the regions.
coloredLabelsImage = label2rgb (labeledImage, 'hsv', 'k', 'shuffle');
Replace 'hsv' with a colormap of your own creation to get exactly the colors you want. You mgiht have to remove the k and shuffle arguments also.
  2 件のコメント
Rafael Madrid
Rafael Madrid 2014 年 8 月 27 日
If you could also show me how to make a colormap that will repeat like I want it to I would also be very grateful.
Rafael Madrid
Rafael Madrid 2014 年 8 月 27 日
I'm also getting a gap where the white part of the fringe is.

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeRed についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by