By Alok Govil , Principal Engineer, Amazon
Collaborator: Venkataramanan Subramanian , Principal Engineer, Amazon
Computer Vision is often seen by software developers and others as a hard field to get into. In this article, we’ll learn Computer Vision from basics using sample algorithms implemented within Microsoft Excel, using a series of one-liner Excel formulas. We’ll use a surprise trick that helps us implement and visualize algorithms like Face Detection, Hough Transform, etc., within Excel, with no dependence on any script or a third-party plugin.
Figure 1: Outline of the steps to visualize a spreadsheet as an image. The spreadsheet, and thus the image, is then manipulated step by step using formulas.
“Very cool to see that with ‘simple’ Excel formulas you can do some real computer vision.”
“… never thought you can explain CV through simple Excel formulas and transformations. Hats-off :)”
“… used Excel to explain the core concepts and algorithms so clear that I feel I could start working with it right now! …”
“I’ve been wanting to learn how CV works for a while, and this was probably the best transition from data to visuals I’ve ever seen.”
“Just incredible build up from small to great one step at a time.”
Preview of what we will achieve
We will see how to detect a face using a toy example: (Below are screenshots of Excel shreadsheets.)
We will also see how to find edges and lines:
Expectations from the audience
No prior background in Computer Vision should be needed to follow the material. It is assumed that the audience knows Microsoft Excel basics and can read its documentation, or search online for interpreting the formulas used. Exceljet is a great resource for the latter.
Some mathematical understanding would be needed: Those who wouldn’t know what weighted average is would not be able to follow much. Understanding of partial derivatives would be helpful but not required. Most complex mathematical concept used is eigenvalues
, but again the readers should be able to follow even if they do not know or remember the same.
)
Instructions
The crux of the material is in the Excel files .xlsx) available below for downloading. These are self-explanatory with notes inserted within. Please follow the sheets step-by-step. You may need to change zoom levels as per your monitor resolution.
The work was created using Excel 5930 on Windows; it should however open in other versions of Excel (tested with Excel (on Windows, and Excel for Mac).
While the files open in (LibreOffice (tested in version 6.4.0.3) x 98)), it is slow to the level of being unusable. We have not tested in Apache OpenOffice .
Relevant Excel Formula Options
Before opening the Excel file (s), change Excel Formula Calculation to “Manual” since some calculations (Hough Transform specifically) are time-consuming (say an hour). Then trigger recalculation manually as per need.
Also, uncheck “Recalculate workbook before saving”, else Excel will recalculate all the formulas every time you save the files.
Note: Be sure to revert these settings once you are done.
Those familiar with R1C1 formula reference style in Excel, or those adventurous, should try switching to it by looking in Excel options and turning it on. See the screenshot below and check the box to enable it. This changes the formulas from “D5” type format to a relative style like “R [-1] C [2]” (absolute references also allowed as “R4C5” for example), bringing it closer to programming languages and aiding understanding.
The full Excel file is more than 59 MB in size. The same content is also available in smaller parts.
The following can be downloaded by right-clicking. Alternatively, on left-clicking, Github will take you to preview page from where the raw .xlsx files can be downloaded.
GIPHY App Key not set. Please check settings