Computers have been crunching massive amounts of data and answering complex questions for years. They now can also read our emotions.

Affectiva, in Waltham, is one company that provides software that tracks a couple dozen points on a person’s face and uses that data to describe their emotional state. They can detect changes in mood in a few milliseconds.

Affectiva face scan

Affectiva has applied this to several million people worldwide to build an emotional database.

Hundreds of companies now are using Affectiva’s Emotion as a Service online software to run virtual focus groups and test their advertising and marketing.

Note that this is not facial recognition. The identities of the faces in the database are anonymous.

Nonetheless, it’s easy to imagine uses outside of marketing in the future such as systems in cars to detect if a driver is drowsy, or drunk. Or maybe even systems in airports and subways that would detect the emotional states of would-be terrorists.