XMP toolbox for Matlab

我与影子孤独终老i 提交于 2019-12-12 05:38:44

问题


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?


回答1:


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.




回答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.



来源:https://stackoverflow.com/questions/9375057/xmp-toolbox-for-matlab

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!