Re: Somebody is going to have to create some case law on this
"does the DoT own the copyright on the shape of the STOP sign?"
No. For one thing, such things are frequently standardized, so it wouldn't necessarily be them. Many governments, including the American government, can't copyright things, so things they have designed and published are automatically in the public domain.
"Do the people whose faces were used for your iPhone camera's face detection have a copyright on the algorithm?"
I'm guessing the photos used were collected by the algorithm writers to avoid this. Unlike, for example, facial recognition where it needs the details of many peoples' faces, face detection just requires a lot of pictures of faces on different backgrounds. They can be from a small subset of people, so it's easier to get consent.
"Can criminals register a trademark on their face and stop police using it in mugshots?"
No. Getting a trademark or copyright doesn't prevent people from using the work, but from conducting business with it or distributing it respectively. A criminal could copyright a photo, but the police will be taking a new one not copyrighted by them. They could trademark their face, but the use of the image would be allowed because the police weren't using it to sell products or imply endorsement.
In this circumstance, however, the code is copyrighted and not licensed such that Microsoft's use is acceptable. Microsoft could probably argue successfully that they were permitted to read it and use it in derivative works, and thus the creation of their tool is fine. However, the tool is going to output things which potentially fall under licenses with other terms, and Microsoft doesn't appear to have a plan for how they'll deal with those. In short, they would have no legal problem if they created this thing, including reading all the code they did, but never used it. As soon as they want to distribute the result, they have an issue.