Scientists have developed a new software which can accurately detect when crowds are starting to build up to dangerous levels - a feat they say could help prevent stampede deaths that often occur during festivals and mass celebrations.

German researchers who developed the new software said that it will give security staff the chance to disperse crowds to safety by pre-empting the problem.

Lead researcher Barbara Krausz, from the Fraunhofer Institute for Intelligent Analysis and Information Systems in Sankt Augustin, Germany, said when people become trapped in a highly congested area, they sway slowly from side to side in an effort to keep their balance.

The software, Krausz said, notices the motion by scrutinising the movement of each pixel between different frames of crowd video footage, the Daily Mail reported.

And when there are highly symmetrical pixel motions, it means the crowd is swaying, or there is something unusual going on - and alerts the operator by highlighting the area in red.

“It does not recognise that there is a person, we just check the pixels,” Krausz was quoted as saying.

When she applied the software to the footage of the tragic Love Parade - a stampede that killed 21 in Duisburg in July 2010 - it highlighted areas where people were squeezed together as emergency vehicles made routine patrols through the crowds.

The system produced its highest alert about half an hour before the disaster – the last moment for which Krausz analysed the data.

Had it been used on the fateful day, security staff would have known there was a problem and could have take action, such as opening a gate in a given problem area.

Krausz will present her work at the Advanced Video and Signal-Based Surveillance conference in Klagenfurt, Austria, next month.

Anders Johansson, a researcher in crowd modelling at University College London, said the move from individual tracking to whole-crowd models looked promising.

“You cannot replace humans altogether, but to give attention to certain areas that seem to be developing in dangerous ways is useful,” he added.

More In: Technology | Sci-Tech