Precision shoot time in the EXIF

  • 14 Replies
  • 3613 Views
Precision shoot time in the EXIF
« on: 03 / August / 2014, 06:38:35 »
Advertisements
Hi Folks!

I am taking aerial pictures from an UAV and then assembling them into large mosaics of the area we've been flying over.

Every time I shoot a picture, I need to store geolocation and aircraft attitude at the moment the picture's been taken. So on one side I have the autopilot logging this data at the moment it sent the command to shoot a picture, and on the other side the camera recording the pictures.

My issue here is that sometimes pictures are not taken by the camera (too short interval between pictures or other reasons) and I have trouble identifying which logged event by the AP corresponds to which picture (there can be well over 300 pictures, so this has to be automated).

Using the EXIF time on the picture I can pretty much solve most of the syncing, but the EXIF time is only accurate to the second, so often times not accurate enough to discriminate between two events.

I am thus looking for a way to build a script that would add the get_tick_time (which is accurate to the millisecond) info to the EXIF everytime a picture is shot. Any idea on how to do that?

Thanks a lot folks, help is really appreciated!

Re: Precision shoot time in the EXIF
« Reply #1 on: 03 / August / 2014, 10:45:55 »
Any idea on how to do that?
Yes, but I have a couple of questions and suggestions you might want to consider before attempting it.

First of all,  it would be good to know what equipment you are using (especially the camera model) and specifically how the autopilot is sending a shoot command to the camera.

Depending somewhat on your answer to the previous question,  there might be an easier way to do this that will work just as well (or better?) than putting data in the EXIF.  Why not just have a script write a log file to the SD card with one entry per shot including the image's filename,  exact time the shot was started, exact time the shot finished, exposure info, focus info etc ?  That would be easy to do.

Quote
My issue here is that sometimes pictures are not taken by the camera (too short interval between pictures or other reasons)
If we knew more about your shooting methods, there might be things the camera script can do to mitigate or eliminate many of these missed shots.  You'd still want the log (or exif info) but you would be using it less.

Ported :   A1200    SD940   G10    Powershot N    G16

Re: Precision shoot time in the EXIF
« Reply #2 on: 03 / August / 2014, 14:12:42 »
Hi waterwingz, and thanks for trying to help!

We are using a Canon ELPH 110HS. We've tried several ways to shoot the camera, initially through PTP (since we have USB host running on the autopilot that seemed quite handy) but the latency was pretty high and very variable.
USB remote through the detect pin was a bit unpractical for mechanical reasons in the UAV, so we ended up soldering wires on the shooter button and simulating the key press.
We've soldered both the half and full as we have noticed the shoot occurs faster when half has already been pressed (which we are maintaining at all times throughout the flight).

We have made a small software that takes all the pictures and the flight log and matches everything together.


Writing a log file on the camera would work just as great as writing to EXIF for us. Actually even better since we could use the 'half press' as a delimiter for different flights and produce one log per flight.

Re: Precision shoot time in the EXIF
« Reply #3 on: 03 / August / 2014, 14:24:02 »
We are using a Canon ELPH 110HS. We've tried several ways to shoot the camera, initially through PTP (since we have USB host running on the autopilot that seemed quite handy) but the latency was pretty high and very variable.
Interesting - reyalp might have some comments about that.

Quote
USB remote through the detect pin was a bit unpractical for mechanical reasons in the UAV, so we ended up soldering wires on the shooter button and simulating the key press.
Fine by me - but I have to ask how you got a PTP connection to work (above) but were unable to connect to the USB 5V detect pin ?

Quote
We've soldered both the half and full as we have noticed the shoot occurs faster when half has already been pressed (which we are maintaining at all times throughout the flight).
The half press does the same thing I was going to suggest doing in the script - it locks the focus and exposure setting.

Quote
Writing a log file on the camera would work just as great as writing to EXIF for us. Actually even better since we could use the 'half press' as a delimiter for different flights and produce one log per flight.
So the script would autostart when you turn the camera on,  wait for a "half press" and initialize a new log and then set focus & expsosure.   Each full press would be detected by the script and cause a picture to be taken and a log entry made with shot start time.  When the half press goes away the script would close the log file and loop back to waiting for another half press. 

Does that do it ?
Ported :   A1200    SD940   G10    Powershot N    G16


Re: Precision shoot time in the EXIF
« Reply #4 on: 03 / August / 2014, 16:10:56 »
That's interesting comments here.

I'll PM reyalp to get some infos on the PTP. As for connecting the PTP, we tested it on the ground out of the airframe and connected to a desktop computer. Fitting a USB cable in the UAV would require quite some modifications of the airframe. It would be worth it for PTP given the extra capabilities we get (we'd be able to check that the picture was effectively taken, and log the filename directly in the flight log), but it's easier to rig the shutter button rather than the usb otherwise.

