Sam Pritt, at the Siemens Regional Finals at Massachusetts Institute of Technology. (Courtesy of Siemens Foundation)

Sam Pritt is only 17 but already has an impressive ability to see through chaos — and disaster relief teams responding to superstorm Sandy have noticed.

Pritt has developed software that can analyze a photograph of a landscape and determine where the picture was taken to within 1,000 feet of the site. The achievement won the Frederick County teenager the top prize Saturday in regional rounds of a prestigious high school science competition.

His winning research project was a computer algorithm that involved geolocation, a project he started a year and a half ago in Walkersville, where he is a home-schooled senior.

As Pritt describes it, “The horizon is like a thumbprint. It’s distinctive enough to pinpoint the location” anywhere in the world.

Pritt beat hundreds of other teenagers to earn the $3,000 top prize at the Siemens Competition regional qualifier at the Massachusetts Institute of Technology. Pritt now will compete for a $100,000 scholarship prize at the national finals of the competition, to be held in Washington in December.

He will be joined by Neil Davey of Gaithersburg and Katie Barufka of Reston, the regional winners of the team competition. Davey, a junior at Montgomery Blair High School, and Barufka, a senior at Langley High School, won the team honors for their research on a vaccine for leishmaniasis, an infectious disease spread by the sand fly.

After Sandy brutalized the East Coast, Pritt was contacted by an engineer who did work with the Federal Emergency Management Agency. The engineer asked Pritt to help FEMA by using his algorithm to map a coastal area slammed by the storm, Pritt said.

With further development, he believes his software could be used for robot navigation and, most importantly, counterterrorism.

“Terrorists take lots of photographs to document training, and then they post them to sites online,” Pritt said. Intelligence agencies and the military “need to know where the photograph was taken. Geolocation is usually extremely time-consuming and has limited success. My algorithm is more of an automated approach.”

It’s also highly accurate. In one test, Pritt said, his algorithm identified the locations of 83 places in 100 photographs.

Pritt’s interest in software development began in elementary school when he started tinkering around with computers and code. He began work on his geolocation computer algorithm about 18 months ago. Mentored by his father, Mark Pritt, an engineer at Lockheed Martin, Pritt was able to develop a program with many potential uses, including storm damage analysis.

“We were very impressed by his work and his personality,” said Pawan Sinha, a professor in the MIT department of brain and cognitive sciences who is one of the judges of the competition. “Questioned by us, an intimidating group of faculty members at MIT, he was very on the ball.”

Sinha said Pritt was not afraid to tell the judges if he was unsure of an answer. “We found his honesty and candor to be very appealing, because that’s exactly what we want in a scientist — to know the extent of one’s knowledge and its limitations,” Sinha said.

Pritt, who also is an accomplished pianist, has applied to Harvard University and wants to pursue a career in chemical or biomedical engineering. He’s currently an intern at the National Institutes of Health, where he is researching cancer treatments.