Has our society communication broken down so much that people can't tell if someone is talking to them? Chases are if they are looking into (your eyes) and opening their mouth they're talking to you!
If on the other hand you're interested is initiating a conversation with someone but want to be "guaranteed" they'll be responsive to you then there is no way of knowing.
There are too many variables such as the person may be in a bad mood, stressed out over something, finds you unattractive, considers your speaking to them a interruption of their train of thought and so on.
Ultimately it's the old adage: "No guts, no glory"
Most "small talk" involves making a humorous comment about something you both observed, the weather, or asking some non intrusive question. Based upon the tone of their response you get a feel for whether to continue making small talk or leave them alone.
If it is someone you're going to be seeing over and over again you have the opportunity to chime in now and then with additional small talk as well as introduce yourself.
Warning: You don't want to come off as someone who is going corner them every time you see them. Sometimes it pays to avoid them seeing you or if you see them give them a smile or nod and continue on about your business. Otherwise you run the risk of them feeling like you're stalking them. "I spoke to this person one time and ever since then they've been all over me!" That's NOT what you want them to think.
Get to know them gradually and never linger too long unless they give you a sign they're enjoying your company by asking you questions or laughing along with you. Best wishes!