When two Albuquerque police officers went on trial for murder last fall after the fatal shooting of a mentally ill homeless man, things did not look good for them. Police videos appeared to show the man turning away before officers fired. Their release had been preceded by a long history of police violence and followed by six days of protests. But defense lawyers thought they still had a chance — if they could get the right jury.

“A jury was going to make that decision,” said Sam Bregman, who defended one of the officers. “And picking that jury was the single most important aspect of the entire trial.”

Modern jury selection is a dark art practiced by a cottage industry of consultants who promise to sort antagonists from sympathizers using mock trials, questionnaires, exhaustive reviews of social media profiles and even photographs of prospective jurors’ homes.

The scrutiny is likely to be no less intense as jury selection begins this week in two highly publicized police shootings. One, the death of an unarmed black man during a traffic stop in Cincinnati, has already resulted in one hung jury. The other, in which a man’s girlfriend live-streamed the moments after he was fatally wounded in a St. Paul suburb, also during a traffic stop, goes to trial for the first time.