# Time Lapse Film Using Scanner

In this post we will see how to make  a time-lapse animation of something which changes over time, with a scanner. Most probably you have seen some amazing time -lapse photography of different objects. Common examples include the ever changing skyscape, blooming flowers, metamorphosing insects etc. I wanted to do a similar stuff, but due to my lethargy and other reasons I did not. Though the cameras have intervelometer, and I have used it once to take photos of a lunar eclipse, (moon changing position which I was supposed to merge later, but never did), and wanted to do the same with a blooming of a flower. But as Ghalib has said, they were one of those हज़ारों ख्वाहिशें…
The roots of the idea what follows are germinated long back, when I had a scanner. It was a basic HP 3200 scanner. That time I did not have a digital camera, (c. 2002-2003), but then I used the scanner as a camera. I had this project lined up for making collages of different cereals. Though I got a few good images from botanical samples (a dried fern below) as well and also fractals from a sheet of rusting iron. Then, I sort of forget about it.

Coming to now, I saw some amazing works of art done by scanning flowers. I remembered what had been done a few years back and combined this with the amazing time-lapse sequences that I had seen , the germ began can we combine the two?
http://vimeo.com/22439234
Can we make the scanner, make scans at regular intervals, and make a animation from the resulting images. Scanning images with a scanner would solve problem of uniform lighting, for which you may require an artificial light setup. So began the task to make this possible. One obvious and most easy way to do this is to scan the images manually, lets say every 15 minutes. In this case you setup the scanner, and just press the scan button. Though this is possible, but its not how the computers should be used. In this case we are working for the computer, let us think of making the computer do work for us. In comes shell scripting to our rescue. The support for scanners in GNU/Linux is due to the SANE (Scanner Access Now Easy) Project. the GUI for the SANE is the xsane, which we have talked about in a previous post on scanning books and scanimage is the terminal option for the sane project.
The rough idea for the project is this :
1. Use scanimage to acquire images
2. Use some script to make this done at regular time intervals.
3. Once the images are with use, combine them to make a time-lapse movie
For the script part, crontab is what is mostly used for scheduling tasks, which you want to be repeated at regular intervals. So the project then became of combining crontab and scanimage. Scanimage has a mode called --batch in which you can specify the number of images that you want to scan and also provides you with renaming options. Some people have already made bash scripts for ADF (Automatic Document Feeders), you can see the example here. But there seems to be no option for delay between the scans, which is precisely what we wanted. To approach it in another way is to introduce the the scanimage command in a shell script, which would be in a loop for the required number of images and you use the sleep command for the desired time intervals, this approach does not need the crontab for its operation. But with I decided to proceed with the crontab approach.
The first thing that was needed was to get a hang of the scanimage options. So if your scanner is already supported by SANE, then you are good to go.
$scanimage -L This will list out the devices available for scanning. In my case the scanner is Canon Lide 110, which took some efforts to get detected. For knowing how to install this scanner, if it is not automatically supported on your GNU/Linux system, please see here. In my case it lists out something like this: device genesys:libusb:002:007' is a Canon LiDE 110 flatbed scanner If there are more than one devices attached to the system the -L option will show you that. Now coming to the scan, in the scanimage programme, we have many options which control various parameters of the scanned picture. For example we can set the size, dpi, colour mode, output type, contrast etc. For a complete set of options you can go here or just type man scanimage at the terminal. We will be using very limited options for this project, namely the x, y size, mode, format, and the resolution in dpi. Lets see what the following command does: $scanimage -d genesys:libusb:002:006 -x 216 -y 300 --resolution 600dpi --mode Color --format=tiff>output.tiff
-d option specifies the device to be used, if there is nothing specified, scanimage takes the first device in the list which you get with -L option.
-x  216 and -y 300 options specify the size of the final image. If for example you give 500 for both x and y, scanimage will tell us that maximum x and y are these and will use those values. Adjusting these two values you will be able to ‘select’ the area to be scanned. In the above example the entire scan area is used.
--resolution option is straight forward , it sets the resolution of the image, here we have set it to 600dpi.
--mode option specifies the colour space of the output, it can be Color, Gray or Lineart
--format option chooses the output of the format, here we have chosen tiff, by default it is .pnm .
The > character tells scanimage that the scan should be output to a file called “output.tiff”, by default this will in the directory from where the command is run. For example if your command is run from the /home/user/ directory, the output.tiff will be placed there.
With these commands we are almost done with the scanimage part of the project. With this much code, we can manually scan the images every 15 minutes. But in this case it will rewrite the existing image. So what we need to do is to make sure that the filename for each scan is different. In the --batch mode scanimage takes care of this by itself, but since we are not using the batch mode we need to do something about it.
What we basically need is a counter, which should be appended to the final line of the above code.
For example let us have a variable n, we start with n=1, and each time a scan happens this variable should increment by 1. And in the output, we use this variable in the file name.
For example, filename = out$n.tiff: n =1 | filename = out1.tiff n = n + 1 n = 2 | filename = out2.tiff n = n + 1 n = 3 and so on… We can have this variable within the script only, but since we are planning to use crontab, each time the script gets called, the variable will be initialized, and it will not do the function we intend it to do. For this we need to store variable outside the script, from where it will be called and will be written into. Some googling and landed on this site, which was very helpful to attain what I wanted to. Author says that he hasn’t found any use for the script, but I have 🙂 As explained in the site above this script is basically a counter, which creates a file nvalue. starting from n=0, values are written in this file, and each time the script is executed, this file with n=n+1 is updated. So what I did is appended the above scanimage code to the ncounter script and the result looks something like this: #!/bin/bash nfilename="./nvalue" n=0 touch$nfilename . $nfilename n=$(expr $n + 1) echo "n=$n" > $nfilename scanimage -x 80 -y 60 --resolution 600dpi --mode Color --format=tiff>out"$n".tiff
What this will attain is that every time this script is run, it will create a separate output file, depending on the value of n. We put these lines of code  in a file and call it time-lapse.sh
Now to run this file we need to make it executable, for this use:
$chmod +x time-lapse.sh and to run the script: $./time-lapse.sh
If  everything is right, you will get a file named out1.tiff as output, running the script again you will have out2.tiff as the output. Thus we have attained what we had wanted. Now everytime the script runs we get a new file, which was desired. With this the scanimage part is done, and now we come to the part where we are scheduling the scans. For this we use the crontab, which is a powerful tool for scheduling jobs. Some good and basic tutorials for crontab can be found here and here.
\$crontab -e
If you are using crontab for the first time, it will ask for editor of choice which has nano, vi and emacs. For me emacs is the editor of choice.
So to run scans every 15 minutes my crontab looks like this:
# m h  dom mon dow   command */15 * * * * /home/yourusername/time-lapse.sh
And I had tough time when nothing was happenning with crontab. Though the script was running correctly in the terminal. So finally the tip of adding in the cronfile
SHELL=/bin/bash
solved the problem. But it took me some effort to land up on exact cause of the problem and in many places there were sermons on setting PATH and other things in the script but, I did not understand what they meant.
Okay, so far so good. Once you put this script in the crontab and keep the scanner connected, it will produce scans every 15 minutes. If you are scanning in colour at high resolution, make sure you have enough free disk space.
Once the scans have run for the time that you want them , lets say 3 days. You will have a bunch of files which are the time lapse images.  For this we use the ffmpeg and ImageMagick to help us out.

