There is also the strange concept of curtilage. If I understand it correctly, it goes something like this: if anyone can walk from the street/sidewalk to your front door, then the police can, too. They can then look through your front windows. They are not trespassing or being a peeping tom. If they see a pile of hand grenades inside your house, they can arrest you for that. While in your driveway, they can secretly attach a GPS to your vehicle and that's okay, too, according to the 9th Circuit as in US v. Juan Pineda-Moreno*. But if your property is fenced off from the sidewalk/road, then they can't enter. Does a "No Trespassing" sign accomplish the same protection? I don't know.

But they shouldn't be around the sides or back close to the house without a search warrant, because that's your curtilage, which is a zone of privacy similar to the inside of your house. But they can peep into your garage, because that's not a home.

There's also the doctrine of "open fields", which means they can search in areas away from your house - but presumably not inside any structure, even if it's not a dwelling, without a warrant.

That all goes mainly to searches, but how does that all relate to trespass? Did that officer in the OP commit a trespass?