Less than a week after the NYPD’s infamous ticket blitz of jaywalkers, cops switched gears and targeted rogue drivers — going undercover to pose as pedestrians to see if they stopped for them in crosswalks.

Cops in Brooklyn’s 78th Precinct in Park Slope — where Mayor de Blasio lived before ascending to the city’s top spot — spent Thursday and Friday strolling the streets in the sting, officials said.

One undercover police officer would walk through an intersection while another nearby cop would issue a summons to any driver who failed to yield to him.

The officers found plenty of scofflaw drivers flouting the law . They slapped 17 drivers with summonses over the two days for “failure to yield” to someone in a crosswalk.

That number represents nearly 18 percent of the total 96 similar summonses handed out for all of last year in the same precinct.

“Drivers should know that the next pedestrian you fail to yield to may be an undercover cop,” said local Councilman Brad Lander.

The sting came on the heels of last week’s NYPD jaywalking ticket spree on the Upper West Side.

One ticketed pedestrian, Kang Chun Wong, 84, was left bloodied after cops stopped him for jaywalking across West 96th Street at Broadway and he apparently didn’t understand their commands to stop.

He has since filed a $5 million lawsuit against the city and NYPD.

Police and City Council members declined Tuesday to identify the Brooklyn intersections where drivers were being targeted, citing ongoing sting efforts. It was unclear whether the NYPD is conducting its stings in other parts of the city.

The traffic-safety initiatives come as De Blasio has vowed to bring traffic-related deaths down to zero.

On the Upper West Side at 96th Street and Broadway — an intersection where there have been three pedestrian fatalities in the past nine days — residents on Tuesday said the crackdown was welcome.

Matthew Carabello, 27, who works as a sales associate in a store at the intersection, lamented that there was a large police presence in the immediate aftermath of the fatalities but that it has now tapered off.

At one point, “There were at least two cops at each corner and a traffic cop directing traffic,” he said. “Then it was down to two traffic cops, and now it’s down to one.”

“I feel safer with them here because there are reckless drivers out there,” he said. “There are children, blind and elderly people crossing here every day.”

“They should do it everywhere. If a driver knows it is going to cost them, they won’t do it [fail to yield,]” said Albert Telaku, 32, who works in real estate. “A car is a weapon. A life is a precious thing.”