# Radical Openness – Scientific Research

“The more we’re getting into this the more it’s apparent this is a radical new way to scientific research. Traditional research is done in an institution with patent protection. IP protection and patents slows progress because it reduces collaboration and makes it harder to build on the work of others. Our project, we don’t have a central body. It’s the public, they’re the ones who get excited. Because we’re not beholden to shareholders we can create a community.”

via Glowing Plant| Singularity Hub.
I just hope that this project is successful and will create a new way of doing scientific research which will involve common people.

# The Children’s Machine

These are some unfinished notes that I have taken while reading the Children’s Machine by Seymour Papert. Hope that someday I will weave them into something more fluid.

Why, though a period when so much human activity has been
revolutionized, have we not seen comparable change in the way we
help our children learn?

* Quotes

116

One could indeed make kitchen math part of the School by making School part of the kitchen.

127

Are there any snakes in the house?
Yes there are, there are zero snakes in the house!

So. negative numbers are numbers too, and their reality grows in the course of playing with turtle.

130
You can’t retire from a good project simply because it has succeeded.

139

Constructionism: It does not call in question the value of  instruction as such

The kind of knowledge that children most need is the knowledge that will help them get more knowledge.

140
If the children really want to learn something, and have the opportunity to learn it in its use, they do so even if the teaching is poor.

