Dolly Zoom - Creative Uses of CHDK - CHDK Forum  

Dolly Zoom

  • 21 Replies
  • 843 Views
Dolly Zoom
« on: 12 / July / 2020, 22:17:09 »
Advertisements
Here's my attempt at a Dolly Zoom:



Starting Zoom: #64 (18.673mm)
Ending Zoom : #23 (6.243mm)
Starting Camera Position: 5.00inches
Ending Camera Position: 43.94inches
Object Position: 63.5inches

The zoom motion is still kind of rough, but then, most of the time stepping to the next zoom level doesn't work.  When it fails I had to step forward 3 and back 2 to get it to the correct zoom.  Must be a better way?

The setup:



Canon Elph 330HS, on a ServoCity Channel Slider Kit A, modified with 48 inch slider and NEMA-17 stepper.  40 inches travel/2667 steps, 0.015 inches/step. Stepper controlled by HUZZAH ESP8266, with embedded web server.

Also fitted with camera mount on a worm gear + stepper: 360 degrees/5400 steps, 0.066 degrees/step, for a "tracking shot":





Camera rotates a constant angle for each frame, then calculates the horizontal position. Also possible is moving a constant horizontal distance for each frame, then calculating the rotation, which makes the motion faster in the middle and slower at the ends.

*

Offline reyalp

  • ******
  • 12742
Re: Dolly Zoom
« Reply #1 on: 12 / July / 2020, 22:30:38 »
Here's my attempt at a Dolly Zoom:

Nice :D
Quote
The zoom motion is still kind of rough, but then, most of the time stepping to the next zoom level doesn't work.  When it fails I had to step forward 3 and back 2 to get it to the correct zoom.  Must be a better way?
How are you setting zoom, with key clicks, or set_zoom?

If you use CHDK 1.5, and set_zoom, you can try setting the zoom to slow speed before stepping, like set_zoom_speed(1)

The speed is out of 100, but there are typically 2 (most likely on your camera) or 3 distinct speeds and it's rounded to the nearest one.

On my elph180, using set_zoom_speed(1) seems to make the following work reliably, while the default speed doesn't.
Code: [Select]
z=get_zoom()
set_zoom(z+1)
Don't forget what the H stands for.

Re: Dolly Zoom
« Reply #2 on: 13 / July / 2020, 00:09:28 »
Quote
How are you setting zoom, with key clicks, or set_zoom?

set_zoom().  Using USB remote zoom in/out, only got about a dozen steps from in to out.  With set_zoom() , got 101.  Well, usually.

Quote
If you use CHDK 1.5, and set_zoom, you can try setting the zoom to slow speed before stepping, like set_zoom_speed(1)

The docs said "Note 1: set_zoom_speed has no effect on most of CHDK supported cameras, it works only for the S2 and S3." so I thought it wouldn't make a difference on the ELPH 330HS (which is an IX model I think?)  Doesn't seem to change the zoom speed at least.

Here's what I'm using, although it doesn't work right for negative increment (-z):

Code: [Select]
zmax=get_zoom_steps()

znext=get_zoom()+z
if (znext < 0 ) then
        znext = 0
end
if (znext > zmax) then
        znext = zmax
end

set_zoom(znext)

i=1

while (get_zoom() ~= znext) do
        i = i + 1
        if  (zmax >= znext + i)  then
                print("knock:",znext+i)
                set_zoom(znext+i)
        else
                if (znext - i >= 0 ) then
                        print("knock:",znext-i)
                        set_zoom(znext-i)
                else
                        break
                end
        end
        set_zoom(znext)
end

*

Offline reyalp

  • ******
  • 12742
Re: Dolly Zoom
« Reply #3 on: 13 / July / 2020, 01:02:50 »
The docs said "Note 1: set_zoom_speed has no effect on most of CHDK supported cameras, it works only for the S2 and S3." so I thought it wouldn't make a difference on the ELPH 330HS (which is an IX model I think?)  Doesn't seem to change the zoom speed at least.
We recently (CHDK 1.5 autobuild 5508 and later) changed it so many cameras support at least 2 speeds. Generally, Digic 4 and later cameras that zoom more slowly video is recording should now be able to set the slow speed in CHDK.

