필터 지우기
필터 지우기

how can i remove the blue color?

조회 수: 5 (최근 30일)
marc kahwaji
marc kahwaji 2014년 8월 7일
답변: Image Analyst 2014년 8월 7일
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?

답변 (3개)

Iain
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
marc kahwaji
marc kahwaji 2014년 8월 7일
i don't want to change it to gray the circles must be colored and not gray
Iain
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
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.

Image Analyst
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.

카테고리

Help CenterFile Exchange에서 Blue에 대해 자세히 알아보기

태그

아직 태그를 입력하지 않았습니다.

Community Treasure Hunt

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

Start Hunting!

Translated by