Constructionism looks more closely than other educational -isms at  the idea of mental construction. It attaches a special importance to role of constructions in the world as a support for those in the head, thereby becoming less of a purely mentalistic doctrine. It also takes the idea of constructing in the head more seriously by recognizing more than one kind of construction and by asking questions about the methods and materials used.

How can one become expert in constructing knowledge?

What skills are required?

Are these skills different for different kinds of knowledge?

144

School math, like the ideology, though not necessarily the practice, of modern science, is based on the idea of generality – the single, universally correct method that will work for all problems and for all people.

145

Use what you’ve got, improvise, make do.

147

The natural context for learning would be through particiaption in other activities other than math itself.

148

The reason is that the educators who advocate imposing abstract ways of thinking on students almost practice what they preach – as I  tried to do in adopting a concrete style of writing – but with very different effects.

149

But however concrete their data, any statistical question about  “the effect” of “the computer” is irretrievably abstract. This is because all such studies depend on use of what is known as the “scientific method,” in form of experiments designed to study the effect of one factor which is varied while taking great pains to
keep everything else same. … But nothing could be more absurd than  an experiment in which computers are placed in a classroom where nothing else has changed. The entire point of all the examples I have given is that the computers serve best when they allow everything to change.

150

The concept of highly rigorous and formal scientific method that most of us have been taught in school is really an ideology  proclaimed in books, taught in schools and argued by philosophers but widely ignored in actual practice of science.

154

They count the same, but it’s more eggs.

161
My overarching message to anyone who wishes to influence, or simple understand, the development of educational computing is that it is not about one damn product after another (to paraphrase a saying
about how school teaches history). Its essence is the growth of a  culture, and it can be influenced constructively only through understanding and fostering trends in this culture.

167
I would be rather precisely wrong than vaguely right.
– Patrick Suppes

It had been obvious to me for a long time that one of the major difficulties in school subjects such as mathematics and science is that School insists on the student being precisely right. Surely it is necessary in some situations to be precisely right. But these situations cannot be the right ones for developing the kind of thinking that I most treasure myself and many creative people I know.

168
What computers had offered me was exactly what they should offer children! They should serve children as instruments to work with and to think with, as means to carry out projects, the source of concepts to think new ideas. The last thing in the world I wanted or needed was a drill and practice program telling me to do this sum of spell that word! Why should we impose such a thing on children?

183
The opportunity for fantasy opens the to a feeling of intimacy
with the work and provides a peep at how emotional side of
children’s relationship with science and technology could be very
different from what is traditional in School. Fantasy has always
been encouraged in good creative writing and art
classes. Excluding it from science is a foolish neglect of an
opportunity to develop bonding between children and science.

184

Errors can become sources of information.

185

Although the ultimate goal was the same, the means were more than
just qualitatively different; they were episte,mologically
different in that they used a different way of thinking.

Traditional epistemology is an epistemology of precision:
Knowledge is valued for being precise and considered inferior if
it lacks precision. Cybernetics creates an epistemology of
“managed vagueness.”

