People will always judge you, no matter what you do. Those who judge don't need a reason to judge you, they just do it because it helps their cold black heart feel more alive. For me, it's either how I dress, how I don't talk enough, how shy I am, etc. There's always something, and the only thing you can do is ignore it and find the good things in what they judge.
You don't like how I dress? It's more original, comfortable for myself and looks more fancy than the hoodies we can see everywhere. I don't talk enough? True, but it means I get to choose my friends carefully and I'm better off without people that have little to no values anyway. I'm too shy? Sure, but that doesn't make me unfriendly, and it means I get plenty of time to become more attentive to others. And so on and so on, it's just a question of turning things around.
The good thing is, it's not difficult at all to find the positive parts in the half-baked excuses to dislike a stranger. Why should I, or anyone for that matter, care about what a random stranger thinks of me? It's their loss for choosing to come to a negative conclusion before even getting to know me.
Although I have to agree that sometimes words can be hurtful, even coming from a charmless stranger. In those cases, the first thing to do is forgive them. Holding resentment only makes me stoop down to their level by finding all the things I find wrong with them to console myself, and personally, I don't want that. It's very difficult to forgive someone who hurt you for no reason, but trust me it's worth it, because once you properly forgive something you can either forget about it or grow from it.