Many of the emotionally disturbed and criminal people aren't actually homeless, and many homeless people are basically law abiding and not so crazy.
About a year ago I went to NYC and it was a bit surreal. It didn't really seem unsafe but boy I saw a lot of people (mostly white) propping open the emergency exits so other people could sneak in just around the corner from New York Guard troops supporting the NYPD. Video ads on the subway were oddly calibrated: "Don't sleep on the subway because it makes you vulnerable to crime", "Don't jump the turnstile because we have roughly 30 programs that could get you free or reduced fares" together with ads for deodorant.