197

The real problem was that I was still thinking in terms of how to
“get the children to do something.” This is the educator’s
instinctive way of thinking: How can you get children to like
math, to write wonderfully, to enjoy programming, to use
higher-order thinking skills? It took a long time for me to
understand in my gut, even after I was going around saying it,
that Logo gaphics was successful because of the powet it /gave/ to
children, not because of the performance it /got from/ them.

Children love constructing things, so let’s choose a construction
set and add to it whatever is needed for these to make cybernetic
models.

198

What will they [children] learn from it [Logo]? And won’t it favor
boys over girls?

The first question concerns what piece of the school curriculum is
being learned but I attach the most importance to such issues as
children’s relationship with technology, then idea of learning,
their sense of self. As for the gender issue, I am thinking more
about, how in the long run comoutational activities will affect
gender than how the gener will affect the activities.

Their work provies good examples of material that overlaps with
School science and math, and of an alternative style applied to
these subjects – ins
tead of formal style that uses rules, a
concrete style that uses objects.

202

It is worth noting that the students appreciated the
self-organizing nature of the traffic jam only because they had
written the programs themselves. Had they been using a packaged
simulation, they would have had no way of knowing the elegant
simplicity of the programs underlying the jam.

Emergent stuctures often behave very differently than the elements
that compose them.

207

The cathedral model of education applies the same principle to
building knowledge structures. The curriculum designer in cast in
the role of a “knowledge architect” who will specify a plan, a
tight progra, for the placement of “knowledge brick’s” in
children’s minds.

208

What is typical of emergently programmed systems is that
deviations from what was expected do not cause the wholw to

209

We are living with an edicational systsem that is fundamentally as
irrational as the command economy and ultimately for the same
reason. It does not have capacity for local adaptation that is
necessary for a complex system even to function effieciently in a
changing environment, and is doubly necessary for such a system to
be able to evolve.

Defininf educational success by test scores is not very different
from couting nails made rather than nails used.

212

But calling hierarchy into question is the crux of the problem if
educational change.

216

Each of these cases suggests ways in which a little school created
in a militant spirit can mobilize technology as an assertion of
identity.

217

I could continue in this spirit, but this may be enough to make
the point that little schools could give themselves a deeper and
more conscious specific identity. Everything I have said in this
book converges to suggest that this would produce rich
intellectual environments in which not only children and teachers
but also new ideas about learning would develop together.

I see little schools as the most powerful, perhaps an essential,
route to generating variety for the evolution of education.

The prevailing wisdom in the education establishment might agree
with the need for variety but look to other sources to provide
it. For example, many – let us call them the Rigorous
Researchers – would say that the proper place for both variation
and selection is in the laboratory. On their model, researchers
should develop large numbers of different ideas, test them
rigorously, select the best, and disseminate them to schools.

In my view this is simply Gosplan in disguise.

218

The importance of the concept of the little school is that it
provides a powerful, perhaps by far the most powerful, strategy to
allow the operation of the principle of variation and selection.

This objection depends on an assumption that is at the core of the
technicalist model of education: Certain procedures are the best,
and the people involved can be ordered to carry them out. But even
if there were such a thing as “the best method” for learning, it
would still only be the best, or even mildly good, if people
believed in it. The bueracrat thinks that you can make people
beleive in something by issuing orders.

221

The design of learning environment has to take account of the
cultural environment as well, anad its implementation must make
serious effort at involvement of the communities in which it is to
operate.

223

It is no longer necessary to bring a thousand children together in
one building and under one administration in order to develop a
sense of community.

224

I do not see that School can be defended in its social role. It
does not serve the functions it claims, and will do so less and
less.

*

MegaChange!

Talking about megachange feels to them like fiddling when Rome
burns. Education today is faced with immediate, urgent
problems. Tell us how to use your computer to solve some of the
many immediate practical problems we have, they say.

