Self-awareness and self-talk usually do the trick for me. When I'm in the midst of dealing with the abuse, I find it easy that I start projecting my past onto others - in others, sometimes I see into others things that aren't really there. Perhaps this is what's happening with you when you see someone who looks similar to your perpetrator. That being said, the abuse does hone our radar like you said, and we do become sensitive to signs that send off alarms. Where possible, I'd suggest avoiding them, but if that's not possible, then translating your emotions into words in your head usually diffuses the situation. Acknowledge you're being triggered, that you're feeling angry and anxious being around someone who resembles your perpetrator. Dissect the similarities. Once you get into a stream of consciousness and words/thoughts start flowing in your mind, it lessens the impact of feelings and lets you cope in a more manageable way.
The ratio of good to bad people in this world will always be tipped in favor of the latter. Always. But that ratio in your own social circle, you can control. And there, and only there, can the balance be favorably tipped, so that those who love you far outnumber those who don't.