NYPD is already testing technology that can detect visually detect guns: http://www.huffingtonpost.com/2012/01/18/nypd-gun-detection-device_n_121...
Given the right incentives, a cheaper version of this technology can be developed. Such a system will not take more than a year for a competent programmer to develop and could be developed using relatively cheap hardware: an industrial-strength Xbox Kinect camera ($150), a small Android computer ($100) and internet connection.
If the government decides to provide the software for free (but not open source), any institution in the country will be able to protect themselves for effectively the same cost as standard CCTVs.
Gun massacres are rare in airports even though most don't have armed gunmen outside: it's because of the cameras.



