Question

Has anyone ever heard of something that might facilitate the work with XMP metadata in Matlab?

For instance, EXIF metadata can be read simply by using the exifread command -

output = exifread(filename);

I've found this thread, but it seems to be dead.


Currently I am thinking about the following options:

  1. Writing MEX file using C++ XMP SDK
  2. Calling Java routines using JAVA XMP SDK

To summarize, the question is: Do you have any idea on how XMP can be read/written in Matlab?

Was it helpful?

Solution 2

I have found the answer. The best way is to download ExifTool and any Matlab JSON parser. It is possible to extract it from any file format, including .DNG, .XMP, .JPEG, .TIFF.

Step 1: Extract the info into temporary JSON file by using

system(['exiftool -struct -j ' fileName '>'  tempFile]);

Step 2: Call the JSON parser on the tempFile
Step 3: You have the data in Matlab struct.

OTHER TIPS

XMP is just XML, so you can use any MATLAB XML toolbox. My personal favourite is xml_io_tools.


If you want to use the SDK to avoid having to manually interpret what bits of the XML means, then of your two options the Java one sounds preferable. Calling Java from MATLAB is straightforward, and you avoid the hassle of building things that MEX entails.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top