Impediments to change in education such as, cost, politics, the
immense power of the vested interests of school bureaucrats, or lack
of scientific research on new forms of learning.

Large number of teachers manage to create within the walls of their
own classrooms oases of learning profoundly at odds with the
education philosophy espoused by their administrators…

But despite the many manifestations of a widespread desire for
something different, the education establishment, including most of
its research community, remains largely committed to the educational
philosophy of the late nineteenth and early twentieth centuries, and
so far none of those who challenge these have hallowed traditions
has been able to loosen the hold of the educational establishement
on how children are taught.

Do children like games more than homework because, the later is
harder than the former?

Most [games] are hard, with complex information – as well as
techniques – to be mastered, in the information often much more
difficult and time consuming to master than the technique.

These toys, by empowering children to test out ideas about working
within prefixed rules and structures in a way few other toys are
capable of doing, have proved capable of teaching students about the
possibilities and drawbacks of a newly presented system in ways many

In trying to teach children what adults want them to know, does
School utitlize the way human beings most naturally learn in
non-school settings?

If it has so long been so desperately needed, why have previous
calls for it not caught fire?

K[G]nowledge Machine

Is reading the principal access route to knowledge?

Literacy is being able to read and write. Illiteracy can be
remedied by teaching children the mechanical skill of decoding black
marks on white paper.

/Letteracy/ and /Letterate/

… the Knowledge Machine offers children a transition between
preschool learning and true literacy in way that is more personal,
more negotiational, more gradual, and so less precarious thant the
abrupt transition we now ask chidlrento malke as they move from
learning through direct experience to using the orinted word as a
source of important information.

…. School’s way is the only way beacause they have never seen or
imagined convincing alternatives in the ability to impart certain
kinds of knowledge.

* Babies learn to talk without curriculum or formal lessson

* People
develop hobbies at skills without teachers

* social behavior is picked up other than through classroom
beahvior

Parable of the Automobile:

… certain problems that had been abstract and hard to grasp
became concrete and transparent, and certain projects that had
seemed interesting but too complex to undertake became
manageable.

Paulo Freire: “Banking model” information is deposited in
child’s mind like money in a savings account.

/Tools/ for creating new experiments in effective fashion.

* Ideas

* Dewey: children would learn better if learning were truly a
part of living experience

* Freire: chidlren would learn better if they were truly in
charge of their own learning processes

* Piaget: intelligence emerges from an evolutionary process in
which many factors must have time to find their equilibrium.

* Vygotsky: Conversation plays a crucial role in learning.

Why did the discovery method fail?

By closing off a much larger basis of knowledge that should
serve as a foundation for formal mathematics taught in school
and perhas a minimal intuitive basis directly connected with
it.

The central problem of mathematics education is to find ways
to draw on the child’s vast experience of oral
mathematics. Computers can do this.

Giving chidlren opportunity learn and use mathematics in a
nonformalized way of knowing encourages rather than inhibits
the eventual adoption of formalized way, just as the XO,
rather than discouraging reading, would eventually stimulate

Traditionally teh art and writing classes are for fantasy but
science deals with facts; union of technology with biology.

It allows them to enter science through a region where
scientific thinking is most like there own thinking.

Reading biographies and iterrogating friends has convinced me
that all successful learners find ways to take charge of their
early lives sufficiently to develop a sense of intellectual
identity.

Schools have inherent tendency to infantilize the children by
placing them in a position of have to do so as they are told,
to occupy themselves with work dictated by someone else and
that, morever, has no intrinsic value – school work is done only
because the designer of the curriculum decided that doingthis
work would shape the doer into a desirable form[for the
authorities?].

NatGeo: Kidnet??Robert Tinker

Researchers, following the so-called scientific method of
using controlled experiments, solemnly expose the children to
a “treatment” of some sort and then look at measurable
results. But this flies in the face of all common knowledge
of how human beings develop.

