how can i remove the blue color?
조회 수: 5 (최근 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!