HINGHAM - If a man is naked in the woods and no one's around, does it count as open and gross lewdness? Not according to a Hingham judge.

Heather Bradley, the first justice in Hingham District Court, last week threw out two felony charges in a Hanover case based in part on video that police say shows a 61-year-old defendant walking half-naked through a town park when no one else was present. Bradley let stand a third count of open and gross lewdness that was based on what police officers say they saw when they staked out the trail where the defendant, Allen J. Costa of Somerset, had allegedly made a habit of taking mid-day strolls while naked from the waist down.

Costa, an employee at a nearby chemical company in Rockland, was banned from Hanover in April after police say they confronted him during one of his strolls and placed him under arrest. Police said a Rockland woman had reported seeing a half-naked man in the area about a month earlier, prompting the officers to set up a camera on a trail known as Old Molex Road near Forge Pond Park and athletic fields off King Street.

Police said images from the camera showed a man wearing a black coat without any pants, shorts or underwear walking the trail around the same time on two different days. After he was booked, police said Costa admitted that he was the man in the images and said he knew he’d been seen by a woman walking a dog as well.

But in a motion filed this spring, defense attorney Patrick Noonan argued that it didn't matter whether Costa was naked if there was no one around to be "alarmed or shocked" by his nudity. Noonan pointed to a 2003 case in which the state’s Supreme Judicial Court established that the charge of open and gross lewdness only applies to lewd behavior that is conducted in the presence of at least one other person.

"The law requires that the person expose himself to a person – that there be a person present to see it," Noonan told the Ledger. "What we have here is an inanimate object – a camera – and no human being there to see it."

Judge Bradley agreed, dismissing the two counts based on the images from the camera and leaving a third that was based on what the officers saw during their stakeout. She also left the door open for prosecutors to file new charges against Costa, who is due back in court Aug. 26.