4.25

4.2 | 12 ratings Rate this file 284 downloads (last 30 days) File Size: 2.08 KB File ID: #10502

Image overlay

by Steve Eddins

 

23 Mar 2006 (Updated 15 Aug 2007)

Code covered by BSD License  

Overlay a binary mask onto an image using a specified color

Download Now | Watch this File

File Information
Description

The function IMOVERLAY creates a mask-based image overlay. It takes input image and a binary mask, and it produces an output image whose masked pixels have been replaced by a specified color.

Acknowledgements
This submission has inspired the following:
imagescnan.m v2.1 (Aug 2009)
Required Products Image Processing Toolbox
MATLAB release MATLAB 7.2 (R2006a)
Tags for This File  
Everyone's Tags
Tags I've Applied
Add New Tags Please login to tag files.
Comments and Ratings (15)
10 Oct 2006 James Jones

??? Subscript indices must either be real positive integers or logicals.

Error in ==> imoverlay at 54
out_red(mask) = color_uint8(1);

11 Oct 2006 Gil Hornung

I would like to overlay a picture which is not bw.

28 Apr 2007 Lennart Burg

I think it works great. Thnx

14 Jun 2007 Chai Tan

Works great. Saves me a few lines of code! :) Thanks.

18 Jul 2007 Matt Whitaker

Simple, useful and well styled and coded. Did something in my existing code similar but this is a bit faster and less memory. Steve, you might want to note in the documentation that if you have a double input outside the range of 0-1 (soemthing you typically use imagesc to display) that you would want to run mat2gray on it before passing to this function. A useful further enhancement would be either to auto detect and apply this or have an optional switch.

14 Aug 2007 B r  
31 Aug 2007 Phillip SUn

great and loved it

03 Sep 2007 Steve Eddins

Matt - I added a note and an example to the documentation based on your suggestion. Thanks!

01 Dec 2007 Robert Misevski

Great tool work very well for what a needed to do.

11 Mar 2008 Carlos Adrián Vargas Aguilera

Great tool. Now I can paint NaN's in black on imagesc.

Thanks

03 Aug 2008 Waleed El-Badry

that's an excellent piece of code.

04 Mar 2009 paddy84

This is an excellent bit of code. It worked perfectly fine in my case.

17 Jun 2009 Rotem

Great work! saved me some precious time...

03 Aug 2009 hima

This code was great.heyy i want the canny edge borders to be black.now they are in green colour.how to get that???

06 Nov 2009 James  
Please login to add a comment or rating.
Updates
15 Aug 2007

Based on a suggestion by Matt Whitaker, I added documentation and an example explaining how to use mat2gray for double / single grayscale images outside the normal [0, 1] range.

Tag Activity for this File
Tag Applied By Date/Time
gui Steve Eddins 22 Oct 2008 08:19:54
display Steve Eddins 22 Oct 2008 08:19:54
annotation Steve Eddins 22 Oct 2008 08:19:54
imoverlay mask rgb image Steve Eddins 22 Oct 2008 08:19:54
 

MATLAB Central Terms of Use

NOTICE: Any content you submit to MATLAB Central, including personal information, is not subject to the protections which may be afforded information collected under other sections of The MathWorks, Inc. Web site. You are entirely responsible for all content that you upload, post, e-mail, transmit or otherwise make available via MATLAB Central. The MathWorks does not control the content posted by visitors to MATLAB Central and, does not guarantee the accuracy, integrity, or quality of such content. Under no circumstances will The MathWorks be liable in any way for any content not authored by The MathWorks, or any loss or damage of any kind incurred as a result of the use of any content posted, e-mailed, transmitted or otherwise made available via MATLAB Central. Read the complete Terms prior to use.

Contact us at files@mathworks.com