Filter löschen
Filter löschen

how can i remove the blue color?

5 Ansichten (letzte 30 Tage)
marc kahwaji
marc kahwaji am 7 Aug. 2014
Beantwortet: Image Analyst am 7 Aug. 2014
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?

Antworten (3)

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

Melden Sie sich an, um zu kommentieren.


Adam
Adam am 7 Aug. 2014
Bearbeitet: Adam am 7 Aug. 2014
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 am 7 Aug. 2014
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.

Tags

Noch keine Tags eingegeben.

Community Treasure Hunt

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

Start Hunting!

Translated by