How do I decode DigitalCamera.MakerNote returned by imfinfo as a vector of doubles?

10 次查看(过去 30 天)
  2 个评论
Duncan Carlsmith
Duncan Carlsmith 2023-6-24
The data returned by imfinfo is double but appears to be all positive integers and I've tried char(V) and variants of char((u)intXX(V)). Can you be more explicit about using swapbytes?

请先登录,再进行评论。

采纳的回答

Duncan Carlsmith
Duncan Carlsmith 2023-6-24
Answering my own question after much ferreting around. It appears that the APPLE makernotes file is a BLIST, a binary version of a property list (plist), and MATLAB's imagesci.rjpg8cimf, invoked from imfinfo, must just throw up its hands and encode the makerfile as a bunch of integers and return a doubles vector.
The EXIFTools source code in PERL for decoding the BLIST is at
https://github.com/exiftool/exiftool/blob/master/lib/Image/ExifTool/Apple.pm
and references
https://medium.com/@karaiskc/understanding-apples-binary-property-list-format-281e6da00dbd
A python decoder is at
https://docs.python.org/3/library/plistlib.html
Discussion: https://stackoverflow.com/questions/27509319/decoding-data-from-plist-file
It would be great if imfinfo were as complete as EXIFinfo. Not only does imfinfo not decode the MAKERNOTES, but it skips over quite a lot of other information.
It is possible to download and install EXIFinfo for various OSs from
https://exiftool.sourceforge.net/
and presumably to invoke it on a file programmatically from MATLAB but that makes its use out of the range of the novice user that I am writing code for, someone who never goes under the hood.
FYI, I've found a few free EXIFinfo servers including
https://www.metadata2go.com/view-metadata
https://jimpl.com/
and one with API access
https://www.conversion-tool.com/api-access/
but that API requires you put your image on a server someplace so you can't just upload a file via a MATLAB RESTFUL call. Not all of these services produce information identical to EXIFTools but they do return APPLE makernotes iPhone acceleration of gravity vector (from the built-in linear accelerometer chip sensor. This data and the bearing from the 3-axis magnetometer (compass) tell you the orientation of the camera locally and given the GPS info the orientation in celestial coordinates, which is what I'm after.

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 MATLAB Mobile 的更多信息

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by