Image Overlays

版本 2.1.1.1 (4.4 KB) 作者: Mark Chonofsky
These functions override image and imagesc to allow images with multiple colormaps
64.0 次下载
更新时间 2022/5/4

查看许可证

Matlab built-in image() and imagesc() do not straightforwardly allow one to overlay one image over another in different colors (i.e., different colormaps). These utilities provide a rudimentary way to do so by suitably scaling and augmenting the image data and the active colormap.
For example:
>> colormap bone
>> imagesc(dists>8)
>> hold on
>> imagesc(mask,'ColorMap',[0.5 0 0.5],'AlphaData',0.5*(mask>0))
plots mask over dists>8 with a colormap that runs smoothly from white to purple.
There are a few options for the colormap:
- any of the MATLAB builtins, passed either as a string ('jet') or an array (jet(64))
- any Nx3 array
- a single color, in which case the colormap is expanded to run from white to that color
I placed imagesc.m and @double in my working directory. I'm not sure if that's the most effective choice and I haven't tested other locations.
Please be in touch with any requests or issues. A more discursive description is available at http://www.blopig.com/blog/?p=3634

引用格式

Mark Chonofsky (2024). Image Overlays (https://www.mathworks.com/matlabcentral/fileexchange/63183-image-overlays), MATLAB Central File Exchange. 检索来源 .

MATLAB 版本兼容性
创建方式 R2017a
兼容任何版本
平台兼容性
Windows macOS Linux
类别
Help CenterMATLAB Answers 中查找有关 Blue 的更多信息

Community Treasure Hunt

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

Start Hunting!
版本 已发布 发行说明
2.1.1.1

Added missing scaleTo function

2.1.1.0

Editing to note that the release note for 2.1 should have read 'colorbars' not 'colormaps'. The FP routine is necessary for the other functions but the result is not actively used.

2.1.0.0

v2.1 fixes a bug and updates a floating point routine. The floating-point routine is related only to my ambition to implement colormaps at some future time.

2.0.0.0

v1.0 implements overlay() and remove_overlay()
v2.0 re-implements this functionality as overloaded/shadowed versions of image and imagesc for smoother use

1.0.0.0