Head detection using HOG and SVM
The thing to keep in mind here is that HOG is not invariant to in-plane rotation. A change in orientation of more than 10-15 degrees will probably throw it off.  So if your head can have different orientations in the image, you would either need to train multiple detectors or use something other than HOG.

By the way, there is a function extractHOGFeatures in the Computer Vision System Toolbox, and SVM is available in the Statistics Toolbox. See this example.

Edit: from your sample images it looks like in most cases you need to detect profile faces. vision.CascadeObjectDetector in the Computer Vision System Toolbox can do that for you. For greater robustness, I would run two detectors in succession: one for profile faces and one for frontal faces.  And also, HOG may not be your best choice here. For face detection Haar or LBP features generally work better.

No matter what you do, you will have some false negatives.  So, if you are using a video camera, I would also recommend tracking the faces.  See this example. This will give you an opportunity to correct mistakes made on individual frames.

Edit2: You can also train your own detector with trainCascadeObjectDetector, and you can use trainingImageLabeler app to label the positive samples.