a well studied or understood part of psychology. An excellent book on the matter is Lt. Col. Grossman's book On Killing.
He likens the issue as virgins trying to explain sex. As most researchers have never killied anyone, they can explain the process but are out of touch with the actual feelings.
He postulates much of the dehumanizing occurs on a daily basis, largely through the media. This in par may explain why youths today are willing to quickly use violence on a more serious level than in the past.
I am not sure I fully agree with his theory but it certainly gave me food for thought.
On the battle field we do dehumanize our enemy to make killing easier. Always referring to your enemy in derogatory terms is one visible facet of the process. Usually in combat, it is pretty clear who the enemy is and how to engage. The fact the we take prisoners and do not massacre our enemies does mean we can pull back from that edge and remember they are human; more importantly, remember we are human. In days past, my Marines and I always treated our prisoners as well as we were able to and treated enemy KIA with the same respect we would have done for our own. (I thank my God that I was lucky and never had to write a letter to a family)
In the civilian world we do dehumanize the 'thugs' to a certain extent. We also realize (most of us anyway) that not everyone with a different skin tone is out to get us. For most, it is the 'aggressor', the person who clearly demonstrates intent to do us harm that we dehumanize. I, and I believe many, are color blind when it comes to this image; I will know the 'aggressor' when I see him or her.
The danger, as you show in your two end examples, is that anger can replace the dehumanizing process in nearly the blink of an eye. It is critical to make sure our rational thoughts are controlling our actions to keep our violence to the bare minimum, always remembering the conflict avoided is the best.
My pop-psych $.02, before taxes.