From: Yagmur on
ImageAnalyst <imageanalyst(a)mailinator.com> wrote in message <f8670dd5-1d1e-40b3-8818-007a8ed1874d(a)k19g2000yqm.googlegroups.com>...
> Just write the value (say, 255 or [255,255,255]) directly into the
> image (the numerical 2D array) and use imwrite to save that array out
> to disk. E.g., for the top line (line 50) of the box going from
> column 100 to column 150:
> imageArray(50, 100:150) = 255;

Yes, that should work! Thank you very much..
Can I still watch the sequence of frames by using implay() if I modify the arrays like this?
From: ImageAnalyst on
On May 1, 11:05 am, "Yagmur " <yagmurerk...(a)hotmail.com> wrote:
> Yes, that should work! Thank you very much..
> Can I still watch the sequence of frames by using implay() if I modify the arrays like this?
--------------------------------------------------------------------
Sure - I don't see why not. You can display the images either before
or after you write the rectangle into the image array.

From: Yagmur on
ImageAnalyst <imageanalyst(a)mailinator.com> wrote in message <f56f131b-d675-41b2-976a-938ad4152b0a(a)k41g2000yqb.googlegroups.com>...
> On May 1, 11:05 am, "Yagmur " <yagmurerk...(a)hotmail.com> wrote:
> > Yes, that should work! Thank you very much..
> > Can I still watch the sequence of frames by using implay() if I modify the arrays like this?
> --------------------------------------------------------------------
> Sure - I don't see why not. You can display the images either before
> or after you write the rectangle into the image array.

Thank you very much ImageAnalyst.
From: Wajih Syed on
"Yagmur " <yagmurerkal1(a)hotmail.com> wrote in message <hrh26r$8u4$1(a)fred.mathworks.com>...
> Hello,
>
> How can I plot a rectangle on an image and save the modified image?

Yagmur,

You can use the ShapeInserter system object in the Video and Image Processing blockset to draw rectangles on images including frames from videos. Here is some example code from the documentation:

hshapeins = video.ShapeInserter;
I = im2double(imread('cameraman.tif'));
Pts = [10 10 30 30];
y = step(hshapeins, I, Pts);
imshow(y);

Please refer to the documentation at http://www.mathworks.com/access/helpdesk/help/toolbox/vipblks/ref/video.shapeinserterclass.html. Let me know if you have any questions.

Thanks,

Wajih

Video and Image Processing Blockset developer at MathWorks
First  |  Prev  | 
Pages: 1 2
Prev: Text generator
Next: regionprops