Some Boston police officers will learn today they must wear body cams as part of a controversial pilot program — which saw zero officers volunteer — but legal experts say the contentious issue could be settled in court if the police union doesn’t relent.

“We had a good conversation with the union last night over some issues,” police Commissioner William B. Evans told the Herald. “We let them know we’re going to be assigning officers cameras this week with the hope of training them next week. It’s something the mayor and I have been committed to. We’ve seen the value in Milwaukee and other places. We’re hoping the union will go along with us.”

Evans said the 100 officers wearing the cams will be part of a study by Anthony Braga, director of Northeastern University’s School of Criminology and Criminal Justice. Evans said the department will have no say over who is assigned the devices. He said Braga is aiming for a mix of officers that “best reflect” the city’s racial makeup.

“They’re going to be going by district, they’re going to make sure we have the right mix of younger officers and older officers and the right diversity to best reflect the city,” he said.

Evans noted Braga also did studies of camera programs in Las Vegas and New York.

An agreement between the city and the union hashed out earlier this summer called for 100 volunteer officers to wear the cameras in a six-month pilot program in exchange for $500 bonuses.

Patrolman’s Association President Patrick M. Rose has said forcing officers to wear body cameras goes against the deal the union reached with the department. Rose did not respond to requests for comment yesterday.

Attorney Mark F. Itzkowitz, who has successfully sued municipalities in the past, said the order could face a court challenge.

“I almost would be surprised if it didn’t go into court — I would assume that they will fight it,” Itzkowitz said. “That has been their history. They are not shy about fighting the department.”

Itzkowitz said officers in the program might also try to sue the city.

Attorney Leonard Kesten, who regularly represents officers, said the union may claim “unfair labor practices” if it deems that body cameras are a change in working conditions. But personally, he said he is in favor of them.

“Officers usually do the right thing, so they should get it on film,” Kesten said.

Boston NAACP President Michael Curry lauded Mayor Martin J. Walsh and Evans for forcing cops’ hands. “This is a step in the right direction for police transparency,” Curry said. “There is valuable information and data to be obtained from this pilot.”