Wolfram Language

Computational Photography

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]:=
Click for copyable input
files = Map[img \[Function] ExampleData[img, "FilePath"], ExampleData[{"TestImageSet", "Lisbon2016"}]];

View the date histogram of the images.

In[2]:=
Click for copyable input
dates = Map[file \[Function] Import[file, "DateTime"], files];
In[3]:=
Click for copyable input
DateHistogram[dates, Quantity[1, "Hours"]]
Out[3]=

View a collage of thumbnails.

In[4]:=
Click for copyable input
thumbnails = ExampleData[{"TestImageSet", "Lisbon2016"}, "ThumbnailList"];
In[5]:=
Click for copyable input
ImageCollage[thumbnails, Method -> "Columns", ImagePadding -> 2]
Out[5]=

Present the photos on a timeline.

In[6]:=
Click for copyable input
TimelinePlot[MapThread[Labeled, {dates, thumbnails}], PlotLayout -> "Vertical", ImageSize -> Medium]
Out[6]=

Gather all information in a dataset.

In[7]:=
Click for copyable input
gps = Map[file \[Function] Import[file, "GeoPosition"], files];
In[8]:=
Click for copyable input
ds = Dataset[ MapThread[ AssociationThread[{"Thumbnail", "DateTime", "GeoPosition"} -> {##}] &, {thumbnails, dates, gps}]]
Out[8]=

Show locations where images were taken.

In[9]:=
Click for copyable input
GeoGraphics[ MapThread[ GeoMarker, {Normal[ds[All, "GeoPosition"]], Normal[ds[All, "Thumbnail"]]}], ImageSize -> Medium]
Out[9]=

Related Examples

de es fr ja ko pt-br ru zh