I walk a lot - so I pass by people on the street all the time. I've decided the best way to handle it is thus:
If they make eye contact with me, i smile and say "hello" or "good morning" or "good afternoon" or whatever seems appropriate. If they respond, i'm pleased, if they don't i'm not miffed. I don't say it for the response, really.
If they don't make eye contact with me, I ignore them as it seems that's what they want.
Many people are shy. Some people are deaf (no, really). Some people are thinking about calculus. There are at least 2,022 reasons a person would not return your greeting, and only one of them is that they're rude.