how can i remove the blue color?
1 次查看(过去 30 天)
显示 更早的评论
code:
close all;
clear all;
P = @(x,y,c,w) exp(-((x-repmat(c(1),size(x,1),size(x,2))).^2 + (y-repmat(c(2),size(y,1),size(y,2))).^2)./w);
W = 1; % Width (constant here, can vary as a vector if you like)
C = [[18 15 5];[10 10 10]]; % Peak centers
x = linspace(0,20,150); % Define ‘x’ vector
[X,Y] = meshgrid(x);
pks = zeros(size(X)); % Preallocate ‘pks’
for k1 = 1:size(C,2) % Loop through ‘C’ (centers) vector
pks = pks + P(X,Y,C(:,k1),W) ;
end
A=pcolor(pks);
%figure control
set(A,'facecolor', 'interp','FaceAlpha',1);
set(gca,'xtick',[],'ytick',[])
ha = axes('units','normalized','position',[0 0 1 1]);
uistack(ha,'bottom');
I=imread('foot1.jpg');
hi = imagesc(I);
set(ha,'handlevisibility','off','visible','off');
shading interp;
i have a foot image(foot1.jpg) that is attached with this code i'm obtaining the figure1 my purpuse is to remove the blue color and keep the multicolored circles inside the foot how can i do it?
0 个评论
回答(3 个)
Iain
2014-8-7
You can change the colormap to gray. - That'll make it go from black (low values) to white (high values)
You can generate the image first, then draw the foot on top of it.
You can alter the "alphadata" for the image, so that it is transparent where you want to see what was behind it.
2 个评论
Iain
2014-8-7
In which case, you'll have to alter the alphadata of the image so that it is transparent where you do not want to see anything on top of the foot.
Adam
2014-8-7
编辑:Adam
2014-8-7
colormapeditor
will allow you to change just small parts of the colourmap so you can put a black or white background as just the first pixel of the colourmap and start the blue colour at the second instead.
In the colourmap editor just single click under the colourbar to add abother control point and double click the control point to set its colour.
0 个评论
Image Analyst
2014-8-7
Just add the images
someWeight = 0.3; % Or whatever you want.
newImage = double(I) + someWeight * pks;
imshow(newImage, []);
colormap(jet(256)); % or whatever you want.
0 个评论
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Blue 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!