help-octave
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Displaying an animation / "movie"


From: Jeff Miller
Subject: Re: Displaying an animation / "movie"
Date: Thu, 4 May 2006 21:59:50 -0400

OK, I finally got this working! Woo hoo!

I'll try to cover what I did, for the record. (Note: This on Debian Linux.)

1. Install Gnuplot 4.1
This is currently developmental, but it supports images.
http://www.gnuplot.info/development/index.html
Note: The CVS server from the url above wasn't working for me, but *luckily* a smart person provided a download here:
http://article.gmane.org/gmane.comp.graphics.gnuplot.devel/4318

2. Set Octave to use Gnuplot 4.1 instead of 4.0
In your .octaverc file, add this line:
gnuplot_binary = '/usr/local/bin/gnuplot'
The default location for the 4.0 gnuplot binary is /usr/bin/gnuplot -- this sets Octave to use the default location for 4.1 instead.

3. Download the imagegp scripts from:
http://www.gnuplot.info/links.html
Follow the directions given to setup Octave to use these files instead of the normal image m-functions.
Note: For me, the imshow function given here doesn't work... it just seems to get stuck and I have to kill the process. However, imagesc seems to work fine.

Now, when I run this code in Octave:
for i=1:100; imagesc(rand(100,100)); end;

...it shows a series of images in a movie / animation. And the frame rate appears comparable to Matlab.  ;)

Thanks for everyone's help... I'm looking forward to using Octave.

Jeff


On 5/4/06, Robert A. Macy <address@hidden> wrote:
If it's just for visualizing,

>> for i=1:100;x=shift(x,1);gsplot x;endfor;

see what you get.

As I said, you can rotate the matrix with your mouse and
get "best" viewing.

         - Robert -

On Thu, 4 May 2006 07:29:34 -0400
"Jeff Miller" <address@hidden> wrote:
> Robert,
> When I do imshow on a matrix, it displays an image where
> each number in the
> matrix corresponds to the intensity (or color) of the
> pixel in the image
> with the corresponding indices (e.g. (0,0), (0,1), ...).
> So, this would
> display a square:
>
> x = [0 0 0 0 0
>      0 1 1 1 0
>      0 1 0 1 0
>      0 1 1 1 0
>      0 0 0 0 0];
> imshow(x);
>
> What I'd like to do is take a series of such matrices
> that represent moving
> objects and display them sequentially like a movie. For
> example, this would
> show that square moving downward (looping around the
> edges):
>
> for i=1:100
>     x = shift(x, 1);
>     imshow(x);
> end
>
>
> This works in Matlab, but I can't seem to make it work in
> Octave. I could
> probably use the approach that the other Robert mentioned
> (saving all images
> to files, making a movie from the files, then displaying
> the movie) but I'm
> hoping there's a simpler way.
>
> (By the way, I'm using this for computer vision stuff, so
> I can visualize
> what's going on...)
>
> Thanks for your help,
> Jeff
>


reply via email to

[Prev in Thread] Current Thread [Next in Thread]