Knowing how many people are in one particular place can be incredibly useful for event organisers, health and safety officials, law enforcement agencies and data scientists, but unless you're checking people in and out at a gate, it can be difficult to come up with a precise figure.

A team from Warwick University in the UK has been testing a new way of counting crowds that could make the process a whole lot simpler in the future, and it's based on how we use smartphones and social media. When comparing the estimates gathered from monitoring geo-tagged tweets and smartphone use at an airport and football stadium in Milan, Spain, over two weeks with the official figures, the academics found that their own work was "a very good starting point" for calculating crowd sizes. What's more, a lot of the data collection can be automated.

"This is very quick," Federico Botta, the PhD student in charge of the study, told the BBC. "It does not rely on human judgement, it only relies on having the data related to mobile phones, or Twitter activity. It's a very, very good base to build on, to provide initial estimates."

Botta's team looked at the number of phonecalls made, the number of texts sent, the number of tweets posted and the amount of Internet bandwidth used to try and work out how many people were in a place at any one time. And while not everyone has a smartphone and not everyone sends out geo-tagged tweets, they found that this activity offered a "strikingly similar" pattern to the official numbers of people being recorded.

The researchers used data collected from nine football matches to predict the number of people at the 10th, for example, and they say they were usually within a range of 13 percent. That may not sound terribly accurate, but it's a significant step up from traditional techniques for guessing crowd numbers, which rely on images, grids and the human eye.

You may have noticed that there are often wildly differing estimates of how many people attended a rally or a protest - and that's the problem that Botta and his colleagues are trying to find a solution to.

Co-author of the study, Suzy Moat, said the results surpassed the team's expectations: "This is the kind of thing you really hope you'll find, and you're not normally lucky enough to see. It's really striking that we're seeing quite such a close correspondence between the telecommunications data and the crowd size estimates."

There's a lot of work still to do before this kind of system can roll out in earnest - and one potential problem is dealing with phone signals that vary and drop out - but the early signs are promising. The findings of the study have been published in full in the Royal Society Open Science.