Privacy advocates, though, are troubled by the array of video cameras, motion detectors and other sensors monitoring the nation’s shopping aisles.

Many stores and the consultants they hire are using the gear not to catch shoplifters but to analyze and to manipulate consumer behavior. And while taping shoppers is legal, critics say it is unethical to observe people as if they were lab rats. They are concerned that the practices will lead to an even greater invasion of privacy, particularly facial recognition technology, which is already in the early stages of deployment.

Companies that employ this technology say it is used strictly to determine characteristics like age and gender, which help them discover how different people respond to various products. But privacy advocates fear that as the technology becomes more sophisticated, it will eventually cross the line and be used to identify individual consumers and gather more detailed information on them.

“I think it is absolutely inevitable that this stuff is going to be linked to individuals,” said Katherine Albrecht, founder of Consumers Against Supermarket Privacy Invasion and Numbering, an advocacy group.

Image Retailers say watching customers helps them improve stores, but privacy advocates are troubled. Credit... Brian Harkin for The New York Times

Some degree of privacy, experts say, is necessary as a matter of decency.

“When someone’s watching me, I’m going to act differently than when I think I’m alone,” Ms. Albrecht said. “Did I pick my nose? What was I doing? What did they see?”