문제

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?

도움이 되었습니까?

해결책 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.

다른 팁

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.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top