GUI for camera

Questions and postings pertaining to the usage of ImageMagick regardless of the interface. This includes the command-line utilities, as well as the C and C++ APIs. Usage questions are like "How do I use ImageMagick to create drop shadows?".
Post Reply
zemlik
Posts: 38
Joined: 2014-03-05T06:12:01-07:00
Authentication code: 6789

GUI for camera

Post by zemlik »

hello,
The ImageMagick parts like convert ( is that called a routine ? ) seem to me to be very useful.
It is possible to replace a real world rostrum camera with manipulating a flat image file in software.
I do some little tests in bash but I would like to have a complete solution.
Does there exist a software that mimics a rostrum camera in software ?

cheers
zem
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: GUI for camera

Post by fmw42 »

You can script the Ken Burns effect (http://en.wikipedia.org/wiki/Ken_Burns_effect) with Imagemagick doing the panning and zooming and combining the frames into an animation. You would need to have a list or text file of translations and zooms for each frame. Or just a start x,y and end x,y and start zoom and end zoom and number of frames. The script could then linearly interpolate those arguments. The IM function -distort SRT could do the processing. The script would depend upon your OS (Windows vs Unix). I think the Ken Burns effect is the basics of your rostrum camera processing.
Correct me if this is not what you want to do.
zemlik
Posts: 38
Joined: 2014-03-05T06:12:01-07:00
Authentication code: 6789

Re: GUI for camera

Post by zemlik »

yes.
to describe
an image file of a grid has size say 7200x7200 pixels
the center of the image would be north 0. south 0. east 0, west 0 and the zoom would be 0.
then you would say move the center of your view to N=20;W-5 in so many frames and I want to start slowly and finish slowly.
additionally while you are doing that I want to move the image that is attached to pegbar inside top by 3 increments [west].
that should be doable in software.
snibgo
Posts: 12159
Joined: 2010-01-23T23:01:33-07:00
Authentication code: 1151
Location: England, UK

Re: GUI for camera

Post by snibgo »

ImageMagic contains the tools to generate each frame. I use "-distort SRT" for this.

The software to drive this might be very complex. You also need to decide how the user will specify the pan/zoom movements, soft start/end, etc.
zemlik wrote:Does there exist a software that mimics a rostrum camera in software ?
Probably all video editors can do this.
snibgo's IM pages: im.snibgo.com
zemlik
Posts: 38
Joined: 2014-03-05T06:12:01-07:00
Authentication code: 6789

Re: GUI for camera

Post by zemlik »

I am a little bit stupid I know, I said does there exist a software that will mimic a rostrum camera.?
snibgo
Posts: 12159
Joined: 2010-01-23T23:01:33-07:00
Authentication code: 1151
Location: England, UK

Re: GUI for camera

Post by snibgo »

I expect most video editors can do the pan/zoom functions of a rostrum camera. For example: Movie Maker, included with MS Windows. Or Blender, which is open source for many platforms, is far more powerful but also far more complex. Or the professional tools from Adobe.
snibgo's IM pages: im.snibgo.com
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: GUI for camera

Post by fmw42 »

zemlik wrote:yes.
to describe
an image file of a grid has size say 7200x7200 pixels
the center of the image would be north 0. south 0. east 0, west 0 and the zoom would be 0.
then you would say move the center of your view to N=20;W-5 in so many frames and I want to start slowly and finish slowly.
This can be scripted easily for straight line movements for uniform speed. If you need non-uniform speeds, you would have to break it up into smaller segments and control the number of frames in each segment or change the delays for each segment.

zemlik wrote:additionally while you are doing that I want to move the image that is attached to pegbar inside top by 3 increments [west].
I do not understand this. Can you show an example animation or one frame showing this aspect?
zemlik
Posts: 38
Joined: 2014-03-05T06:12:01-07:00
Authentication code: 6789

Re: GUI for camera

Post by zemlik »

I do not understand this. Can you show an example animation or one frame showing this aspect?
I'll try and do something later to show.
I started to try to do a zoom/loop ( http://mickiwiki.com/images/bear.mp4 ) using

Code: Select all

#!/bin/bash
((x = 4800))
((h = 4800))
(( y = 60))
(( f = 50 ))
exp=`echo "1/$f" | bc -l`
num=`echo "$y^2/$x^2" | bc -l`
pr=`echo "1-(e($exp * l($num)))" | bc -l`
echo "this is the proportion: $pr"
for ((i=1; i<=$f; i++))
do
nf=`echo "sqrt(($x^2)*((1-$pr)^$i))" | bc -l`
printf -v chop "%.0f" "$nf"
echo "$i:$chop" >> fields.txt
((xc = $x/2))
((hc = $h/2))
printf -v hxc "%.0f" "$xc"
printf -v hhc "%.0f" "$hc"
dist=`echo "$x/$chop" | bc -l`
convert 4800bear.jpg -distort SRT $hxc,$hhc,$dist,0 4800bear-$i.jpg
done
and I could do a mix with

Code: Select all

#!/bin/bash
#--- { start..end..step} --
for i in {25..100..25}
do
((c = $c + 1))
echo "$i"
composite -blend $i 4800bear40-$c.jpg 4800bear1-4$c.jpg bearmix$c.jpg
done
I thought that it should be not too hard to emulate a real animation disk / rostrum camera using imagemagick perhaps using a database/spreadsheet to emulate a "dope sheet" with levels of scanned drawings and camera moves which a script can read and output frames of combined elements which can then be combined in a video composer.
I am not that familiar with the animation software but what I have looked at seem complicated and expensive.
Somebody must have done this ?
snibgo
Posts: 12159
Joined: 2010-01-23T23:01:33-07:00
Authentication code: 1151
Location: England, UK

Re: GUI for camera

Post by snibgo »

Blender is free but complicated. If I remember correctly, users can define a Bezier path for the panning.

For my own unpublished video editor, I use a simpler scheme. Panning is always in a straight line, so the user gives just start and end coordinates. Zooming is always proportional so just needs start and end factors. Each movement has optional soft start and end.
snibgo's IM pages: im.snibgo.com
zemlik
Posts: 38
Joined: 2014-03-05T06:12:01-07:00
Authentication code: 6789

Re: GUI for camera

Post by zemlik »

so I googled and it looks possible to read values from a CSV spreadsheet file with awk.
So I just need to know if can move one image over another in one go ?
I can see moving the frame over one image and then combining over another with

Code: Select all

 composite 
How is transparency of one image's background described ?
frame 1: A B
frame 2: AB
frame 3; BA
frame 4: B A
so image B moves left and over( or under ) image A on a background image
User avatar
glennrp
Posts: 1147
Joined: 2006-04-01T08:16:32-07:00
Location: Maryland 39.26.30N 76.16.01W

Re: GUI for camera

Post by glennrp »

zemlik wrote:The ImageMagick parts like convert ( is that called a routine ? )
We call them "utilities" or "commandline utilities".
Post Reply