Here is maybe the solution
http://www.mathworks.com/support/solutions/en/data/1-663J0X/index.html?solution=1-663J0X, by I can´t tell exactly, didn´t try yet.
Thanks a lot! I would like to use your work as a part of my school project, which deals with facial detection (nose, eyes, mouth). For face detection, I am going to use Viola-Jones detector, for it´s parts AAM and ASM. But I have a little problem, when I´m trying to run DrawCountoutGui, there is some kind of bug "Segmentation violation". Could you please tell me, how to run it properly?