<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
</head>
<body text="#000000" bgcolor="#FFFFFF">
<div class="moz-cite-prefix">Hi, <br>
</div>
<div class="moz-cite-prefix"><br>
</div>
<div class="moz-cite-prefix">While I think to create animation to
animated gif is the most effective way to share the animation,
another alternative you could look at is using the IPCV to create
a movie from it. <br>
</div>
<div class="moz-cite-prefix"><br>
</div>
<div class="moz-cite-prefix">Please find below for the sample codes:</div>
<div class="moz-cite-prefix"><br>
</div>
<div class="moz-cite-prefix">_________________</div>
<div class="moz-cite-prefix">tic();<br>
<br>
// open a file for write<br>
n = avifile('test.avi', [640;480], 30,'xvid');<br>
<br>
// Initiate plot and get the handle<br>
plot(rand(100,1));<br>
e = gce();<br>
<br>
scf(0)<br>
<br>
// run 100 frame random data<br>
for cnt = 1:100<br>
new_data = rand(100,1); // new data<br>
e.children.data(:,2) = new_data; // replace new data onto
current plot<br>
im = xs2im(0); // get the plot into a matrix<br>
addframe(n, im); // add the matrix/frame into the file<br>
end<br>
aviclose(n);<br>
<br>
disp(toc());<br>
</div>
<div class="moz-cite-prefix">____________________</div>
<div class="moz-cite-prefix"><br>
</div>
<div class="moz-cite-prefix">Still, the function "xs2im" will still
create the intermediate file in the temp folder as like animaGIF.
The above 100 frames took about 6s in i5 computer. <br>
</div>
<div class="moz-cite-prefix"><br>
</div>
<div class="moz-cite-prefix">In this case, you could control the
resolution of the video, and also the frame rate of the video. <br>
</div>
<div class="moz-cite-prefix"><br>
</div>
<div class="moz-cite-prefix">Thanks.</div>
<br>
<div class="moz-cite-prefix">Chin Luh<br>
</div>
<div class="moz-cite-prefix"><br>
</div>
<div class="moz-cite-prefix">On 27/7/2019 1:52 AM, Samuel Gougeon
wrote:<br>
</div>
<blockquote type="cite"
cite="mid:30bb66bd-a308-d74c-2958-0de1e956697b@free.fr">
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<div class="moz-cite-prefix">Hello,</div>
<div class="moz-cite-prefix"><br>
</div>
<div class="moz-cite-prefix">Le 26/07/2019 à 19:22, stevenrjarrett
a écrit :<br>
</div>
<blockquote type="cite"
cite="mid:1564161734067-0.post@n3.nabble.com">
<pre class="moz-quote-pre" wrap="">Is there a way to convert a Scilab figure to a SciCV Mat? I had thought the
simplest way would be to convert the figure to a matrix and use the matrix
data to create the SciCV Mat, but I have not been successful finding a way
to do either.
The reason I want to convert between them is so that I can create a video
that shows data being plotted in real time. I have done this successfully by
creating the figures, writing a series of image files, and converting the
images to a video using the SciCV toolbox. As you can imagine, it is time
consuming to write that many images to the disk as only an intermediate
step, and I have been trying to find a cleaner/faster way to do it within
Scilab.</pre>
</blockquote>
<p>If you are really in a hurry, i am afraid that you will have to
find an external solution, because anyway exporting figures
within Scilab is quite slow, even in bitmap encodings. This has
been reported <a href="http://bugzilla.scilab.org/13904"
moz-do-not-send="true">here</a> and is still the case.</p>
<p>Otherwise, you can use animaGIF(), that can avoid storing all
intermediate images, but that does not avoid creating them. So,
it saves disk space, but not time as you request. It does not
really aim to make video with a "normal" frame rate, although it
can mimik it.<br>
</p>
<p>Samuel</p>
<p><br>
</p>
<br>
<br>
<fieldset class="mimeAttachmentHeader"></fieldset>
<pre class="moz-quote-pre" wrap="">_______________________________________________
users mailing list
<a class="moz-txt-link-abbreviated" href="mailto:users@lists.scilab.org">users@lists.scilab.org</a>
<a class="moz-txt-link-freetext" href="http://lists.scilab.org/mailman/listinfo/users">http://lists.scilab.org/mailman/listinfo/users</a>
</pre>
</blockquote>
<p><br>
</p>
<pre class="moz-signature" cols="72">
</pre>
</body>
</html>