フィルターのクリア

Why is the background of my custom marker changing color?

1 回表示 (過去 30 日間)
Meghana Balasubramanian
Meghana Balasubramanian 2019 年 10 月 15 日
Hello,
I wanted to use images as custom markers for my plot. I have attached one of the images that I use as my marker. It is a binary image. however when I use it as a marker, the background of only the image becomes yellow. Is there any way to fix this?
x = 5:5:125;
y = 0:0.04:1; %some variation of the data
% Load the marker image:
markersize = [10,0.1];
x_low = x - markersize(1)/2;
x_high = x + markersize(1)/2;
y_low = y - markersize(2)/2;
y_high = y + markersize(2)/2;
for k = 1:length(x)
marker = imread(['some_path\verify_threshold_images\', num2str(k),'cropped.tif']);
plot(x,y)
hold on
imagesc([x_low(k) x_high(k)], [y_low(k) y_high(k)], marker);
end
axis ([0 140 0 1]);
hold off
  9 件のコメント
KALYAN ACHARJYA
KALYAN ACHARJYA 2019 年 10 月 15 日
編集済み: KALYAN ACHARJYA 2019 年 10 月 15 日
Sorry, I didnot get the question? Can you make it more simple (if possible)?
Adam
Adam 2019 年 10 月 15 日
8.jpg is the jpg version of the image though, not the one you would plot from Matlab (on its own, without all the other stuff on the plot). Plus its a jpg, not a tiff

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

採用された回答

Walter Roberson
Walter Roberson 2019 年 10 月 15 日
imagesc is primarily for pseudocolor images, especially ones in which the data is a range of values that is to be distributed over the current color map. You are not calling colormap() so you are getting whatever colormap happens to be in effect.
You should convert the cropped image into rgb and image() that. im2uint8() then repmat() 1,1,3 to create the rgb image.
  1 件のコメント
Meghana Balasubramanian
Meghana Balasubramanian 2019 年 10 月 15 日
Thank you for explaining it! This is just what I needed

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

その他の回答 (0 件)

カテゴリ

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

Community Treasure Hunt

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

Start Hunting!

Translated by