What is feeling of being ignored? Probably quite terrible to many people. Well, at least to me.
I have had experience in bumping into a friend or acquaintance and being ignored. Ignored not because s/he did not recognize or remember me but s/he chose to disregard of my existence.
"How can you be sure that s/he recognizes or remembers you?"
Yes, you can tell if you just pay a little attention to the look of their eyes. If they truly forget about you, their gaze will be empty, as if you are a stranger. If they kind of remember you, they will look puzzled and wondered. However, if they decide to ignore you, they will look at your for less than one second and then turn to a different direction abruptly, right at the moment when you are about to greet.
The feeling of being treated as nonexistent is even worse than being cussed in one's face. When one cusses at you, at least s/he thinks that you deserve his/her energy and time to be cursed.
Whenever this happens to me, I always try to recall if I have done something horrible to the person. And, usually I can't think of any, which really perplexes me.
So, unless you really want to establish an enemy, just say that two-letter word "hi" next time. It's just some very basic kind of politeness.