If you are using the above version or later and it doesn't work, let me know which Canon firmware you have and I'll take a look.
Don't forget what the H stands for.


Re: Dolly Zoom
« Reply #4 on: 13 / July / 2020, 02:02:56 »
Here's my attempt at a Dolly Zoom:

Really good…

Can you tell us a little bit more about the image processing and software you use?

If the zoom steps are not too large, then you can also use software to smooth steps between.

https://chdk.setepontos.com/index.php?topic=13403.10
https://chdk.setepontos.com/index.php?topic=12761.msg143107#msg143107

M100 100a, M3 101a, 2*G1x (101a,100e), S110 (103a), SX50 (100c), SX230 (101a), S45,
Flickr https://www.flickr.com/photos/136329431@N06/albums
YouTube https://www.youtube.com/channel/UCrTH0tHy9OYTVDzWIvXEMlw/videos?shelf_id=0&view=0&sort=dd

Re: Dolly Zoom
« Reply #5 on: 13 / July / 2020, 12:44:42 »
We recently (CHDK 1.5 autobuild 5508 and later) changed it so many cameras support at least 2 speeds. Generally, Digic 4 and later cameras that zoom more slowly video is recording should now be able to set the slow speed in CHDK.

Currently using CHK_DE 1.4.1, Camera ixus255_elph330hs, FW 100f
So, ver 1.5 might fix the zoom problem?

Can you tell us a little bit more about the image processing and software you use?

Images from the camera are globbed into an MP4 with this script:

Code: [Select]
#!
DIR=`pwd`
IMAGE=`basename $DIR`
ffmpeg  -framerate 25 -pattern_type glob -i IMG\*.JPG ${IMAGE}.mp4

...and the MP4 converted to GIF with this:

Code: [Select]
#!
DIR=`pwd`
IMAGE=`basename $DIR`
ffmpeg -i ${IMAGE}.mp4 -vf scale=480:-1 -r 25 -f image2pipe -vcodec ppm - \
| convert -delay 4 -coalesce -duplicate 1,-2-1 -layers OptimizePlus -loop 0 - ${IMAGE}.gif

Camera position controlled by ESP8266, based on (height of object / height of image) == (lens distance to object / focal length) == zoomConstant. So, lens distance to object = zoomConstant * focalLength.  zoomConstant set by initial parameters entered into device's web page:



ESP8266 steps through a table of focalLength[zoomStep]; calculates camera distance for current zoom focal length; moves camera to position; triggers camera script (shoot, increment zoom).  Repeat until no more zoom steps, or reached the end of the camera rail.

Unfortunately, moving the camera smoothly and accurately is slow; takes a couple minutes to complete the entire zoom process.

*

Offline reyalp

  • ******
  • 12742
Re: Dolly Zoom
« Reply #6 on: 13 / July / 2020, 14:29:47 »
Currently using CHK_DE 1.4.1, Camera ixus255_elph330hs, FW 100f
So, ver 1.5 might fix the zoom problem?
Yes, quite likely it will work if you use 1.5 and set_zoom_speed(1)
Don't forget what the H stands for.

Re: Dolly Zoom
« Reply #7 on: 13 / July / 2020, 19:52:01 »
Yes, quite likely it will work if you use 1.5 and set_zoom_speed(1)

Well, that didn't work (1.5.0 rev 5543).  Instead of incrementing the zoom, the script causes the camera to halt:  screen dark, lens extended, dead.  Back to 1.4.1.


*

Offline reyalp

  • ******
  • 12742
Re: Dolly Zoom
« Reply #8 on: 13 / July / 2020, 20:27:49 »
Well, that didn't work (1.5.0 rev 5543).  Instead of incrementing the zoom, the script causes the camera to halt:  screen dark, lens extended, dead.  Back to 1.4.1.
That's not good. If you can post the crash log, that may be helpful. Go to Miscellaneous Stuff->Debug Parameters->Save ROM crash log and post the ROMLOG.LOG here. Note you can do this with either version of CHDK running, it just saves information from the most recent crash from camera internal memory to the SD card.
Don't forget what the H stands for.

Re: Dolly Zoom
« Reply #9 on: 13 / July / 2020, 23:22:07 »
That's not good. If you can post the crash log, that may be helpful.
Here you go...

 

Related Topics