A Trip at a Glance
A picture can be stored as a file containing both pixel content and meta-information. Using Import, you can get such metadata and discover programmable insights about the context of a picture.
Import and analyze a collection of photos taken during a visit to Lisbon.
In[1]:=
files = Map[img \[Function] ExampleData[img, "FilePath"],
ExampleData[{"TestImageSet", "Lisbon2016"}]];
View the date histogram of the images.
In[2]:=
dates = Map[file \[Function] Import[file, "DateTime"], files];
In[3]:=
DateHistogram[dates, Quantity[1, "Hours"]]
Out[3]=
View a collage of thumbnails.
In[4]:=
thumbnails =
ExampleData[{"TestImageSet", "Lisbon2016"}, "ThumbnailList"];
In[5]:=
ImageCollage[thumbnails, Method -> "Columns", ImagePadding -> 2]
Out[5]=
Present the photos on a timeline.
In[6]:=
TimelinePlot[MapThread[Labeled, {dates, thumbnails}],
PlotLayout -> "Vertical", ImageSize -> Medium]
Out[6]=
Gather all information in a dataset.
In[7]:=
gps = Map[file \[Function] Import[file, "GeoPosition"], files];
In[8]:=
ds = Dataset[
MapThread[
AssociationThread[{"Thumbnail", "DateTime",
"GeoPosition"} -> {##}] &, {thumbnails, dates, gps}]]
Out[8]=
Show locations where images were taken.
In[9]:=
GeoGraphics[
MapThread[
GeoMarker, {Normal[ds[All, "GeoPosition"]],
Normal[ds[All, "Thumbnail"]]}], ImageSize -> Medium]
Out[9]=