这里是我的解决方案。直方图图像强度,找到那些最接近于零的图像,然后将其设置为白色。例如:
m=peaks(100); % generate data
imagesc(m);
colormap_range=64; % default colormap_range is 64, but change it to your needs
[n,xout] =hist(m(:),colormap_range); % hist intensities according to the colormap range
[val ind]=sort(abs(xout)); % sort according to values closest to zero
j = jet;
j(ind(1),:) = [ 1 1 1 ]; % also see comment below
% you can also use instead something like j(ind(1:whatever),:)=ones(whatever,3);
colormap(j);
,而不是sort
可以使用min
,但我认为,通过排序,你也可以编辑的不仅仅是与其他行如,j(ind(1:3),:)=ones(3);
水平。下图所示下面就是用这个做...
来源
2012-11-12 06:46:43
bla
这是完美..非常感谢您的帮助! – Ash