访问图像的Windows'标签'元数据字段 [英] Accessing Windows 'tags' metadata field of an image

查看:164
本文介绍了访问图像的Windows'标签'元数据字段的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我试图把手放在一些图像处理上。所以现在我想要的是读取图像exif数据。那么有2个内置函数可用于读取图像的exif数据。
问题是我想读取图片标签。 exifread imfinfo 这两个函数都没有显示图片标签。

I ma trying to put hands on some image processing. So for now what i am trying is to read image exif data. Well there are 2 built-in functions are available for reading exif data of an image. The problem is that i want to read image tags.exifread and imfinfo both of these functions do not show image tags.

有没有办法阅读图片标签?就像这张照片中突出显示的标签一样,

Is there any way to read image tags ? Like the tags are highlighted in this picture

推荐答案

步骤:



Steps:


  1. 下载exiftool 。我在google搜索后发现了一个,我不想在这里提供外部链接,但我可以说这是一个指针,网站上写着 -
    Phil Harvey的ExifTool。从那里获取zip设置文件,从中提取exe并将其放在MATLAB的当前工作目录中。

  1. Download exiftool. I found one after googling and I don't want to put up external links here, but this I can say as a pointer that the site reads - "ExifTool by Phil Harvey". Get the zip setup file from there, extract the exe from it and put it in the current working directory of MATLAB.

下载getexif.m frrom MATLAB FEX 并将其保存在当前
工作目录。

Download getexif.m frrom MATLAB FEX and also save it in the current working directory.

现在,您可以运行此MATLAB代码并获取标签信息 -

Now, you can run this MATLAB code and get the tag info -

%//Get image exif info as a char array
exif_data = getexif(path_to_image_file)

%// Split the char array into cells, where each cell holds both the field
%// and its value
exif_data_c = strsplit(exif_data,'\n')

%// Split each cell into its field and value
iminfo_fv_splt = strtrim(cellfun(@(x) strsplit(x,':'),exif_data_c,'uni',0))

%// Look for the field "Subject" and store it as this field appears to store tag info
subj = iminfo_fv_splt(cellfun(@(x,n) strcmp(x(1),'Subject'),iminfo_fv_splt))

%// Select the second cell that corresponds to the value of the field
tag_found = subj{1}(2)

输出 -

tag_found = 
    'New Zealand, Trey, lake tekapo, ratcliff, stuckincustoms, stuckincustoms.com, trey ratcliff'

这篇关于访问图像的Windows'标签'元数据字段的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