"I'm sorry! I didn't recognize you (with your new haircut, without your beard, after all these years, etc.)" should all work. That is, if you should have recognized the person.
If you don't know the person, try "I'm sorry, but I'm not sure I've had the pleasure of meeting you".