Drawing on Images using Tableau’s Interworks tool

Vignesh Suresh
4 min readNov 17, 2020

The idea to draw on images came to my mind while I did a course on Tableau which had modules and tutorials talking about how to draw shapes like Triangle, Rectangle, Square etc. using coordinates. The course I did also taught me to implement the same on floor plan images.

During the lockdown, people have come with social-distancing views and ideas where they have showcased the real world social distancing on floor plan images using the technique of drawing polygons in Tableau.

Ken Flerlage wrote a blog post talking about how to make a social distancing plan in Tableau. Here is the link to the blog post.

I really liked Ken Flerlage’s implementation. You can view his work here.

Avinash Reddy Munnagi also took inspiration from his idea and executed the same. His workbook can be viewed here.

I even liked Praveen Jose’s implementation which focused the same idea inside a bus. You can view it here.

I learned the technique and implemented the same using Tableau but not on floor plans. I thought, how nice it would be if I can use any other image??

Image Source: https://deadline.com/2020/04/americas-got-talent-reopens-online-auditions-coronavirus-1202897717/

This image of AGT I saw on Google and I found the perfect image to work on. Thinking and thinking, I came up with the idea of implementing Face Detection and Recognition like effect with Tableau. Hey???? Don’t worry. No coding involved.

Search and download the image from Google of your choice. After downloading the image, save the image in a folder or directory.

For implementation of the idea on the AGT image, I built the below dataset.

Shape, Path Order,X1,Y1
Howie Mandel,1,431,1208
Howie Mandel,2,685,1200
Howie Mandel,3,681,942
Howie Mandel,4,427,942
Heidi Klum,1,857,1202
Heidi Klum,2,1096,1200
Heidi Klum,3,1093,940
Heidi Klum,4,853,944
Sofia Vergara,1,1338,1204
Sofia Vergara,2,1608,1202
Sofia Vergara,3,1605,927
Sofia Vergara,4,1334,927
Simon Cowell,1,1786,1189
Simon Cowell,2,2052,1193
Simon Cowell,3,2044,919
Simon Cowell,4,1778,919
Terry Crews,1,1136,1560
Terry Crews,2,1406,1564
Terry Crews,3,1414,1273
Terry Crews,4,1138,1267

I plotted the coordinates manually by trial and error. This will consume time. Instead, using Tableau’s Interworks tool, your job becomes easy. After building the dataset, save the dataset as .xlsx or .csv file. After saving, bring it into Tableau.

Now, our job is to bring the background image into Tableau. So, go to the Map option -> Background Images and choose the dataset sheet. Then , select Add Image. Choose the image from the path where you had saved earlier. Your X coordinate starts from 0 and goes to the width of the image and Y coordinate starts from 0 and goes to the height of the image .( You can get the width and height by using an Image editor like Paint, Snagit, GIMP, etc). Another way is you can right click, select Properties, choose Details and scroll down to Image Section, There you will find height and width of image.

Click Ok and Click Ok.

Now we will build the viz, Change Mark type to Polygon.

Then, put X1 to Columns and Y1 to Rows. Your image should appear. Fix the axes if needed by editing the axes. Then, put Shape to Detail and Path Order to Path shelf. Reduce the color opacity to 0% and give a nice color to the Border in the Effects section.

You should see the following.

Face Detection

After, do a little bit of cleanup, edit the tooltips and remove all Dividers and Lines.

And Yes! your Face Detection effect in an image using only Tableau is done. You can stop here if you like or do Face Recognition.

For Face Recognition effect, the steps are the same. After doing Face Detection, You can filter the names on multiple sheets, bring the image to the dashboard and float the names on top of the squares. This is the method I used.

Face Recognition

Another method is you can create a dataset from the image itself. Andy Kriebel has explained the technique in this video. Using this technique, you can achieve the Face Recognition effect. You can download my workbook here. This technique can be used to even implement text detection , object detection , pedestrian detection etc.

You can connect with me on Twitter, LinkedIn and Tableau-Public.

Thanks for reading.

Vignesh Suresh.

--

--