When you say the half press 'locks the focus and exposure', does it locks it once and for all, or does it continuously adjusts them? The first picture we take is during initialization on the ground, so the exposure parameters will differ from those in-flight (focus is anyway forced to infinity in the CHDK settings).

The description of the script sounds great. Is there anything similar I could use as a starting point available somewhere?
Also, what would be (if any) the best way to log the time between the full press and the actual photo being taken?


Thanks!

Re: Precision shoot time in the EXIF
« Reply #5 on: 03 / August / 2014, 16:26:52 »
I'll PM reyalp to get some infos on the PTP.
He's is online almost ever day but later in the day.  I expect he will be by here shortly.

Quote
As for connecting the PTP, we tested it on the ground out of the airframe and connected to a desktop computer.
Using what software ?  chdkptp ?

Quote
When you say the half press 'locks the focus and exposure', does it locks it once and for all, or does it continuously adjusts them?
Once.  Unless you have one of the "continuous AF" or "servo AF" options enabled in the Canon menu, in which case it will constantly hunt for focus.  Which can be painful of the UAV has any significant level of vibration.

Quote
The first picture we take is during initialization on the ground, so the exposure parameters will differ from those in-flight
Why not wait until you are airborne to have the autopilot initiate the half-press ?  Otherwise,  the script can insert a initial delay.  Or even trickier,  wait until the focus distance is greater than 50 ft.

Quote
(focus is anyway forced to infinity in the CHDK settings).
That works better on some cameras than others unfortunately.  I'm still working on fixing that.

Quote
The description of the script sounds great. Is there anything similar I could use as a starting point available somewhere?
When I get a few minutes later today, I'll do an intial version for you. 

Of course, that's what I said last time and this was the result several months later :  KAP_UAV_Exposure_Control_Script

Quote
Also, what would be (if any) the best way to log the time between the full press and the actual photo being taken?
Just log the time that the script assert the "full press" and then time the delay until the exposure counter increments.  It's not perfect but I think it's about as good as it gets.  That's how this script works :  Fast_Shooter_Intervalometer
Ported :   A1200    SD940   G10    Powershot N    G16

*

Offline reyalp

  • ******
  • 11514
Re: Precision shoot time in the EXIF
« Reply #6 on: 03 / August / 2014, 17:04:55 »
I'll PM reyalp to get some infos on the PTP. As for connecting the PTP, we tested it on the ground out of the airframe and connected to a desktop computer.
Please just post in the open forum, either in this thread or a new one.

It is possible to trigger shots over USB with latency similar to your shutter button hack, or lower if you use CHDK 1.3 shoot hooks.
Don't forget what the H stands for.

Re: Precision shoot time in the EXIF
« Reply #7 on: 03 / August / 2014, 17:45:29 »
Using what software ?  chdkptp ?
Yes, precisely

Quote
Why not wait until you are airborne to have the autopilot initiate the half-press ?  Otherwise,  the script can insert a initial delay.  Or even trickier,  wait until the focus distance is greater than 50 ft.

The reason we're taking this picture on the ground is twofold: it makes an easy to recognize 'start of flight' picture, and it lets us assess that the camera is connected properly and working before take off.
We could easily reprogram to take the picture on the ground through a full press only, and set the half press once we are airborne. Is 50fts the minimum distance the canon considers infinity?

Quote
That works better on some cameras than others unfortunately.  I'm still working on fixing that.

What's the best way to handle the focus then? Is there any safe means in the script to force it to infinity, or should we anyway make a half press when up in the sky?

Quote
When I get a few minutes later today, I'll do an intial version for you. 

You my friend, do deserve a significant amount of free beer thrown your way  :P thanks again!


Re: Precision shoot time in the EXIF
« Reply #8 on: 03 / August / 2014, 17:50:06 »
Please just post in the open forum, either in this thread or a new one.

It is possible to trigger shots over USB with latency similar to your shutter button hack, or lower if you use CHDK 1.3 shoot hooks.

Hey reyalp, will do.

I'm not sure what you are refering to when mentionning the 'shoot hooks', could you point me to some documentation?

Re: Precision shoot time in the EXIF
« Reply #9 on: 03 / August / 2014, 17:54:21 »
I'm not sure what you are refering to when mentionning the 'shoot hooks', could you point me to some documentation?
http://chdk.wikia.com/wiki/Script_Shooting_Hooks

Basically a way to have a script start a shooting sequence and then halt it just before the actual shutter opens while it waits for some event ( like a PTP "complete the shoot" command).
Ported :   A1200    SD940   G10    Powershot N    G16

 

Related Topics