The method of controlled experimentation that evaluates an
idea by implementing it, taking care to keep everything else
the same, and measuring the result, may be an appropriate way
to evaluate the effects of a small modification. However, it
change… It will be steered less by the outcome of tests and
measurements than by its participant’ intuitive understanding.

The prevalent literal-minded, “what you see is what you get”
approach measuring the effectiveness of computers in learning
by teh achievements in present-day classroons makes it certain
that tomorrow will always be prisoner of yesterday.

Example of Jet attached to horse wagon.

… most people are more interested in what they learn than in how
the learning happens.

But math is not about feeling the relationship of your body to
numbers.

Turtle lets you do this!

Intellectual work is adult child’s play.

Example that if observation of schools in some country where
only one writing instrument could be provided for every fifty
students suggested that writing does not significantly help
learning.

The change requires a much longer and more social computer
experience than is possible with two machines at the back of
the classroom.

/Balkanized Curriculum and impersonal rote learning/

What had started as a subversive instrument of change was
neutralized by the system and converted into an instrument of
consolidation.

Schools will not come to use computers “properly” because
researchers tell it how to do so.’

It is characteristic of a conservative systems that
acoomodation will come only when the opportunities of
assimilation have been exhausted.

* Immediate Feedback
* Individualized instruction
* Neutrality *

CAI will often modestly raise test scores, especially at the low end
of the scale. But it does without questioning the structure or the
educational goals of the traditional School.

Today, because it is the 15th Monday of your 5th grade year,
you have to do this sum irrespective of who you are or what
you really want to do; do what you are told and do it the
way you are told to do it.

Piaget was the theorist of learning without curriculum;
School spawned the projectof developing a Piagetian curriculum.

The central issue of change in education is the tension
between technicalizing and not technicalizing, and here the teacher
occupies the fulcrum position.

Shaw: He who can, does; he who cannot, teaches.

The system defeats its own purpose in attempt to enforce them.

School has evolved a heirarchical system of control that
sets narrow limits within which the actors – administators
as well as teachers – are allowed to exercise a degree of
personal initiative.

Hierarchy vs. Heterarchy

The major obstacle in the way of teachers becoming learners

The problem with developed’ countries as opposed to `developing’ ones
is that the developed countries are already there, there is no further
development possible.

In education, the highest mark of success is not having imitators but
inspiring others to do something else.

As long as there is afixed curriculum, a teacher has no need to become
involved
in the question what is and what is not mathematics.

Society cannot afford to keep back its potentially best teachers
simply because some. or even most, are unwilling.

The how-to-do-it literature in the constructivist subculture is almost
as strongly biased to the teacher side as it is in the instructionist
subculture.

Some etymology:

/Mathematikos/ disposed to learn
/mathema/ a lesson
/manthanein/ to learn

\ldots mathetics is to learning what heuristics is to problem solving.

What is that feeling when you look at a familiar object, with a sense
that you are looking at the object for the first time?
It is /jamais vu/.

Attempts by teachers and textbook authors to connect school fractions
with real life via representations as pies simply reuslyed in a new
rigidity.

* What is the difference in learning at school and all other learning?
Generally in life, knowledge is acquired to be used. But school
learning more often fits Freire’s apt metaphor: Knowledge is treated
like money, to be put away in a bank for the future.

* What does /Computer Literacy/ mean?

* The Technology of the Blackboard and The Technology of The Computer

* Lines You can use:

**
The computer to program the student…
OR
The student to program the computer…

**
Computer as an expensive set of flash cards.

**
If the students scores improve, our approach must be right.

**
Self-directed activities versus carefully guided ones
**
If the scores improve does it mean that the strategy is effective/
approach is right?
**
Heterarchical versus Hierarchical
**
Totalitarian Education or Trivialized Education

# I hope Aamir Khan Won’t Mind…

I hope Aamir Khan Won’t Mind this plagarism…

Instead of Ghajini – Ganne Ka Ras

Innovative use popular iconism…

Near Jama Masjid, Old Delhi