Indeed the code is optimized for the situations as shown in the video, that someone is fully in front of it. I've walked back as well, about 4 meters or so. And for me this worked without problems. It's a less detailed silhouette, but I guess this is logical because the person is just smaller/less detailed when far away. Of course those settings in the code were tweaked to precisely prevent the issues you are seeing. So the fact that you are seeing them because you changed the settings. Well... There are also other choices in this code, for example with regard to the polygon detail in the lower half. Those are just specific choices for this. You want something different, so you can see this code as a starting point, knowing that it wasn't written for your specific goals, so changes will be required.
Anyway, here are some suggestions that you could try.
Try increasing the resolution. Currently the blob detection (and thus the polygon creation after that) is running on a third of the resolution of the kinect input. So it goes from the kinect's 640x480 to 213x160 which is not a lot of detail. When you move backwards there won't be many pixels (aka detail) left, that the polygon creation code can salvage. Try to run at full resolution by changing this line...
- blobs=createImage(kinectWidth/3,kinectHeight/3,RGB);
Try pre-filtering the image more. I used the kinect image because it could return a very clear silhouette, but I'm not really seeing this anymore in your image. Seems like there are many other blob in your image?
Try runninng the code on an image segment aka the image section where the person is standing aka the person blob. Blob detection can give you this rectangle.
I doubt tweaking a few specific settings in my code example will improve your results. You'll have to think about your specific situation and look+test at a more fundamental level which code you would need.