SAN ANTONIO – U.S. Customs and Border Protection has long sought a way to identify the millions of travelers who leave the country each year through land crossings into Mexico and Canada.

The logistical hurdles have been monumental: At the U.S.-Mexico border in particular, setting up an exit checkpoint could cause disastrous traffic backups and disrupt trade. When Congress ordered the agency to use biometrics to identify travelers leaving the country, the technology was in its infancy.

But thanks to quantum leaps in facial recognition technology, especially over the past year, the future is arriving sooner than most Americans realize. As early as this summer, CBP will set up a pilot program to digitally scan the faces of drivers and passengers — while they are in moving vehicles — at the busy Anzalduas Port of Entry outside McAllen, Texas, the agency announced last week.

The agency will use the results of the South Texas effort to set the stage for a wider rollout along the southern and northern borders, where the technology someday could be used to identify fugitives or wanted terror suspects. Customs and Border Protection already operates facial recognition exit programs at nearly a dozen international airports, including Houston's, aimed at making sure travelers are who they say they are.

"Traveler acceptance is really high, and we can thank the Apples and the Googles for that," said Colleen Manaher, CBP executive director of planning and program analysis. "It's a game-changer."

While agency officials say facial recognition technology has the potential to transform how we travel, possibly doing away with the need for passports, boarding passes and other documents, some critics foresee dystopian outcomes.

Analysts at the Electronic Frontier Foundation and Georgetown University's Center on Privacy and Technology have argued the program could lead to "mission creep" in the form of additional, unauthorized government scanning. At least two members of Congress have questioned whether the agency's program illegally spies on American citizens.

In a December letter to Homeland Security Secretary Kirstjen Nielsen, U.S. Sens. Edward Markey, D-Mass., and Mike Lee, R-Utah, requested that the program's expansion be halted until the agency can demonstrate its legality.

"While Congress has repeatedly voted to authorize biometric entry-exit scanning of foreign nationals, it has never authorized biometric exit scanning for U.S. citizens," they wrote. "Congress has pointedly neglected to authorize biometric exit scanning for U.S. citizens."

Homeland security officials say U.S. law allowing customs agents to check citizenship when travelers leave the country permits it to do facial recognition scans.

"The authorities are clear," Manaher said.

Researchers at Tennessee's Oak Ridge National Laboratory are trying to crack challenges that make facial recognition technology difficult to apply to moving vehicles.

Tinting and sun glare can make car windows impenetrable to normal cameras and to be effective the facial recognition cameras need to identify both drivers and passengers, even those riding in the back seats. Faces will be at different heights; some surely would be angled away from the camera.

Manaher said the Oak Ridge researchers have developed technology that lets cameras penetrate glare and tint so strong that she couldn't see through the vehicle with the naked eye. She said that even if cameras are able to identify only 50 percent of travelers, "that's a home run."

CBP has challenged tech firms to refine the technology. But academics at Georgetown's Center on Privacy and Technology said the program now used at airports needs an urgent overhaul before the land program begins.

"We found it to be riddled with technical and legal problems," said Harrison Rudolph, an associate at the center.

The Georgetown center's report argued that even its 96 percent accuracy rate means that a handful of travelers could expect to be misidentified. The agency compares photos taken at the airport departure gate to passport photos and other official documents. Researchers warned that the agency hadn't done enough to ensure personal biometric data doesn't end up in the hands of third parties.