Skip to Main Content Skip to Search
Login
File Exchange
MATLAB Newsgroup
Link Exchange
  Blogs  
 Contest 
MathWorks.com

Thread Subject: image overlay

Subject: image overlay

From: jay vaughan

Date: 14 May, 2008 17:22:02

Message: 1 of 3

Steve Eddins posted a nice file (link below) on the FEX
showing how to overlay a binary image on a base image. In
that example, pixels of the base image in RGB format (N x M
x 3) are replaced by the binary image.

In my application, I am zooming in to images such that one
data pixel is displayed on perhaps 2-10 screen pixels (zoom
Z is 2-10). In that mode, a single overlay pixel becomes
also Z screen pixels wide/tall. Does anyone know a way to
generate overlays that uses the full resolution of the
screen even if the underlying data are zoomed in?

One perhaps inelegant idea is to resample the data to have Z
times more points along each edge, and then to overlay as
before with access to each individual pixel. But I suspect
that interpolating each RGB channel would be too time
consuming for my application and see it as a last resort.


Thanks,
J

[imoverlay from Steve Eddins]
http://www.mathworks.com/matlabcentral/fileexchange/loadFile.do?objectId=10502&objectType=file

Subject: Re: image overlay

From: jay vaughan

Date: 19 May, 2008 16:57:02

Message: 2 of 3

Thought I would try a second time to see if anyone has ideas
about an image overlay at the screen resolution... thanks.

J

Subject: Re: image overlay

From: ImageAnalyst

Date: 19 May, 2008 18:02:36

Message: 3 of 3

On May 19, 12:57=A0pm, "jay vaughan" <jvaughan5.nos...@gmail.com> wrote:
> Thought I would try a second time to see if anyone has ideas
> about an image overlay at the screen resolution... thanks.
>
> J

---------------------------------------
If you're just plotting an outline, you can use the plot() function
which will plot it as a smooth vector that I don't believe will show
the big quantized blocky pixels when you zoom way in. Can you get the
perimeter of the blob, then scale the numbers, then using poly2mask()
convert it to a bitmap with the higher resolution. This should
produce a smoother boundary because you're basically using the vector-
based boundary to create a higher resolution bitmap.

If you're displaying a pixel-based image, you're out of luck. You
could resample at a higher res but then whatever you did to create the
overlay will still be blocky, unless you do something else like
resample higher and then blur it. That would get you a smoother
overlay but it's no more accurate than the original image in which
pixels got selected for the overlay image, in fact it's less accurate
so don't fool yourself. It's smoother but only because you're making
up intermediate pixels values and locations to get that smoother
boundary. Since you're making up pixels that weren't in your original
image, there's no guarantee that the boundary on your processed image
would correspond better to the image as if you HAD started out with
the higher resolution on the original image than if you just used the
blocky one.
Regards,
ImageAnalyst

Tags for this Thread

Everyone's Tags:

Add a New Tag:

Separated by commas
Ex.: root locus, bode

What are tags?

A tag is like a keyword or category label associated with each thread. Tags make it easier for you to find threads of interest.

Anyone can tag a thread. Tags are public and visible to everyone.

Tag Activity for This Thread
Tag Applied By Date/Time
image overlay jay vaughan 14 May, 2008 13:25:12
rssFeed for this Thread

envelope graphic E-mail this page to a colleague

Public Submission Policy
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 Disclaimer prior to use.
Related Topics