Just to play devil's advocate, let's say I trespass in someone's yard while someone else records the dog in a video (keeping me out of the frame of the video) - the homeowner should be fined because the dog was protecting its property?
As far as "training" a dog not to bark, there's a HUGE difference among breeds in how much they bark. e.g. a Great Pyrenees has been bred for centuries as a livestock guard animal and it's in the breeding that they bark at anything that moves that doesn't belong in their territory. We had a group of about 12 kids sled riding on our property this weekend. The hill they use is a couple hundred yards from our house. Our pyr spent 3-4 hours at the fence, facing in the direction of those kids, barking. The kids were 100% out of view. It wasn't until the kids came back down the road that I figured out what it was that she was barking at. But, the entire time, it had me wondering, "wtf is she barking at???!" (Yet, I knew that it's probably a legitimate reason in her mind; and it was.) There have been other times where she went absolutely nuts barking in one direction or another. With snow on the ground, after she directed her attention toward the edge of the woods at the back of the field, I went to investigate. Huge coyote tracks walking down the tree line. They headed for the barn about 5 yards, then turned around and went the other way. She did her job.
Now, in a city, there's absolutely no reason to have a breed of dog like that. It's natural for that breed to bark. Training it not to bark is unfair to the animal. If you're in the city, get a more quiet breed of dog.