[Elphel-support] Elphel camera on the Global Hawk
Scott Janz
scott.janz at nasa.gov
Wed Apr 21 17:11:49 PDT 2010
Thanks for the thorough explanation, I am now embedding the aircraft
supplied position parameters in the ImageDescription field. The next
flight has been postponed 24 hours and is now scheduled to take off at
0705 UTC Friday.
-scott
Andrey Filippov wrote:
> Scott,
>
> There is no easy way to write GPS data to Exif bypassing the program
> in C that does it. The Elphel PHP extension includes parsing Exif data
> into human readable form, but not the other way around.
>
> Internally camera maintains condensed Exif - "condensed" is what
> remains from the Exif header if you remove all the constant fields
> (like camera model) and the Exif pointers and merge the remaining
> fields together. These condensed Exif headers are copied from the
> "current" data buffer for each frame that is stored in the output
> video buffer so the Exif data can be re-assembled with the images when
> applications read them from the circular video buffer.
>
> When application (such as camogm, streamer or imgsrv) reads image
> frame and requests Exif header that dynamic data (individual for each
> acquired frame) is combined with the static template (generated at
> boot time) and provided to an application as complete Exif header.
>
> The php script that runs at startup:
>
> http://elphel.cvs.sourceforge.net/viewvc/elphel/elphel353-8.0/apps/web/imgsrv/exif.php?view=markup
>
> creates template from the XML file
>
> http://elphel.cvs.sourceforge.net/viewvc/elphel/elphel353-8.0/apps/web/imgsrv/Exif_template.xml?view=markup
>
> and builds the directory for the condensed Exif writable by the
> applications. This directory does not include the data format of the
> particular Exif fields - just the offset and length (in bytes) fo that
> field, referenced by the modified Exif tag number (modified to include
> both tag number and tag group in a single long number). It is up to
> the particular application to format data according to Exif
> conventions and matching the Exif_template.xml
>
> Example of the PHP script
>
> http://elphel.cvs.sourceforge.net/viewvc/elphel/elphel353-8.0/packages/web/353/camvc/camvc.php?view=markup
>
> 343 if ( $value!==null) elphel_set_exif_field(0x10e,
> $value.chr(0));
>
> writes string data from $value terminated by zero byte (chr(0) ) to
> Exif field with the tag 0x10e (group 0) , the tag called
> "ImageDescription" in Exif. The Exif_template.xml reserves 40 bytes
> fro the image description, so if you need more you have to modify that
> template file. It is also possible to add more fileds - you need to
> define them in Exif_template.xml, then write with
> elphel_set_exif_field (or directly using the device driver).
>
> It should be possible to write GPS data fileds with PHP script, but
> that would be more tricky than to wrikte to ImageDescription tag -
> you'll need to write data in the Exif format, not just string data.
> Making all such conversions in PHP may add considerable load if the
> data is updated at high rate, you may need to write a C program,
> modifying it from this one:
>
> http://elphel.cvs.sourceforge.net/viewvc/elphel/elphel353-8.0/apps/garminusb2nmea-0.12a/nmea2exif.c?view=markup
>
> So the quick fix that I would recommend is to format the required data
> into a string of <=40 bytes and use elphel_set_exif_field(0x10e,
> $string_to_write.chr(0));
>
> Andrey
>
More information about the Support-list
mailing list