Public spaces such as stadiums and shopping centres will be better protected from terror attacks thanks to new technology.