WELCOME to China, the land of video surveillance. Guangdong province boasts over 1m cameras. In 2010 the city of Chongqing, governed by the now-disgraced Bo Xilai, ordered 500,000. Other provinces have hundreds of thousands, according to Human Rights in China, an NGO. Video surveillance constitutes over half the country's huge security industry, and is expected to reach 500 billion yuan ($79 billion) in 2015. China will soon overtake Britain, with around 3m cameras, as the capital of video surveillance.

Yet China is far from alone. In many democracies surveillance cameras are multiplying, too. And face-recognition technology is proving a wonder tool for both governments and marketers.

A jail in Alabama uses it to check those leaving against prisoner records. Mexican prisons use it to identify visitors. Heathrow airport is installing systems to track passengers through lounges and onto the plane. Brazil has plans to equip police with camera-spectacles that can identify troublemakers at the 2014 World Cup.

As for businesses, Quividi, a French marketer, can measure the age and gender of passers-by who linger at an advert; advertisers vary their offerings based on who is looking. A service called SceneTap gives similar information on the crowd in Chicago bars. The smiles of employees at Keihin Electric Express Railway in Japan are assessed by computer. Facebook, a social network, recognises uploaded photos. The latest smartphones can spot their users.

The technology is improving fast. In 2010, in an assessment by America's National Institute of Standards and Technology (NIST), the best program matched 92% of mugshots to one out of 1.6m pictures. Such results require high-quality still photos, stresses NIST's Jonathon Phillips. But progress continues on fuzzier moving images. The error rate halves every two years—and not just in the West. In the 2010 NIST tests Chinese entrants lagged behind, identifying just 64% of images. But their systems are now “state of the art”, says Sharon Hom of Human Rights in China.

System performance depends on the context. Controlled environments, such as jails, are ideal. An experiment in Mainz railway station in Germany got steady shots by mounting cameras over escalators (although the recognition rate only reached 60%). Putting the lens behind an advert is a good way to get subjects who are facing it. Facebook is good at recognising people because they pick names from a limited list of friends.

More cameras and better face recognition raise tricky legal and political questions. America places little restriction on the use of face recognition, as legal precedent denies the “reasonable expectation of privacy” in public. But Harley Geiger of the Centre for Democracy & Technology, an advocacy group, says the technology goes beyond normal public scrutiny and could create a world where everyone, in effect, becomes “a public figure”.

The industry is aware of reputational risks. Eric Schmidt, Google's chairman, has said that Google will limit its face-recognition services—to avoid “crossing the creepy line”. Last year the Digital Signage Federation, a trade group, adopted a strong set of face-recognition privacy standards.

Privacy-loving European countries are less easy-going, and usually require cameras to be matched with signs to tell people they are being watched. Facebook's face recognition has already fallen foul of tough German privacy laws. And America's Supreme Court is uneasy with technology that enables the persistent tracking of individuals in public.

Still, even democratic governments will want to monitor people as technology improves. But losing public anonymity could affect political life. Freedom of speech is reduced when mere physical attendance at protests goes on record. Kelly Gates, the author of a book on surveillance, sees a “chilling effect”.

Some countries welcome this. Nicholas Bequelin, a researcher for Human Rights Watch, another NGO, says authorities installed thousands of cameras in Xinjiang province, in China, after riots there in 2009. Its strategy for stability, Mr Bequelin points out, is “to nip protests in the bud”. Video surveillance seems the ideal tool.