From: Phil Sampson on 24 Jun 2010 10:33 Hi, I'm just getting started with Matlab and am using it to process some results for an image processing application. I want to write a script to read an image in, plot some points of interest, then save it(with the additional points included) I've written code along the lines of Image = imread( 'input_image.jpg' ) figure; imshow(Image); hold on; plot( 100,100, 'r*'); imwrite(Image, 'outpu_image.jpg'); So, when I look at the image(prior to closing the figure window down), there is a point plotted as expected. However, when I open output_image.jpg, the plotted point hasn't been saved, only the original image. Ideally, i'd like the saved image to include the plotted points too...is this possible? Thanks in advance, Phil
From: matt dash on 24 Jun 2010 11:36 "Phil Sampson" <philip_a_sampson(a)hotmail.com> wrote in message <hvvqbh$t1d$1(a)fred.mathworks.com>... > Hi, > > I'm just getting started with Matlab and am using it to process some results for an image processing application. I want to write a script to read an image in, plot some points of interest, then save it(with the additional points included) > > I've written code along the lines of > > Image = imread( 'input_image.jpg' ) > > figure; > imshow(Image); > hold on; > plot( 100,100, 'r*'); > > imwrite(Image, 'outpu_image.jpg'); > > So, when I look at the image(prior to closing the figure window down), there is a point plotted as expected. However, when I open output_image.jpg, the plotted point hasn't been saved, only the original image. > > Ideally, i'd like the saved image to include the plotted points too...is this possible? > > Thanks in advance, > Phil That's because you haven't modified the matrix Image. Try using getframe after you've plotted the points to get a new image matrix.
From: Phil Sampson on 24 Jun 2010 12:18 Back of the net!!! (seems apt to use a footballing reference) Thanks matt, it works a treat! Phil
|
Pages: 1 Prev: how to use glut in matlab Next: audio signal: energy calculation |