Thread Subject: Combining image and plotted data

Subject: Combining image and plotted data

From: Doug Chan

Date: 5 Feb, 2008 05:04:01

Message: 1 of 7

Hi,
I have plotted some data onto a 1280x960 RGB image file
(imshow, hold on, plot(x,y)).
1) Can I update the 1280x960 image matrix to include this
newly plotted data?
2) If not, how can I save the 2D-plot+image without losing
the resolution of the original image? I used getframe but it
resized it and included the figure border.
Thanks.

Subject: Combining image and plotted data

From: Yumnam Kirani Singh

Date: 5 Feb, 2008 05:41:04

Message: 2 of 7

there are some options, either you copy the image using copy figure option of the figure window and paste it in a new window of mspaint. You can also try Save As option under File menu of the figure window. here you can the format of the image file to be saved.

Subject: Combining image and plotted data

From: Mario

Date: 7 Apr, 2008 14:31:01

Message: 3 of 7

I have the following problem:

I have a bmp image and a vector of points. I want to plot
the points on the image and save the results. I tried with:

h=figure();
I=imshow(filenameIN);
hold on;
plot(x,y,’r-+’);
hold off;
saveas(h,filenameOUT);

It works fine if I "stay" in MATLAB and I do anything else.
But if I open, say, a web page while MATLAB is running these
commands, I get the webpage saved on the output image.
Is there any way to solve this problem (possibly without
using imshow but using imread instead, cause I’m not
interested in displaying the image)?
Thanks in advance for your help.


Yumnam Kirani Singh <kirani.singh@gmail.com> wrote in
message
<12336287.1202190094652.JavaMail.jakarta@nitrogen.mathforum.org>...
> there are some options, either you copy the image using
copy figure option of the figure window and paste it in a
new window of mspaint. You can also try Save As option under
File menu of the figure window. here you can the format of
the image file to be saved.

Subject: Combining image and plotted data

From: Mario

Date: 7 Apr, 2008 16:09:02

Message: 4 of 7

I figured it out using the PRINT command but the output
image has not the same size as the input one.
How can I set the parameters of the print function?

Subject: Combining image and plotted data

From: Mario

Date: 7 Apr, 2008 16:41:05

Message: 5 of 7

ok.. this is the solution to my problem:

h=figure(100);
for count=1:s
    xy=marks{count};
    hold on;
    plot(x(:,1),y(:,2),'r-+');
    hold off;
    outImg=sprintf('test%d.bmp',count);
    set(gcf,'PaperUnits','inches','PaperPosition',[0 0
6.4/1.5 4.8/1.5])
    eval(['print -dbmp ' outImg])
end

it works but the output image is 641x480 and not 640x480? why?

Subject: Combining image and plotted data

From: us

Date: 7 Apr, 2008 17:19:02

Message: 6 of 7

"Mario ":
<SNIP causing CSSMers the blues...

> ok.. this is the solution to my problem:
> eval(['print -dbmp ' outImg])

it hurts so much - i need a drink...
us

Subject: Combining image and plotted data

From: Mario

Date: 7 Apr, 2008 17:51:01

Message: 7 of 7

it was just a rough test! I took the cue from
http://www.mathworks.com/support/solutions/data/1-16WME.html?solution=1-16WME

Anyway, I forgot to put the following commands on the
previous code (before HOLD ON):

filename = sprintf('original.%d.bmp',count);
I=imshow(filename);

btw.. any idea to solve my problem without displaying the
images?


"us " <us@neurol.unizh.ch> wrote in message
<ftdl26$d23$1@fred.mathworks.com>...
> "Mario ":
> <SNIP causing CSSMers the blues...
>
> > ok.. this is the solution to my problem:
> > eval(['print -dbmp ' outImg])
>
> it hurts so much - i need a drink...
> us

Tags for this Thread

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.

rssFeed for this Thread
 

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