small report face classification based on color features
TRANSCRIPT
�
�
�
�
Jerusalem College of Technology Machon Lev
����������������
�� �������
������ ����� ���� � �-� ������-������������
� � ����������
���������������������� ����� � ����EZface Ltd
�
� ��� ��� ���������
�
������
����������� ������������������������������������������������������������������
��� ����������� ���� �� ���������� ���� �������� ������ ��������� �������������� ������ ����� ����
�����������������������������
�������������������������������������� �������� ����������
�������������� �������������� ��������������������������
�������!����"�������������������������������� �������� �����������
�������������������#�� �������������� ���������������������������
�
���
$
�����������EZface Ltd����������������������������������������������������������������������
� � ������������� ������ ���� ��� �������� �������� ��� ������� ���� � ������ ����� ���������� ����
���������������������������������������!������������"������������#EZface�����������������
������ �� ������� ���� ��������� � ������� ���� ����!���� � � �"� ����������� ���� ������������� �
����� ����������� �� ������������������������������������� �� ����������������������������
����������������EZface��������������������������� ���������������������������
����� ���������� ���� ��������������������������������� �� �� �� ����� ���������������������
�������������������������������� �������������������������������������� ��������������� ������
�������������� �%����� ������ ��������� ������������ ���#������������ ������������ ����������
������������������������RGB��#YCrCb�����������������������������������������������
�����������������������������������������������������������������������
������������������������MATLAB�� ��������#&'��������������������������������������
�����������������������#���������������������������������������������������������������
����� ������ �� ����� �� ����� ��� ������ �������� ���������� ������� ������� �������� ����� ����� ��������
������������������������ ���������������������EZface����������������������������
�� �IEEEI-23 ��
�
�
(
������ �� ��������������������������������������������������������������������������������������������������������������������������������
��� ��������������������������������������������������������������������������������������������������������������������������
������������������������������������������������������������������������������������������������������������������������������������
)�)��������� �����������������������������������������������������������������������������������������������������������������*�
)�������������������������������������������������������������������������������������������������������������������))�
)�$�������������������������������������������������������������������������������������������������������������������)��
)�(�������������������������������������������������������������������������������������������������������������������)$�
���������������������������������������������������������������������������������������������������������������������������������
��)�������������������������������������������������������������������������������������������������������������������)(�
�������������������������������������������������������������������������������������������������������������������������'�
��������������������������������������������������������������������������������������������������������������������������������
$�)�����������������������������������������������������������������������������������������������������������������������������
$������� ���������������������������������������������������������������������������������������������������������������$�
$�$�������������RGB����������������������������������������������������������������������������������������������������+�
$�(�������������YCRCB������������������������������������������������������������������������������������������������$��
$�&�������������������������������������������������������������������������������������������������������������������$&�
$�,������������������������������������������������������������������������������������������������������������������('�
$�+���������������������������������������������������������������������������������������������������������������((�
$�-���� �������.��������������������������������������������������������������������������������������������������������(+�
����������������������������������������������������������������������������������������������������������������������������������
(�)�������������������������������������������������������������������������������������������������������������������������(-�
(��������������������������������������������������������������������������������������������������������������������������&*�
�������������������������������������������������������������������������������������������������������������������������������������
���������� �����������������������������������������������������������������������������������������������������������������������
����!��"���������������������������������������������������������������������������������������������������������������������������
+�)�����������������������������������������������������������������������������������������������������������������,,�
+�������������������������������������������������������������������������������������������������������������������*(�
+�$������ ����������������������������������������������������������������������������������������������������������������*,�
+�(��������������������������������������������������������������������������������������������������������������������)'(�
+�&����������������������������������������������������������������������������������������������������������������))��
+�,������������%�������������������������������������������������������������������������������������������������))(�
ABSTRACT����������������������������������������������������������������������������������������������������������������������
&
�������������������)�.��������������#�������������������������������������������������������������������������������������))�
�������.�����������������������������������������������������������������������������������������������������������������))�
�����$�.��������������������������������������������������������������������������������������������������������������)��
�����(�.���������������������������������������������������������������������������������������������������������������)$�
�����&�.����Edges����������������������������������������������������������������������������������������������������)$�
�����,�.�������������������������������������������������������������������������������������������������������������������)&�
�����+�.�����������������#�%������������!threshold"������������������������������������������������������������)&�
�����-�.������p/�������������������#�����������������������������������������������������������������),�
�����*�.���������������� �������������������������������������������������������������������������������������)+�
�����)'�.����������High Pass�������������������������������������������������������������������������������������)-�
�����))�.�������������������������������������������������������������������������������������������������������)-�
�����)��.�����������������������������������������������������������������������������������������������������������'�
�����)$�.��� ������������������������������������������������������������������������������������������������������(�
�����)(�.����������������RGB�������������������������������������������������������������������������������������(�
�����)&�.�������������������������Adaptive Mode Quantization��������������������������������������(�
�����),�.��������������������������������������������������������������������������������������������������������������&�
�����)+�.���������������������%�������������������������������������������������������������������,�
�����)-�.������������������������������......................................................................�+�
�����)*�.���������������������������������������������������������������������������������������������*�
������'�.������������ ����������������������RGB����������������������������������������������������������*�
������)�.YCrCb�#�����������������������������������������������������������������������������������������������$��
�������.���������������������������YCrCb�����������������������������������������������������������������������$$�
������$�.����������������������������YCrCb������������������������������������������������������������������$$�
������(�.����������������������������YCrCb���������������������������������������������������������������������$$�
������&�.�������� ������������������������������������������������������������������������������������������������������$+�
������,�.���������������������Edges����������������%�����������������������������������������������$+�
������+�.����������������#�����������0�� �����#������������������������������������������������������������$*�
������-�.�������������������#���������������������������������������������������������������������������������������('�
������*�.����������#�����������������������������������������������������������������������������������������������������('�
�����$'�.���������������������#�������������������������������������������������������������������������������������()�
�����$)�.������������#���������������������������������������������������������������������������������������������������()�
�����$��.��������������������#��������������������������������������������������������������������������������������(��
,
�����$$�.������������#����������������.I���������������II��������� ��������� ���������������������(��
�����$(�.���������#�����������������������������������������������������������������������������������������������������($�
�����$&�.�����������������������������.������#���������������������#�����������������������((�
�����$,�.������������������������������������������������������������������������������������������������������(&�
�����$+�.��������������������� �����������������������������������������������������������������������������(&�
�����$-�.�������������������������������������� ����������������������������������������������(,�
�����$*�.������������������������������������ ������������������������������������������������(,�
�����('�.������������ ������ �����������������������������������������������������������������������������������(+�
�����()�.������������������������������������������������������������������������������������������������������������(-�
�����(��.��������������������������������������������������������������������������������������������������������������(*�
�����($�.������������������������������I�����������������������������������������������������������������������(*�
�����((�.������������������������������II����������������������������������������������������������������������&'�
�����(&�.������������������������������II���������������������������������������������������������������������&'�
�����(,�.�������������������������������������������������������������������������������������������������������������&)�
�����(+�.�����������������������������������������������������������������������������������������������&)�
�����(-�.������������������������I������������������������������������������������������������������������������&��
�����(*�.������������������������II����������������������������������������������������������������������������&$�
�����&'�.������������������������II����������������������������������������������������������������������������&(�
�����&)�.�������������������������������II��������������������������������������������������������������������&&�
�����&��.����������������������������������������������������������������������������������������������������������������&,�
�����&$�.�����������������������������������������������������������������������������������������������,��
�����&(�.�����������������������������������������������������������������������������������������������,,�
�����&&�.����������������������������Minimum Distance����������������������������������������������������,+�
�����&,�.����������������RGB���������������������������������������������������������������������+)�
�����&+�.����������������RGB���������������������������������������������������������������������+��
�����&-�.����������������RGB�����������������������������������������������������������������������+$�
�����&*�.����������������RGB������������������������������������������������������������������������+(�
�����,'�.�������������������������������RGB�������������������������������������������������������+&�
�����,)�.����������������������������RGB�����������������������������������������������������������������+,�
�����,��.����������������RGB�������������������������....................................................++
�����,$�.����������������RGB����������������������������������������������������������������������������+-�
�����,(�.����������������RGB����������������������������������������������������������������������������+-�
�����,&�.����������������RGB������������������������������������������������������������������������������+*�
�����,,�.����������������RGB������������������������������������������������������������������������������+*�
+
�����,+�.��������������������������� ���������#RGB��������������������������������������������������������-$�
�����,-�.���������������������#�������������������������������������������������������������������������������-(�
�����,*�.������������������������#����������������������������������������������������������������-(�
�����+'�.����������������YCrCb���������������������������������������������������������������������-&�
�����+)�.�������������������������������YCrCb���������������������������������������������������-+�
�����+��.����������������YCrCb��������������������������������������������������������������������������������������--�
�����+$�.����������������YCrCb���������������������������������������������������������������������������-*�
�����+(�.����������������YCrCb���������������������������������������������������������������������������-*�
�����+&�.����������������YCrCb������������������������������������������������������������*'�
�����+,�.����������������YCrCb��������������������������������������������������������������*'�
�����++�.���������#������������������Sobel����������Canny�������������������������������������*)�
�����+-�.����������������#�������������� ������������������������������������������������������*��
�����+*�.��������������������������������#�������������������������������������������������������������������*��
�����-'�.�� �����������������������������������������������������������������������������������������������������*$�
�����-)�.�������������������������������������������������������#�����������1��������� ����*$�
�����-��.����������������������������������#��������������������������������������������������������������*(�
�����-$�.%���������� �����������������������������������������������������������������������������������������������))(�
-
�����������������)�.��������������������� ������������������������������������������������������������������������������������+�
������.����������������#�������,�1,�2�������������������������������������������������������������������-�
����$�.���������� ��#����������������������������������������������������������������������������������&+�
����(�.���������� ��#�������������������������������������������������������������������������������������&-�
����&�.������������RGB������������������������������������������������������������������������������������,-�
����,�.���������������������RGB�������������������������������������������������������������������������-'�
����+�.��������� ��#Least Squares�����������������RB/G2�������������������������������������������-$�
����-�.����������������%������������������������������������������������������������������������������������������*&�
�
�
*
��������
�������������
����������������������������������������#�[20]��������������������������� ���������
���������������2�����������������������������#���������#��������������������� ����������
����� ����� ����� ��� ����� ������� �������� ��� ���� � ���� ���� ������ ��� � � ������� ������
�����������������������������������MS4!�RGB�1�Infra Red"����������������������������!������
������������������������"���������������������������� ���������������������������������������
�����������������������������������#�[20]������������������������������������������������
�������������������������EZface Ltd��������������������������������������������������������
����� ��� ������ ������� ��� ���� ������� ������ �� �������� ���� ������ �� ��������"�� �"������#
��������
��������� ���� ��� ������� ��������� ����#��� �� ��� �������� ���� ���� ������� ����� %�� �����
������� ������ �� ��� ����� ���� �� ������ ����� ������� ���������� ���� �������� ���� � �[20]��
�� �������� ����� ���� � ������ �� ���� � � ������ ������ ������ ������� ��� ������Minimum
Distance������� ������� �� �� ������ �������� ����� ���� �� ������ ��� ��� ������� ���� � ������ �����
���������������������������������������������������������� ��������������[20]��
� ������ ��������� ���� ������ �� ����� �������� ������� ���������� �������������� ��������
����������������������������������������!�������RGB"�������������������������%����������
���������� ������#���� �� ��%����� ������������������������������������������������ ���������
������� ��� #� � ������� �������� ������� ���������� ���������� ���������������������������� �������
��������� ������ ������� ������� ����������� .� ����� �����!�������� ��� ����� ��"������� ��� ���������
� ������������������������������������������������� ��������������������������������������
�������������������������������������������������������������������������������������������
����� ����������������������������������������������������������������������������#��������
���������������������������������� ������������������������������������������������
����������������������EZface������� ������������� ������������������������������� � �����
� ���������������� ���� ��� ��� ������ ����� ���� ���0� ��� �������� ������ �������� �������� ������
����������������������������������������� ����������EZface������#)***���������� ����������
���������������������������������������������������������������������������������������
������������������������������������������������������� ���������������������������������
��������������������������������������������� ������������������������������������������
)'
�� ����� ������ ����� ���� ��������� �������� ���������� �� ��� ����� ������ ���� ������ �����
�����������������������������������������������������������������������%��������������� ���
� ���������� ��������� ��� ���������� �� ������ � ����������� ����������� ��� ��������������
���������������������������������������������������� ������������������������������� �
�[16]1��
��������������������������������������������������������������������������������������
������������ ��� ����� ������ ���� �� �� ���� ������� ������ �� ����� �������� ������ ���� ����
��������� ����������������� ��������������������������������������������������������������
����������������� �����������������!���������������"���������������������������� ������������
����������������� ����� ������ �� ������ ����� ������ �������������� ������� ������� �� ��� ��%����
�������� �����������������������������������������������������������#Face Recognition��
�������������������� ��%��������������������� �� ������������������������������������ ���� ��
���� � ������������������������������������������������������������������� ���������� ����� ���
���� ��� �������� �������� ���������� ������������������ ��������������� ����� ����������� �����
���������������������������������������� �� ����������������������������������%��������RGB�
������������� ���� ����� ������������������������������������
���� ������ ��� ��� ������ ���� ������� �������� ����� ������ ������ ����� ����� ������ ����
�� �����%�� �� ����� ������� ���� ��� ���� � � ��� ���� ���� ������ ������ ����� ������� �����#���� ��%����
������������������������������������������������������� #� ������������������������
���������������������������������������������������������������������������������������������
���������������������� ����������������������������������������#EZface���������������������
�������������������
1������������������������������������������������������������������������������ �Links���
))
�������������� ����������������
�������������������������� �������� ����������� ������������������������ ��������������0���
��������������������������������������������������������������������������������������� ����������
��������������������!� ���������� �"� ��������������
������������������������������������������������
� ����� ������������� ����2���� ������ ������� ��������
������������������������������!�����)��"�����������
���������� ��� ������� ����� ���� �� �������� ��� ����
����������!����������� ��������"� ����������������������
%����� ������ ����� ������ ����!�detectiondemo.avi�
2�������������[5]"��
������ � �� �� ���� ����� ������ ���� ������
����� ����� ���������� ������� �������� ���������� ���
���� ������ ���� ��� ����� �������� ����� ����� ������
������������������������������������������������������������������������������������������
����� ����� ����� ��������������� �� ������ � ��� �������� �����������0������ �����������������
� �� ���������������������� ������ ��������� �� �� �������������������������������������������
�������������������������������������� ��
�� ����� ��������������� ��� ������ �������� ��� ��������� ����� ����� ��� ����� ������ ���
�� ����������������������������������������%���� ��������� �������������������� �� ����
��������������������������!����������� �������������� ���������������"���������������������������
������������!� ���������������"��� ������������������������������������������� ����������� ������
���������������������������������������������#� �����������������������������������������
�#EZface��� �����������������������������������������
������ �������� ������� ��� ����� � ���� ������� ����� ������
����������������������������������������EZface� ��� ��
���� ���� ���� ��� ������ ����� ����� ��� ���� ���� �������
������������������� �� ������������ ������ ��� ���������
� ������ ����� ����� ���� � �� ������ ������ ������� �� � ���
��������������������������������������
������#�$%����������
����#��"���
������#�$%���������
���� 2�.�����������������
���� 1&���������������#����������������������������
)�
�����������������
������������ ����� �������� �������������������� ������������������������ �� ������
�������� ������ ������������������������� ������������������������������������������������
��������������� ������ ������������#EZface� ���� �������������������������������� ����� ��� ��
���������������� ������������������������������������ �� ������������������ ��%�������� �����
��������� ������� �������������������������������� �������� ������������������������������
������ ����������������������������������������������������� ������
����� ����������� ������ ������ ���������������� ����� ������ ������ ������� ���� ����������
������ �������������������� �������������.�
� ������.�������"�����������������������������!�������������������"��
� ����.��������������������
� ����������������������� �������
� �����������!��#�����������������"2������������������������������������
�
� ������������� �� ������������ ����������!������RGB"� �������� ����!Crop� "�����������
���� �������� ��� ����� ����� ����� ������ ����� ����� � ����� �������� ��� � ��������� ����� ���������� ����
����� ���� ��� ������������������ �����#��!�Edges� "���� ������������� ������ ����� ��� ����� ���
������������!��������������"����������������������������#��!�Edges�"����������������������������
���� 3�.������������������
)$
�����������������
���� ������������������������������������������������#�������������������������������
�������������������������������
��������������������������������������������������������������������������� �����(�.���������
����������������������������������!�������������� ����������3"�����������������!������������
��������������"�����������������������
����������������������#��!�Edges"���������������������������� �����������������������
�����������#�������������������������������
������� ������ ������� ����� ��� ������� ��������� ��� ��������������� ����� ���� ������������� �����
���������������������������������������������� ������� ��������������������������������������
���������������������������������� ��������������� ��� ����������������������������������
�����!�����&�"��������������
����� ������������������������� ��������� �����������������������������������������
������������������������ ������������������������������� ������������������������������������
��������� #��������������������������������� �������������������������������
�����4�.��������������������
�����5�.����Edges�����������!���������1threshold������"�
)(
���������������
������ ����������������
� ���������������������� ������������������ ������������������� ����������2�����������
!Image Processing"���������������!Computer Vision��"����������������������������������������
������������ ����������������� ��������������� ��� ������ ��������� ����� ������� ���� ��� � �����
����#�����������������������������������������������������������������������������������
��������������������������������������������������������������������������������������������
�����������#�� ������������������������������������������� ���� ��������������� ���������
�������������������������� ������������������������������������������������������� �����
�[1] �[3]��[4]��[5] �[7] �[14] �[17] �[19]������� �������������������� ������������� �����������������
��������������������������������������������������
������������������
�������������������� ����������� ��%���������������� ������ ������� ����������������
������������������������#������������������ ��������������������������� � ����� ������ ������
���� ����#��������� ���� ��������� ����� ���� ��� ��� ��������� ��� ����� ������ ����� ���� �����
!������"������������������������������������������������������������� ����������� ���������
��������� �������������������������������� ������� ��������������������������� ����������
�����������!�Color Spaces"��
������������������������������������������������������������� ����������������!� ������ ����"�
���� RGB, CMYK��������������� ���������������������������������������������� ��������
������������������������� ������������������������������������������ ����������������������
� ��� !B� "� ����� �����!G� "� ���� ������!R� �"����� ������ ��� ������������ ������ �� ��������� ����
������������������������������ ��������������������������� �������������������!������������
����2���������������������������������"��
���� ��������� ���������������� �������������������������� ������������� ���� ��������������
��������������������������������������������������#�� ����������������������������������������
����� �������������������������������������������HS��������������������������������������
!Hue"� ������������!Saturation"��� ��� ����������������!����������#�HLS, HSB, HSV� ���"��
� ����YCrCb����� ��� ������ � ������� ������ ��� ������HS�� ������ ��� ���� ���� ��!luminance"�
� �����!� ���Y� �"����� ����� ������ ��� ���� ����� �� ���� ���� �����#������ ��� ����� ���� ���
�������������������!Chrominance� �"���#�� �������������������������������������2�����
)&
!Cr�"���� �!Cb"����������� ��������������� ���� ��������������������������������� !Cg�"����#
�������������������������������%���������������#�[11] �[12] �[19] �[7]��
������ �������� ���������� ������#�� �� ������RGB� �������� ����� ���� ����� ������� ���
����YCrCb� ������������������� ������������������� � ���������� ���������������������
!JPEG� �TIFF� �GIF� �MPEG� �� ��"� ������� �� ����RGB��#YCrCb� ������JPEG�������� ��������
��.�
(�2.1)
Y 16 65.481 128.553 24.966C 128 37.797 74.203 112
C 128 112 93.786 18.214b
r
R G BR G B
R G B
� � � � � � � ��
� � � � �� � � � � ��
������ ������ ������� ������ ����� ��� � ������� ��� ��������� ����� �������� ��������� ����� ����
����������������������������������� ������������������������������������������ ����������������
� ������ ���RGB�2����� �� ���!����������� ��"� ������ ������� ���� � �� �� ������ ����������
���#�������������� #� ��������������������������������������� ������!����"������!��� "��������������
����� �������������#� ������ ����������������������������������������������������������������
�����
�������� !�������������"threshold#��
����� ������� ������ ������ ����� � ������� ����� ��� ������� ����� ��� ����� ������� ����� ����
�������������R+B-2G��������������� ����������������������������������������� ������������
�������� ��������%����������%������������!threshold�"��������
��������� ����� ��� ����� � �� ��������� ����� ����� � �� ���
���������������%����������� �������������������������
�)� �� ��� ������� ������ ���� � ������'�� �� �� ����� �������� ����
���������������������������������� �������������������
����� ����� � ������������������������������������� �����
�����7�.�����������������#������%�������!threshold"
�����6�.�����������������.���RGB�����CMYK�����HLS����HSV�
� � �
Hue
Saturation Value
),
��������� ����� ��� ��������� ����%�� �� ������� � � ����� ���������������� ��������������� .�)� ��4
���������'���4�����������
���� � �������� � �%���������������� �� ������������������ ��%�������������%��������� �
���� ���������im>0.5�����������������������������������������������������������%������������ �
���� ������ �������� �������� ��� � ����� ������ ��� .im>0.7max(im), im<0.45mean(im)�� ����� � ���
�����������������������������������%����������
�%������������������!threshold�"�����������p%�����������������������!���� ������
�������"��������� ������������#���������������%���������������������������������������� �
����� ����� �������� ��� ������� ����� ������� ����� ��� � ����� ������ ��� �������� ����� �� �� ��� ���
��������������� ����������������������� ������������������������ ������������ ���p%���������
������ ������ ��� ����� ����� ������ ����� ������ �������� �� #2%� ������!����� ������ ������ �"�����
� ��� ����������������������� ���������� ����� ������ ��������������/���������������������������
������� �������������������������������������������������%�������������������������������
�������� �������� �������������������� �����������������������������������
� � ������� ������� %�� ��� ������ � �p%���������
�������� ������� ����� ������ ����� ��� ������� �������� ��
� ��� ������������������� ��� ����� ������ �.�
0
( ) ( )k
H k h x dx� ��� ��� ������ ��� ������� �� ��� ���� �
����� ������ �� ���� ������ �������� ����� ����� ����������
� ��� �������� ��� ����x������� ������ ������ ����
( ) (1 %) ( )H x p H end �� ������ �������� ������� �
�� �� ���� �� �����#p%������ ������ ��������� ����� ���
�� ������� ������ ���� � ��������� ��� ������������
%����������������������������������������������
���������������� �!���������
������� ��������� �������� ����� ����������� ��� ������� ������� ������� ��� ������� ��� ����� ����
������ � � ��� ��������� �� ������ ��� ������ ����� �� ����� ���������������#��� ��!two-
dimensional convolution� �"������� ������������������������������������������������������ ��
��������������������������������������#������������������������#�����!��"���������
� ��� ���������� .�� ���������#��� ��1
0
( ) ( )( ) ( ) ( )N
k
f k h n kg n f n h n
�
� � � �������� � ���
P%
�
histogram
integral
H(x)
h(x)
x
x
�����8�.������p%�������������������#������������
)+
��#����1 1
0 0
( , ) ( , )( , ) ( , ) ( , )M N
k l
f k l h m k n lg m n f m n h m n
� �
� � � ���� ��������������������
�� ��� ��� ������#����� ����� � ������ � � ��� ������� ������� ��� ������ ������ ��� ������ �
��������������������������������������������������� �����#�( ) ( )h hM N M N� ����
�� ��� ����� ���� ����� � #2( )M N���#( ) ( )h hM N M N� � �� �� ������ �� � ��� �������������� � ��
������������������������������
�������������������������� �� �������������� ���#����� �� ����� ����� �������� ������ �������
��������� �������������������3x3����������1 1 1
11 1 1
91 1 1
h� �� �� � �� �� �
������������� ������������������
��������������������������������� ��4!����������"�������������������������������������
�����������������������������������������������������1 1 1
11 8 1
81 1 1
h � �� �� � �� � � �
�������������
����� � � ������������ �����������
� ������� ��������#��!�Edges�"
������� ������ ��� � ���� ������������
��� ������#� ������������ �������
���������������
������� ������ ����� ����� � �
!High Pass Filter�"����������������������������������� ���������������������������������������
������ ��#�� ���������������������������������������� ���������������������������������� �
����� ������ ������������������ ����� ������� ��#�'�������� ���� �� ��� ����� ����������������� � �
�������������������������������������!Sobell�"������������� ���������������������������������
� ������� ���� ������4!������� �"�� �� ��� �������������.�1 2 1 1 0 1
1 10 0 0 , 2 0 2
8 81 2 1 1 0 1
� �� � � �� �� � � � �� � � �� �� � � � � � � �� �
��
!1������� ����������� � �"� ������� ����� ���� ������� ���� ��� ���� ������4!����� ������ "��� ��
1 2 11
2 4 28
1 2 1
� �� � � �� �� �
���1 1 1
11 8 1
81 1 1
� �� � � �� � � �
���0 1 0
11 4 1
40 1 0
� �� � � �� �� �
� ��������� ��������� ������������� �������
�������������
�����9�.���������������� �����������������������.������������������������� ���������������������������
� � �
)-
� ����Canny�� ������� ����� ����� ������� ������ ���� ����������� �������� �������� ��#)*-,�
��� ������������������������������������������������������������������������������ ������������#
�������� �������������������������������������������������������������� ���������������
� ����� %��� ���� %�� ���� ������ ����� ����� ����� ����� �� �������� ������ �����!trace���������
hysteresis"����� ��� ���� ������� ����� ���� ����� ��� ��� ����� ������ ��� #�������� ������������� �
������������������������ �� ������������� ��� ����������� ����������� ����� �������� ������ ��� ������
������������ ���� �����������������������2��� �����������������������������������������
� ��������������������#������� �������������������������������������������������������������
�������������������������������������#�[6] �[8] �[13]��
������������������������������������������������������������������#��������!�������� "������
���������������������������� � �� �����������������������������������������������������������
�������������������� ������������������������������������������� ����� �� ������� #� � ������������
� ������ ������� ����������������#��� �������� ��������� ����� ��� ����� ���� ���������� ������
������������������������������������������������������ ����������������������������������
������������������������#�[20]���#�[1] �[4] �[6] �[14] �[17] �[19]��
���������������������������� ��!��
��������������������������������������������������������� ���������������������������������
������ ��� ����))� �� ��� �������� ����� ������ ����� ������� ���� ������ ����� ����� ����������#���
��������!������������)����������������������� ��������'�����������������"������������������������
����������������������� ��� ���������������� ���������������������������� ��������� ������
������ ����#� ���������� ����� ����!Morphologies� "���������� ����������� ��� ������������������
� ������� ������ ����� ��� � ������� ������ ���� �� �������� �������������������������� ����'mask'�
� ����� ������� ������� ��� ����������� ��5��� ��� ������ ������� ������ ����� �� �� ��
��������������������������� ���������� �������������������.�
� filling�2��������� ���������������� ��������������������������� ��%����������������������
� erosion�2����� �����������������mask������������� ����������������mask�������
�����10�.����������High Pass������!��������������������."������� �������������������5x5�������������15x15����������������Canny
� � �
)*
� dilation�2���������������mask����� �����������#erosion�.������� ���
� ���������� �mask������� ������� ���� ������� ����� ������� ����� ����
������������
� closing�2������#mask������������������������������ �����������������
� ��mask� ������� ��������� �������������� ������������� ��� ��� � �������
� �.dilation���!filling"���erosion��
� opening�2��� �� ��� �� � � �����#mask� ��� ����))������� ������� � � ������
��������������������������������������#closing
� perimeter�2����%������������������������������ ���������������������
������������������#BW!��������������������� �1%�"�
�� �����#Matlab���� ������� � �� �������� ��������� ����� � �� ���� �������
�������������������������������������� ���� ����� ����������������������������
� ���������������� ������� �����������#����� ��� ����� ���� ���������� ������
����������������������������������BW�!����#�����"��������������������������
� ��� � ��������������BW������� ������� ������ ��� ���� ���� #� � ���� �� �����
�� ������ ����� ������ �������� ��������#BW���� ���� ������������������� ���� ��
� ��������������� ��� ������� ����� �� ��BW� �������� ������������� ����� ������
threshold��
fill
erod
e pe
rim
eter
�di
late
�op
en�
�����11�.���������������������������
�'
���������������!�������
������������� ������������!����
�������������� ���������������������������������������������������������������������
��������� ���� ������� �������� ������ ���� �� ������ ����������� ���������� �� ���� ������������ �
� ��� ������� ����� ������!���� ��� ��� ������������� ��������� ����� ����� ���� �� ����� ���� ���
����������������������� �"�������� �������������������������������������������� �����������
����� ��� ����� ������ ���������� ��������� ������ ������� ��� �����#������������� �������� ���� ��
��������������� �������������������������������������������������������������������������
����������������� ������������������
��������������� ������������������������� ���������������������������������� ������
������ ���� ��� ��������� ���� ��������������
!����� ���� ���� ������ �"��#� � �� ������������
���� ������ ������!���� ���������"� �%����� ������
�������������������������������������������
������)�� �
�����������������!��$���!training��
������������������������������������������������������������������������������������.)��������
��� ����training������ ��� ���� ���� ����� �����������training������!���������������� ��� � �������
�������������"����������� ��Training4!���� ��%�����"�������������� ����������������������
�������������������������������������!�������� �������������������� ���������������������"����������
����������� ��� �����!classify�"������������������������������������������������������������������
��������� �������� ����Maximum Likelihood� �Minimum Distance� ����������������������
�� ����� �������� ���� �����#�[20]���#�[1]�� �����Minimum Distance� ���������#� � ������� ����
�7.2.1. ��
� ���� ������ �� ����� �� �training������ ��� ��������� ������� ������ ������ ��� ������ �����
���������������� ������ ������������������������������ ������������ �training����������������
����������������������������� �����������������������������������������������������������
���������
�����12�.�����������������������������
�)
���������������!������training��������
��������� �����������training���������������� �������������������������������������������
������������������������������������������ !Generic"����������������� �������� �����������
����� ��� �training������ � ������ ��� ��������� ��#training� ������� ��� ����� ����� ���1!��������
��� ���"�����%�������������������������#�� ����������������������%������ ���� ��������������
�������������������������� ������� � ����������� ����������� ��� � �� ����%����������������
���� ������� ���� ����� ��� ����� ��������� �� ���� ���#� � ���� ������ ����� ���� ������ ��������� ��%����
�������������� ������������ ����������� ��� #� � ������������ ������������� ���� ��������� �����
�������� ����� ����� �������� ������� ������� ������� ������ ��� � ������������ �������������
��������������������������
��������� ������������������������� ���������������������� ����������������������������� �.
����������� ��������������������������!RGB, CMYK, CIE XYZ, HLS, YCrCb����"������������� �
Edges�4!����#��� "������ �� ��� �� ����������� ��������!���� ����� ����� "� ������ ����� ������ �������
������������������������������������������ ����������
���������������������������������������������� ������������������������������������ ��
������������������������������������������������������������������������������������������ ����
���� ����� ������ ������ ������ �� ��� ��� ���� �� ��� ����� ������������������ ���� ��� ������
���������������������������������������������������������� ��
��������������������������������
������������������������������� ���������������.)�������RGB������������������� ��������
� ����!���� ����� ����� ����� �������"� �� ������������� ��� ������� ���������� �� �� ����� ��� ����
��� �� �����������#������ ���� ��� ������������������ ����� ��� �� ������� ����� ���� ���� ���� ����HS�
!HSV��HSB��HLS��"���������� ������6����������������������$� �����YCrCb���������������
� ������ ��� ��� ������!luminance� "� �������!chrominance"������������ ��������������RGB�
������YCrCb�������������������������� ��������������������������!�jpeg, mpeg, tiff"��
��
����������������
����������
�������� ������ ����� ��� ����RGB� �� ������ ����YCrCb� �� ������Edges!�����#��� �"�����
��������������������������������������������#��������������������������������#���������
��������� ����� ����� ��� ���� ����� �������� ������ ��� ������ �� ����� ���� ��� ������� �����#����� �
����������������������������������������������������������������� ��������������������������
���������
�������� �����RGB���� ������������������ �������������������������������������������
������������������������������������������������������#�� �������� �����������������RGB2��
�����YCrCb�� ������#� � ����� ���������������������RGB�������������������������������������
����� ��� #� � �������������%�� �����HS�������������������������������������� �������������
� �������!� ����� ��� ��������� ������������������ ������ ����� �������� �"� �� %����� ��� � ��� �����
��������#Edges���������#����������������������������������������������������������������
�������������������������������������������!���������"����#���������������� ��
����������������������������������������������������������� ��������������������������
�������������������������Minimum Distance������#�[20]� ������� �������������������������7.1.2. ��
�������������������%���������������7$��8������������������������������������������������������
������������������ ������������������������� ������������� ���������������������������%�������
������� ������������#���������������������������������������
����������� ���������������������,����������������������������������������� �����������
����� ������������ �������������� �������%��������� ����� � �� ������$��������������� �������� �����
������������������������������#&'����������������������������������������� ������������������
��������������.+�)�)� ������������� ������� ����%��������������� ������������ �� ������������� �
����� ������ ����� ��� ������� ������ �� ��!����� �calcown� �"������ �������� ������� �������� ��� ��
��������������7.1.������������������������������ �����������������RGB����������������[0,1]���
2�� ��� � �������� �������� ����� ����� ��BMP� �TIFF� �RAW� �IDC� �!GIF"� ����� ������� ���� ������ ��#JPEG��
MPEG�������
�$
������������� ��
�������������������������� �������������� ��������������������������������������������������
� ���� ������ ��� ���� �� ������ ������RGB��#YCrCb� ��� ������ ��� ��� ���0� ��������� ������ ��Edges�
��������������������������#Edges� ������������������� ��������������������������������������
��������������������������� ������������������������������������������������������ �������������
����������� ��������������� �������������������������������%����������������������#���������
���������������������������������������������������������� �����������������������������������
��������������������������������������
������������������� ���������������
���������� ������������������������� ��������������������������������� ������.�
� ���������������������������
� ���� ����������������������������Edges�������
� ���.� ����������������������������������������� ���������������������������
� ����������������������������� ������������� ���������������
� ���������������������������������������������������������������������������� �����
�� � ����� ��� ����� �������!�#ALU��� ����� ��� ������������� ��� �"������ �����
�R-2G>0�����������������������R>2G�
�(
������������������� ���
�������� ���������������������� ���������� ��������.�����������������������������������������
������������� ���������������� �6����������������� #������������������������������ ��������.�
)� �������������������������� �����������������������#���������������
�� � �������� ������ � �������� ����� ����� ��� ������ ������ � � ������ �����!� ����face1,
face2, face3"�
$� ������������������������������������0��������������� ����
(� ���������������������#������������������������Adaptive Mode Quantization�
&� ����������� �������������������������������������0����������������������
�������������������������������� ��)$��)(���#)&.
�����13�.������������� �����������������
Area R G B Face3: 231 199 171 Eyes1: 12 34 85 Eyes2: 84 111 96 Eyes3: 210 231 223 lips1: 208 154 167 lips2: 211 217 186 lips3: 210 147 151 ………
�����15�.�������������������������Adaptive Mode Quantization
�����14�.����������������RGB����������
�&
������������������������������!����
� ������� �������� ������ ��� �� � �������� ���� � ������� ����� ������� ��������������� ����
���������������������� �2
22
122
( / ) i
ii
xp x i e x p ����
� �� � � �
� �� �
�!�������������������x������������
i"� �� ������ ������ ������� ��� ������ ���� ����� ������� ������ ��� ����� ����� �� �� � ����!�������
������������������"����������������������������������������������!�����"������������������������
%����������������������������������������������������������������������������������� #� ��
����������������������������������������������������������������������%��������������������),��
�� ������ ��������%���� ����!�������� "������� ��� ������ ������� �� ������ ���� ������ ����� ��!����"��
�� ������� ������ ������������������������� ����������������� �������),�����%���������������
������� �������� ����� �������� ���� � ���� ������ ��� ��� ����� ������ ������ ����� ������ ��� �� ����
� ����� ����� ����� ��� ����� ���� �������!����� �"��� ����#� � �������� ������ ������� ���� �����
���������������������������������%������
��
�������������������� �������������������IIR�x�-��������������� ��%������������� �������
����� ����� �������� ��� �� ����IIR�� ������ ������ ���� ��� ������ ���� ����� ��������� ������� �
����������4!����������������."1 1
( ) ( ) ( )N M
i ki k
y n a y n i b x n k� �
� � � ���������� �����������������
������������������������������������������������������������� ��������������������������
�������� ���� ��� ����� ������ � ��� ��� � ������� ����� �( ) 0.3 ( -1) 0.4 ( ) 0.3 ( 1)y i y i x i x i� � � � � � ���
����������������������� �������������������-��������
�����16�.������������������������������ ���������������������������������������������������
� �
�,
�������� ��������������������� ��%���������
�Adaptive Mode Quantization� ��� ��� ����������
������ ����� �� ��� ����������� %���� ���� ���
�������� ������� �� ��� ����� ���������� ����������
� ����� �������!� ����� �������� �����p%3�����
������� "������������������������#���#���������
-� ��������� ������� ��!������ ������ �"����� ��������
� ����� ����� ��2�������� ������ �������� %��� ���
������� �������!� ����� ����)+� �"����� ������ � �
������ ������ �� ���� ����� ������ ������� ������ ���� ��� ����� ����� ��� ������������ ���������
��������y(x)=0.6�max����������%������������������������������������������.
� �2
22
122
( / ) i
ii
xy p x i exp �
���
� �� � � � �
� �� �
21
max 2
0.5max max0.6
xx
x x
x y
x y e y y
���
� �
� �
� ! � " �
3���������������������������p%#5%
2� 0.6
�����17�.���������%��� ����������������������������������
�+
����������������RGB�
�������������� �������������
������������������������������������� � �� ��������� �����������������������������������
������������ ������ ������������������������������ ��������������� � �� ��������� �������� ������
� ����� �����!� ����� ��������� �"������ ������ ��� � �
������� ���� ���� ������ �������� ����� ������� ���������
������� ��������������������������������������������
���������������� R<G�� ������������������������
����������������������������������������������������
�#�[20]��
������� ����� ������� � � ��� ����� ���� ������
����������� �� ����� ����� �� �������������� ����������� ���� ����� ����� ������� �������� ������
������������������������������������������������������������������������������������������
�������������������������#R<G� ���#R>B���������������������������������������������������
������������+�)�$��
��������������������!��������������
����������������������������������������������� ����������������������������������
���� ������������� �����R>��G4!������������"��������������������������������� ������������
���������������������������������������������������������������������
� ����� �������� ��� ������ � �����������RGB���� ����� �������� ������ ������� ����������
� ������������������ ���� ���������Adaptive Mode Quantization��������� ��� ������� ��������
�������������������������������� ������3.2.3� �� ������� ��������������������������������
������ ����� .)� �������
����������������������������
����� ����� � �� ����� ����
��������������������������
������ ������� � �� ����
� ������ ������ ��
������������� �������� ���
�������� ������������
����1�.��������������������� ���
0 ( ) ( )
( ) 0 ( )
( ) ( ) 0
i i i ii i
i i i ii i
i i i ii i
R G B
R r g r b
G g r g b
B b r b g
� �
� �
� �
�����18�.������������������������������
Face1 Face2
Eyes1 Eyes2
Face3
Eyes3
�-
�� ���� � ����)-� ������� ������ ����� ���� ����� .�� �������������� ���������� ����� ��� �������
�����������������������������������������!��������������"��������������������������������������
���������� ��������� ���������������������������������7.1.4�������������������������������
��������������+�)�&��
� ���� ������� � ���������� ������ ��������� ���� ����� �������� ���� ������� ������ ������
�������� ������� ������� �������� ����� ������� ��� ����� � � ���� � �� ��������� ������� ������ ����
������������������� ���������������������
� ��"�� ���'skin.m(�2� ������������ ������� ������ ����� ���� ��� � ����� ������ ���R>G>B� ��� �
R>0.5���������������������������������������������������������������������������������
������� ������� �!������������#���� ����� �������"� �9�������������� ���� �#����� �������� �
������������ ������������������������������������������������� �����������������������������������
��� ��� � �� ����� ���� ������� ���� ������ ���� ������� �� � ��������� ��� ����� ����� ��� ��
!Saturation��"����������������������������������������������#RGB��
����������������������������������������+�)�,�������������������������������������������
��� � %���� ��� ��� � ����� ����� ������� ����� � ��� ��� �� � � ��� ��� ��� ��������� ��������� ��� ��
�������� ���� ��� ���������������������������� ����������������������������������� �� ���������
���������������� ���������������������������� ���� ������������ !����������������������������
�������� �"����� ������� �������������� ���������������� ��� �� ��� �� �� ������������ �� �!����
��������dull��#ornit"������!������������ ���#��"��������������!���������� 6"���������������������
�������������������������� ������������������������������������!���������"�
�������"������� $'lips.m� ()����������������������� ��������������������������� ��������
������������������������������������������������������ ����������������#���������������
�����������������������������������������������.(G-B)2<� & R>G��1 & R>B��2 & R>0.5��
� ����� ������ ��� ������ ���� ����!G>B� "��� ������ ���#����
���������.(G-B)2<� ����������������������������:��#B�����
��� � ������������ ����� �� �� � ��� ����� ������ ��� �� ���
�������������������������������������������
����� ��� ����� �� ������� ���� ������ �� ����� �!�,�1,�2�"
������� � �� ��������� ��� ����� � ����������� �������� � ���
�� ������� ����� ���������� ������� ������ ��� ��� ��������� ���
��������� ��� ��������
����2�.����������������#�������,�1,�2����������������������
Image� ����� ����1� ����2�
dull��,� 0.01� 1.1� 1.1�
,� 0.015� 1.1� 1.1�
(��-��otnit 0.001� 1.2� 1.2�
�*
�������"�������$'lips.m�()�������������� ��� ����������������������������������� ������� �
���������������������������������������������������������������������������������������������
������������ ������ ������� ������ ������ ����� ������ ���� ����� ����� ������ �������� �����������
���� �������� ���� ���������������� ������ �������� ���� ����
��� ��� ��� ��� .������ ��� ����� ����� ���� ���� �������
� ������ ������� �����!������ ����� ������� ��� �����������
��������������4��������6�"��������������������������������
���!��������)*�."(R-G)-(G-B)=(R+B-2G)=f(x,y)���
� ����������� ����������#� � �� ��� ����f(x,y)����
������������� ����� ������ ������ ��� ��� ����� ������� ����
� �������� ������� ��� ������ ������ ������� ���� � ���!�����
��������������filling�"������������������%����������������������� ������������������������
� ����� ���� ����� ������ ��� ������������ %�� ������ ��� ������ ���������� ����� ������ ����
�������������'��
����������� �������� �� �� ������� ���������������
� �����!� ������ �������� ������+�)�,� �"������� ������ ����
���� �������� ����� ������ ���� ��� ���� ��� #������� ���� �
����������������������������������������� ��������������
� ��� ��� � ���� �������� �� ����,�������� ��������� ������ ��
������������������������
���������������������������������������������%��������������������������������������
�������������������������������������������"���� ��������������������� ������� ��%����
�%���������������������������������� �����������������������������������������%������
����������������������������� ���
����"��'eyes.m, eyes2.m(�2�����������������������������7$�8������%������������������������#
7$�8���������������������YCrCb������������� �����������������������������������������������������
�� ���� ��� ������ ����������� ����� ����� �� ������� ������� �6���� �� ������ ��� ����� ����� �������
� ����RGB���#������� ����� ���� �� �����"�$�#�� ����� ������ ��� ��RGB� ������YCrCb�����.
�� �2210.4 & 0.7
3BB R RR� � ���� #������� ���������������������������������"�$#�����
��� ������������������������%�����������������������������������. � �22 0.4BB R ��
(R,G,B)
(R,G,B)
( 2 ) , AV 0.67 (MAX AV) AV average(R B 2G)
MAX max (R B 2G)Fg
Fg
R B G thrshthrsh
$
$
� �� � � � � � � �� � � �
�����20�.����� �����������������������������RGB��������
�����19.������������������������������������������
G-B R-G
skin
lip
s
$'
������ ��������������������������������������������������!�����+�)�,�"%��#��#������� ���
������������������������ �������������������������������������������� �������������������
���� �����������������������������������������������������������������������������������
�� ��������������� ����������� ���������������������������������������������������������2�
�������������������������
����)������������������������������������ ���������������������������������������������
�� #��� ������������� ����� ��� ����������������������������������������������������
�������������������� �����!�����������
�#� ����� ������� ���'lips4.m� (%������� ��� ��� ������ �� ��� ������� ����� ����� ������ ���
�� ��������������������� ������������������������������������������������������������
����� ����������������� ����� � ������������� �������������������� ������ ��������������������� ������
��������������� ����������� ��� � ������������������������������������������ ����������f(k)��
� ������������������������������.�
, , , ,( ) ( )skin lips
R G B R G Bf a f b$ $
� � � ���
� ������������ ������������ ���������������������������������)*������#������� ����������
�����������������������(R-G)-(G-B)����������������������������������������(R-B)+(G-B)����
�������������(R-B)+(R-G)���� #� ��������� ���������������������������� �����������������4!���"��
�������� ��������������������������������� ������������������ ��������������������� �����
������������ ��������������������� ����������+�)�+������������������������ ��������������� �
��%����������� ��excel����#���������������������������%������������%���������������������� �
� ������ ������ ���� ����� �������� ��Least Squares� �� ��� �������� ������ �������� ���� ������
������+�)�-��������������������Least Squares�������������������7.2.2. ���#�[10]��
��������������������������������������2, ,( )R G B RBG
f ��������������� a=1.5,b=0��
���� ���������� ��������� ����� �������� .
, , , ,( ) 1.5 ( )skin lips
R G B R G Bf f$ $
� ���� ������ � ��������
������������������� ������������������������������������������������������������
����������
�������������������������������������������������������������������������������������
�������������������������7.1.9��������������������������������������� ��������������������
���� ����� ����� ��� ������ ������� ����� ����� ��� ����� ������ ������ ��� ���� ��� ��������low-pass�
�������
$)
#�����������"���"����������)������������������������������������������������ ������ ���
�������� �����������������!�������������������� �"������������������R>1.1B & G>0.92B��
���������������������������������������!�����8�"����������������������������������������
!������������ ornit���#9��"������������ ����������������������������������#�������������������
�� � ���� �������� .R>B+30 & G>B-15� ��� ���� ��������� ������ ������ ���������������������%��
�������������������������������������������7.1.9.�
$�
����������������YCrCb�
�������������
� ��� ���� ������� ����YCrCb�� ����� �� ������ ��� ������� ����� ������ ����� ��� �����
� ������ ������ ��� ������� ����Y���� � ��� �� ����� �����!Chromate� "� ���Cr� ������� ������
� ��� Cb� ����� ����� ��� ���� ��� ������ �� �� ��� �� �������� ��� ����� � ������������ ����� ������
�������� ����������������������������������#�����������������������������������������������
���������������������������������������������������������������
�� �� �������� �������������#7$8� ��������� � � ������� �� ��������� ������������� ����������
���������� �������������������� �#������� ����������������������������������������������� ����
������������������������������� ��������������#������� ��%�#��#� ������� ����������������������
����������������������%���������������������������������� �����������������������������
�%������ ��0����������������������
�����������������!�����!����� ����������
������������������������������������� ������������� ������������������������ RGB��
�� ����� ��������� ������ ������� � �� ��� �� �������� ���� ������7$� 8�������� ����� � �� �������� ����
����������������������������������������� ���������������� ���� ������������ �������������
��� ���������������������������������������������������������� ������ ��%��������������
����������� ����������������������������������������
���������� �����������������������������������������������������������������������������
������������������������������������������������������������������������������������Cr/Cb��������
���� ������ �������� ��� � ����� �������� � � ���� �� ����� � �������� �������� ������� ����� ����
�����������������������������������+�)�)'��
CCrr//CCbb CCbb//CCrr CCrr22 CCbb22
�����21�.YCrCb�2����������������������������
$$
������������������ ������!� ��������
��������������������������������������������������������������������������������������������
+�)�))��
��"������#�'skin3.m(�)�������������������������������������������7$8�������������������
�������������������������#����������������������������������������
���������������������������������������������������������� �����
����������������%����������������������� ��������������������������
��������������������������������� ���������������������������%�
����������������������������������������������������������
����� ��� ������ �� �������� ���������� ��������� ���� ��� ��������� � � ��� � ���� ��� ����
�����������������2�������������������#����������������������#������������������������������
����������������������������������������������������������� �������%������������������
��������������������������������������#� ���������������� ������������������� ��%���������������
��������������������������������������������������������������������������������� ������
������ ����#�'lips3.m(�)��� ������ ���� ������� �����#7$� 8������ ������� ��� ��� �����
���������������������������#Cr/Cb������������� �Cr2�����������2��������������������
��������������������������������������������� ����������������������������������������
%���������������������������������������� ��'�*&����������������������������������� ���
� ��� � ����� ��� ���� ������ ������ ��� ���� ������ ��� ������ ������ ����� ������� �������convex
combination� ��������� �������������������������������������������������������������� �
����������������������������������������������������������������������
� ������� �� ��������� ������ ��������� ������� �� � �����
��������������������������������������������������
���������������������������������������������������� �
������ ������������������������������������������
���������������%�������������������������������������
�� �������%��2���������������������������
�������#����"'eyes3.m(�)��������������� ���#7$�8�������������
� ������������� ����%��������������������� �������������������
���� � ��������� � ������������������������� ��������������������
�������������!������������"�������������������� ��������
0.65
0.667
r
b
r
rC
CC
C
� �� &�
�����22�.��������������������������YCrCb
2 2 2
21
( , )
1
( , )
( / )
( , )0.95
( , ) / ( , )
r r r b
rnx y Fg
r bnx y Fg
MouthMap C C C C
C x y
C x y C x y
%
% $
$
� � � ���
� ����
�
�
�����23�.����������������������������YCrCb
�221
0.43
0.7
brb r
r
CC C C
C
� � �� � � � �� �
� &�
�����24�.����������������������������YCrCb
$(
����� #��������������2�������������������������������������������������������������������
�"�������������������������YCrCb�����������������
����� �������������� ���������������������� ������� ����������������������������� ����
����������������������������������������������������������
������������!��������� �!�YCrCb��
�� ���� �� ������ ���� ������ ����� �������� ������ ���� ���RGB� ���� ����� ��������� �����
���������������������������������������������������������������������������������������������
������������ ���������������������������������������������������� ���
����������������������������������������� �2�������������������������������������������
��������������������������������������������������������������������� ����������������������������
��������������������������������������������������������� �����������������������������������
�����������������������������#���!Edges�"�
�
$&
��%��������������� ������
��%����������
� ������� ����� ��� ������ ������� ��������� ������� ����������� �������� ������ ������������� ��
��������������������������������#���!Edges��"�������������������������������������������������
������������������� ����� ������ ���� �� ������ � ������������� ��#��� ��� �� ������������������� ���
��������������������� �������������#�����%��������������������������������������������������
� ���������� �������� �������� ������� ��������#��� �������!����� �����"� ����� ������� ���������
��� ������ ��� ����#����������� ���������������� ����� ����������� �� �� ����� ���������� ��������
��������������������������������
����������������������#� ���������������������������#����������������������������� �#
����� ������ � �� ����� ������ � �� ��������������������� ����Edges������� ������������������ ������
� �������������������������������������������������������������������������������� ����������� �
� ����� � ����� ���� ��� ��������� ��� ����� �� ����� ��� ���Edges� �� �� ����� ������������� ����
��������������� ��������������������������������� ������������������������������������
��%������ �����������Edges��
����� ����# � ����� ����!%� ��%����� � ������ ������ ����� ������Edges� ���������� ���� � ��
��� ��������� �� ����� ��� ���� ���� ������� ��� ����� ������ ��������#��� ��� �Canny����� ������
������������������� �������� ����������������� ���������������������������� ���%��#��#� � ������
�� ������������������������ ������������������������������������������������������������������Edges�
��������������������������� ������������ ���������������������������������������������
������������������������Edges���
�����!Sobel�"������������� ���������������� ������������������������������������������
����� ��������������� ������������� ���������������������!���#�� �x��#y�"���������� ��������������
��������� ������������������������� ���������%��������������������RMS estimate of noise�
%����������������������������������������������������� ��������������������Edges�������������
�����������
� ��� ��������Canny���#� � � ����� � �� ����� � ������� ��� ���������#��� ��� ������� ������ %
����� ��� ����� ������� ������ �������� ����� �� ����� ������� ������ ��� %���� ������ �����!��#����
���������#Edges������������������#�Non-maximum suppression��"%������������������� �%��
������������������������!Hysteresis thresholding��"�������������������������������������� �
� ������ ������� ���� ���!1500x1500������� �"� ���������� ���Canny�%��� ��� ���� ����� ������ ���
$,
��������������� ����������������������������������� ����������������#�������������������
������ �%�#��#� � ������������� �� ����������� ������ ���������#� � ���� ���� ������������#������� ��
� ������� ������������������#��������� �������������� ������ ������������� ���� �����������������4��
� ��%����������������������� ������#Edges�������������������������������������� �������������
�������#���!������������� ������"������ ��������������������������������������������������������
�����������������������������#�[6] �[8] �[13]��
� ����� ������� ���Edges� � ���� ����� ������ ���� ����� �high-pass� �� ��� ��� ���������� ����
��������������������������������������������������������� ����������������������������
��������������������������������� ��������� �������������������������������������%�������
�� ����� �� �����#Edges� ����� ��������������� ������ ������� �� �� ����� ��� � ����� ��������� ���������
�������������������������������������������������� ������������������������ ���������������������
��#� ���������������������������������������������������Edges�������������� ���������������
��������������������������������� ������#edges0.m���#edges2.m��%�����������
� � ��"����� ����!����%��� ��"�� ��"����)�� ����� � �� ������ ����� ����� �� ������ �������#��
Edges���������� ����������������������������������������������������������������������������
������������������������������������������ ����������������������������������Edges��������
� ������ ���������"�� ��"�����!�edges3.m� �edges4.m�"������ �7.1.13.������� ����� ��� ������� ��������
���������� ���� ����������������������� ������� �����������������������������������������������������
��������������������������������.�
)� � ��� ���� ��Edges� ������2� ��� ���� ������ ������ ����� �� ������ �Edges���������� �
���� � �� ����� ������� ������ �� � �� ���� ������ ��� ����� ���� ��� ����� ������ ����
Edges����������������������� ���������������� ���������� �������������� ��� �����
����� �����������!��������"�� ����������������������������������!���������������"
�� ��������������#���������������������������������������������������������������
������
�� #Edges� ������ ��������� ��������������������������������������������������
��%����������������������������������������������������������������������#Edges�
�� �����������������������6;������������������ ������������������������������������
������������� �������+�)�)$�������������������������������4, 8, 10�
$� ��� ������� ������� �����Edges�������2� ��� ������ ��� �������#������ ��������� �����������
������� ������������� ����� �%�#��#����� ������ ������ ����� ��� �� � � ��� �������� ��� ��� � ���
��������������!������������������"���������������������������������������!���� filling��"�
$+
(� � �����#Edges������� � � �� �� ��� ��������������� �� ���������������������� ���� �����
�������������������������������������������Edges��"������������
&� ����������������������������������������5x5������������������������������������ �
�� ��������������������������������
,� �������������#Edges������������������������%����������������� �!threshold�"������
� ��� ������������� ��� ��������%�������� ��max(hp)� �mean(hp)� ���� .������ ����� ��
��������������������������������.hp=high-pass��lp=low-pass��
+� � ������� �������high-pass����������������������������������������������������������
��������������������
����!��"�!����)���������������%��������������������������������������������������������������
�������������������������������������������������#�� ������� �������!hpY�"�����7x3���� ��� ���
� �������������������������������������������$��������������������������������������������
������������%��������� ��������������������� ����#Edges�����������������������������������
Edges��������������������������� ������������ ������������������������������������#Edges�
������ ���� ������ %�� ������� ������ ��� ������ ���� � �� ��������� ������� ���� ������ %��� �����
�������������� ���#Edges���%���������������%�������hp>8��� ������������������������������
������������ ��������
������������ ���������������������#�����Edges�������������������������������
�����������%���������������������#� ������� �������� ���������������������������39x3�
!������ ����"����������������������������������������������������������������������������
hhppYY llppXX hhppXX llppYY hhpp llpp
�����25�.�������� ����������������2�������������������high-pass��������������low-pass� ��������high-pass��������� ��� low-pass�������
� � �
1 1 11 1 11 1 11 20 1
1 1 11 1 11 1 1
mask(7x3)
� �� � � �� � � � � �� � � � � �� � � �
�
hp = mask(7x3)hp
0.05 mean(hp) ,max (hp)hp>8
��� ����
�����26.����������������������Edges����������������%�����������������
$-
���������closing��������������)'�� ������� ��������������#)'�������������� �� ����������
���������������������������������������������+�)�)$����������������������������������� ��
�����������������������������������������������������
��%�����������������������
� ����� ����� ������ ������ ����� �����#Edges� �� �������� ������ ������ ����� ������ ������������
��������������� ������������������%���������������������������������������������������#�����
����������������������0��� ���������� ���Edges���������������� ������ �%�� ��� �������� ��� �
��������������������������� �������������������������������������� �����������������������
�������������������������������#����
� ����!� ���!��"� !������ ��"����)���������� �� � �������������� �������� ������ .������
!Intensity� " ���� �� �������!Saturation� " ���� ��� ������� ����� ���� �����������������%�������� �
���������������������������������������������������������������� ����������������������������.��
����������������������������������������������������
�� ������� ����������� ������������ �������������� �2(C C )
Y< (Y) 2r b
mean
�� &���� ����������������� ��������
����������������������������� ����������������������������������������������������������������
�����������������������<�6�������=���������������������� ��������������C C
Y< (Y) 2r b
mean
� &��
��������
��������������� ����� ������� �����������������������������������������������������������
�������������� ������# edges5.m���#hair3.m������������������������+�)�)$��
��%�����������������&����� ��!�&�� �!����
���� �������������������������������������� �#����Edges�������������%�������������#�������
������� ����������������������������������� ��%���������������������������������������������
������������������������������������������������������ ���������������������������������
���� �� ������� ������� ������ ��������� �������� ������������ �������� � ����� ������ ������� ����
����������� �������� �������������������closing��#opening��������������%��������������
�������!�����������#hair4.m� ���������������������������#hair5.m"������� �����������������������
�������������+��
� �� ��������� ��������#�� �������� ���� ������������� ������ ������+�)�)$� ������� ����� ��� ��
�������#edges.m���#hair.m���� �����������������������������������������������������������������
������������������������������� ������ �������������� �������� ���� ��������������������������
$*
����������� �������� ���������������� ���������������������� � ��� ��� �� �� ����������
�����
�
�
�
Closing Opening
�����27�.����������������#�����������0�� �����2�����������
Closing *��*
Edges detection
Black colors detection
('
��'��������!� ���������� ��!�
��'������ ��������
������ ������� � � ������ ������ ��� ����� ������� � � ��� ����� �� ����� ��� ������ �%������� �
����������������������������������������������������������������������������������������������
�� �������%����������� ���������2������������������������������������������#skin.m�!��������
�������#skin7.m��skin8.m��skin9.m"�����������������������4.1.1��
�
�����28�.�������������������2�����������
R ' G ' B
(R ' 1.1B)
R > 0.5
Cr > mean(Cr)
~(Cr ���������2%)
~edges
dilate, fill, erode
���� RGB������
��������� ������������������������
��������������������YCrCb
��������Edges��� ���
�������
�����29�.����������2�����������
*~
R '''' G '''' B
R > 0.5
Cr > mean(Cr)
~(Cr �� 2%)
Edges+
blacks
dilate fill erode openprtimeter
()
��'������� ����������
����� �������������������� ����������������������� ������������� ��� � ������� ���������
������������������������������������������������������������������������������������������
�������#����7$8������������������������������� �!�eyes5.m"����������������������������������
��������������������������������221
3brb r
CC C C� �� �� �� � !�������3.4.3��"� �������������#b
r
CC��� ���
������� �����$'������������������ ��������������������������%���������������������%���� ��������
���������������������������������������������������������������������� �������������������
����������������������� ��%�������������������� ������������������������������� ���������������
�������������������Edges������������� ������$'��������$)��
����������������������������������������������4.1.1. �������������������������������������
� ������������������������%�����#�����������������������%���������� ��������������������������
����������������������������������������������������� #eyes.m���
��'������������������
��������������� �������������������������������������������� ��������������� ������ ����
���������������� ����� �� ����������� ������ ������ ���� ����� ��� ����� .�� �� ����������� ���#�
21.3AV< 1.7AV RBG
&���� ������ ��7$8�#�2 2 2( / )r r r bC C C C%� ������� ��� ������� ����� ���� �� �����
�����30�.���������������������2�����������
����������������������� 2%
Edge + blacks
Closing, Opening
C
Cb
r����������������������� 2%
Edge + blacks
Closing, Opening
C
Cb
r
�����31�.������������2�����������
fill
*close open
perimeter
2% of2% ofC
Cb
r2% of2% of
C
Cb
r
HairHair
(�
��������#������������������������������������������������ ������������������ ��������
������������������������ ������
�������� �����#�$)������������������������ ���������� ������������� ������������ ����������
������������ �����������������������������������������%���� �������� ��������� ��� ���������
� ��� �����/������ ��� ���������2
RBG
������ ��
�����������������������������������������������
� ������������� �� �� ������ ������ ������� ��� � ������
����������������������������� �������� #���������� #
� ����� ����� ��� �������� ������������������ �����
������� ����������������������/�����������
!��#��������������������������"�
�����#�������� �$)����� ��������������������
��������������� ����������������������������������
� ������������ ����� ���������� ����� �� � ����� ����������� �� ��� ������ ��� ��������� �� � �/�
����������������2 2 2( / )r r r bC C C C%� ���������� ���� ������������
���������������"��������� ��)��������������������������������������������������� �
�� ������� ������ ������ ������� ������� ���������� ������� ��������� �������� ���� ������ �� ����
���������������� �������.I����������������������5II����������������������������������������
closing������ ������lines������������ �����
�����32�.��������������������2����������
-face mask
eyes dilated
�����33�.������������2����������������.I���������������II��������� ��������� ������
*lips mask
lips mask
Close disk
Close Close lineslines
Close disk
Close Close lineslines
dilate
dilate fill open
I
II
($
�������%����������������������������������������������������������������������������
�����$������������������ .�I� ��II� ��II� ������������������� ��� �����������������������
� ����������� ��������� �� ���� ����� ����� ��� �� � �� ����������� ������� ���� ������������ �����
������������������������������������������ ���������������������������������� ��!�����"���
������ ������� ��� ������� ������ ������ ������� ������� ������ �����4.1.1� �������� ����� � ��� ��
������������������������.�I�#�lips.m���II�2�lips7.m���II�2�lips8.m��
��'���������������
�������� ���������� ������� ����������� ��������������������������� ��������� ������ ������
� ��� �� ��� ������������� ����� �� ����� ������ ���� �4!�����"�� �������� ������ ����������� ���� �����
������������������������������������������������������������������������� ���� �� �������������
�������������������������� ����������� �������������������� �������� �������������������
�� ������������������������� ����������������������� �#Edges���������������������������������
������������������������������������������������ �����������#��������������������������
�1����������������������.Hair & not(Face) + Optimization������� ������$(����������� �������
������������������� ���������������� �����������������������������������������������4.1.1���
�
�
�
�
�
�����34�.���������2����������
*~~
hair mask
face mask
dilate fill erode open
((
��(���!�����������������!�
���������������������������������������������������������������������������#��������
��������������������������������������������������������������������������������������� �
�������� ��������������������������������������������������������������������� ������������#
����� � � ����#����� ��� ��� � ��� ���� �� � �������� ����� ��� ������ ��� ����� ����� �������� ������
���� ���� �� �� ���������� ��� ���� �������� ����� �� ������� ����� ������ ������ ��� ������ �� ������
��������������������������������������������������������
��������������������������������.�
� � ����������������� ���.!x2,y2�"#����������� ����!x1,y1�"#����������� ���
� '((((x,((((y(�%������������ �� ��
� ����x�#���������������������
�
��(�������������� ���
��������������������� ������������������������������������������������������� �������
�������������� ��� ������������������������ ���� ��������� �� �������������������������
�������������������������� ��� ��������������������������4!>��������"����������������������
��������� ����������� ���� ���������� ������������������������������������ ��������������
������������#!450�����#������������ ���������������������������������� ����������������������
�����������������������������������������������������������$*��
�����35�.�����������������������������.������#���������������������#������������
� �
(&
��(�����!��������� ���
� �������� �������������������������� ��� ����� �� ���������� ��%������ ����� �������
������������������������6?������������� �����������������O=(Ox,Oy).�
(�3.1) x
y
x a cos o , 0 2
y b sin o
tt
t�
� � ���� ) � � ���
���������� ������ ������������#������ ������� � � �� ��� ���� ���������� ��� ������� ��������
������<�6���������������� ���������������������������������������������������������������
��������������� ������ ������ � ��� ����� ������ ���� �� ���� ������ �� �� ������ ��������� ������ �
�������� �����������!�����$,� ."1 @y@xA tan �� �������������� � �
�������� ������ ����� ����� � ��� ����������.�
x x
y y
x @ @x cos siny @ @y sin cos
�
�
� �� �
� � � �� � � �� �� � � �� � � � � �� � � � � �
� �
����� ��������������������������������(Ox,Oy)���������������a��#b�� �����������������
�������������������������������������������������#���������������*����������������������
� �����#&'����������������� ������ ����� ������� �������� �� � ����� �� �� ���� ������� ����� ����
���������������� ������� ����������������������������������������������������������������������
�����������������������������������������������#� �������������������������������������
�����37�.��������������������� �����
����������������
�� ����(-�°)������a, b, o ����������� ���� ��������°�
������ �������
����������������
�� ����(-�°)������a, b, o ����������� ���� ��������°�
������ �������
(x2,y2)
(x1,y1)
(y
(x�º
(x2,y2)
(x1,y1)
(y
(x�º
�����36�.�����������������������������
(,
��� �������� �������� �������� �� ���������� ��� ������ ��������� �� ������ ����� �����������
���������������� ����������������������������������������������������������� ��������������
������ ��� �� � � ��� ����� ������� ���� ���� ������ .2 1
lips y2.1
a x x
b (y )�
� �� � (��
� ������� ������ � ��
���������������������������� ��������������������� �������������������������������������� � �
����������������������������$-��������� ������ �� ������������������������������ ��������
�������������������������������Ox������������������������������������������� �� �����#
Oy���������� ��������������������������b. x x x x 2 1 x
y y
o ( ) x x
o 0.1 b
� �� ( � � (� �( ����
�
�����38�.���� �����������������������������������������������
�����39�.������������������������������������ �����
(+
��)������������!�
����������������������������������������������������������� ��������������� ���
�����0�����������������������������������������������������������������������������������������
����� ����� ������ ���� ������� ����� ����� ����� ��������� �� ������� ����� ��� ������������� ����
����� ������ ��� ���������� �������� ����� ������������������� ����� ����� ���������������� ������
��������������� �������������������������� ���� ���������������������������������������� ����
��������������������������������������������� ������������������� �����������������������
������������������('��������������������������������������
�����40�.������������ ������ ���
Color imageSkin detection
edges&black regions
eyes detection
lips detection
Hair detection
(-
���������������
������������
� ��� ����� ������ ����������#&'�������� �� ������� ����������� ��� ������ ������� ����� ����
EZface� ���������������� ������� ������������������������������� ����������������������������
� ����� � � ��� ���������� ���������� ��� ������� ��� �������� ���� ����� ������������ �������
������������������������������������������������������������������������������������������
������������� ������������������������
���������������������������������%�������������������%���������������������������� ��
������ ������������������������������ �.�����#�������������#��������������#��� ��������#�������������
���������������������������������#��������������������������� ���������������������������
��#�����$���������#���������������������������������������������������
�����������������������!���������� ������
�
���� 41�.�������������������������
(*
�
�
�
���� 43�.������������������������������I�
���� 42�.������������������������
&'
�
�
�
���� 44�.������������������������������II
���� 45�.������������������������������II
&)
���� 47�.������������������������������������������������
��IIII ��IIII ��II
��IIII ��IIII ��II
���� 46�.����������������������
&�
�
���� 48�.������������������������I�
&$
���� 49�.������������������������II�
&(
���� 50�.������������������������II�
&&
���� 51�.�������������������������������II�
&,
���� 52�.�������������������#��������������������������������������������� ������ ������������������������������� ����������������������������������������� ����������������� ����������������������������������#crop�������������������������������� ������ �������������������������������������������� �������������������
� �
�
&+
��������������������������!��������
�
%Success �
Image Skin
E
yes
Lips
II�
H
air
Fin
al
4.jpg � � � � � 5.jpg � � � ½ � 6.jpg � � � � � 8.jpg � � ½ ½ � 9.jpg � � � � � 10.jpg � � � � � Ornit.jpg � � � � � d4.jpg ½ � � - � dull.jpg ½ - � � � F12.jpg � � � ½ � F12a.jpg ½ � � � � F23.jpg � � � ½ � F30.jpg � - - � � F35.jpg ½ � � - � F36.jpg ½ � � � � F37.jpg � � � - � F37a.jpg � � � - � 3.jpg � � � ½ � 12.jpg ½ � ½ � � 13.jpg � � � � � Amrita.jpg ½ � � � � abeard.jpg � � � � � adminez.jpg ½ � � � � albaron.jpg ½ � � ½ �
%Success �
Image Skin
E
yes
Lips
II�
H
air
Fin
al
asamira.jpg � � � ½ � ayesha69.jpg ½ ½ ½ � � batchar.jpg � � � � � calcowen.jpg � � � ½ � cathyr.jpg � - � � � claire01.jpg � ½ � � � claire997.jpg � � � � � claireb2.jpg ½ - - ½ � clareke.jpg ½ - � � � clarker.jpg ½ ½ ½ ½ � coulthard.jpg � � � � � d3.jpg ½ � � ½ � deb234.jpg � � ½ � � duttont.jpg � � ½ � � elite2.jpg � � � � � feniap.jpg ½ - � ½ � fenwick.jpg � � � � � fox.jpg ½ � � - � gaffney.jpg ½ - � � � gemmatweed.jpg ½ � - � � gracech.jpg ½ � � � � Total 32.5
/45 33.5/38
36.5/42
29 /40
28 /45
percents 72 88 87 73 62
����$�.���������� ��2���������������������������
&-
time[sec] image
Pre-calculation Edges skin eyes lips shows Total
modules ornit.jpg 7.219 21.297 7.578 5.5 6.594 24.234 40.969 albaron.jpg 0.89 9.531 6.937 2.859 5.656 11.142 24.983 d3.jpg 0.938 4.687 3.703 3.203 2.797 13.969 14.39 d4.jpg 0.89 6.125 4.391 3.219 3.422 11.64 17.157 4.jpg 0.422 1.016 1.922 0.609 1.235 3.843 4.782 5.jpg 0.531 0.938 1.875 0.609 1.187 3.579 4.609 6.jpg 0.469 0.859 1.86 0.672 1.172 3.577 4.563 8.jpg 0.453 0.859 1.875 0.625 1.172 3.734 4.531 9.jpg 0.437 0.86 1.875 0.625 1.203 3.578 4.5633 10.jpg 0.453 0.844 1.89 0.625 1.172 3.625 4.531 dull.jpg 0.546 0.938 2.031 0.657 1.281 3.265 4.907 F12.jpg 0.313 0.671 1.438 0.484 0.86 3.312 3.453 F12a.jpg 0.359 0.782 1.593 0.5 1 3.297 3.875 F23.jpg 0.234 0.516 0.984 0.359 0.656 2.595 2.515 F35.jpg 0.312 0.672 1.359 0.469 0.89 2.438 3.39 F36.jpg 0.485 1.031 2.094 0.657 1.266 3.233 5.048 F37.jpg 0.672 1.203 2.718 0.89 2.188 4.344 6.999 F37.jpg 0.672 1.203 2.766 0.906 1.687 5.922 6.562 F37a.jpg 0.64 1.203 2.719 0.89 1.672 4.954 6.484 3.jpg 0.422 0.859 2.188 0.641 1.188 3.78 4.876 12.jpg 0.422 0.89 1.875 0.609 1.172 3.172 4.546 13.jpg 0.422 0.828 1.735 0.578 1.078 3.391 4.219 amrita.jpg 0.375 0.765 1.703 0.563 1.078 3.469 4.109 abeard.jpg 0.375 0.781 1.656 0.609 1.063 3.172 4.109 adminez.jpg 0.375 0.766 1.688 0.562 1.046 3.235 4.062 asamira.jpg 0.391 0.765 1.578 0.547 1.047 3.578 3.937 ayesha69.jpg 0.375 0.75 1.641 0.547 1.063 3.296 4.001 batchar.jpg 0.359 0.719 1.5 0.515 0.969 3.063 3.703 calcowen.jpg 0.39 0.782 1.672 0.531 1.047 3.265 4.032 cathyr.jpg 0.375 0.797 1.594 0.594 1.047 2.859 4.032 claire01.jpg 0.391 0.766 1.609 0.562 1.079 3.234 4.016 claire997.jpg 0.359 0.782 1.687 0.609 1.094 2.938 4.172 claireb2.jpg 0.391 0.812 1.594 0.578 1.047 2.812 4.031 clareke.jpg 0.421 0.75 1.594 0.593 1.047 2.813 3.984 clarker.jpg 0.422 0.797 1.609 0.578 1.047 3.188 4.031 coulthard.jpg 0.407 0.765 1.656 0.625 1.062 3.235 4.108 deb234.jpg 0.406 0.765 1.61 0.546 1.015 3.329 3.936 duttont.jpg 0.391 0.765 1.547 0.532 0.984 3.14 3.828 elite2.jpg 0.375 0.75 1.61 0.562 1.047 3.281 3.969 feniap.jpg 0.375 0.781 1.594 0.594 1.047 2.89 4.016 fenwick.jpg 0.39 0.797 1.61 0.531 1.047 3.359 3.985 fox.jpg 0.453 0.797 1.61 0.531 1.031 2.859 3.969 gaffney.jpg 0.39 0.781 1.61 0.562 1.016 3.328 3.969 gemmatweed.jpg 0.391 0.765 1.594 0.547 1.031 3.25 3.937 gracech.jpg 0.391 0.781 1.703 0.547 1.047 3.297 4.078 Total bigs 2.48425 10.41 5.65225 3.69525 4.61725 15.24625 24.37475 Total smalls 0.420293 0.828073 1.757707 0.59439 1.123902 3.378756 4.30408 Total all 0.603756 1.6798 2.103889 0.870022 1.434422 4.433644 6.08814
����(�.���������� ��2��������������������������
&*
���������������� �
����������������� �� ���#&'������������������������������������������ ��������������
��������������������������������������#Matlab���������profiler�����������������������������
���������������� ��%���������� ��������������������������C++���������������������������
�����������������������������������
�� ����#����'��"��(�������������������������������������������� �� �������������� ���������
��������������������������������������������������������������������� ����������������������
���������� ����� ���� ���� � � ����� ���$� �� ������� ���� ��� ����+�/������� �� ������ ���� ������
�����(����1.7����������������������������������������������������������#Matlab��� ������
� ����������������������������������������������������� �����������%���������������������
������ ��� �������� ������ ����� ����� ������ ����� ���� ������ �����EZface� �� � ���� ������� �������
�������������� �� �� ��������������������������������������������� ������ ���������������� � ���
����������������������������# �������������������������������������������������
���"��������#������������ ����#������������� ���������������������������������������������
����������� ����������� ��� ����� ��� ����� ������� ������ �� ������ ������� ������ ���� #���������� ���
����������������������������������������������������������� ��������������������������������������
�������������������� �����#���� �������������������������������� ��������������������� ��%������
����������������� �������������������� ���������������������������!������������"���������
������������ �#������������������������ ����������������������������%�#��#�� ���--/�����������
� ��� ��������������������� ������ �� ������� ����2.1������������������������� �����������������
������� ���� � �� ��� ����� ����� ������ ���� ����� �����EZface��� ������#�������� ����� ���
�� ������������������������ ��������������������������������������������#100%�������� ����#��
�������������������������� ������������������������������ ��������������������������
������������������������������������� ����������
������� ����#+���� �� �� ������ ������ ������ ������ ����� ����������������� ��������� ���� � �
������������������������������������������I�������������������������������������������������
���������������� ����������� ��������F37��d4�����������������������������������������������
� ��� ����� ������ ��� ���� � ��� ��� ����� �� ��� ����� ����������� ����� ��� ������� ������� ����II�
����������7$�8���#�� ���������� ��������������������� ��%������� �����������������������
�������eyes� ����� � ������ ����� ����������� �������������II� ������� ����� ���������������������
������ ���� ������ ���� ����II� ��� ����� �� � ���� ����� ������ ������� ����� ������� ������������
��������������������������������������������������������� ��� ������������������������������
,'
����������� �������������������������������������������� ������������������������������d4��
albaron��F23��
� ������� ������� ����#����� ������� ����� ����� �� ����� ���� ����� ����� ����� ����� ����� ��
������������������������ ����������������������������!�II�"�������������������������
�����������#-+/��������������������������������������������������1.12���������������
����������������������������� ��������������������������������������
������� ���������� ���� �������� ��������� �����%���� ���#����� ��������� ����� � � ������� ����
��������������#EZface������������������ �����������������������������������������������
������������������������������������#100%����� ����������������������������������� #
� � �������� ����� ��� ���� ���������� ����� ��� ������������ ����� ��� ������ ��� ����� ��!Region of
Interest�"������������������������������������ ���������������������������������������
�������������� ����� �������� ������������ ����������� ������������ �� � ����� ������RGB� ����� ����
����� �� ������� ��� �� ����� ������ ������ ��������� ����!Real Time� �"������� ���� ���� ��� ����
�������� ����� ���������� � � ���������� ��� ������� ���� ����� � ���������� �������� ����� ��
�������������
����� ����#� ������� ����� ������������ �� ��� � �� ������ ����� � ����� ����� ���������������������
������� ���������������������� ��� ��������������������������� ���� ������������� �����������
��������������������������������� �+$/�������������������������������� ����������������
� ��������� ������ ����� ���������� ���� ��� ����� � ������� ��� � ������ ��������������� ������ ����
�������������������������
���� ��� ����#� �������� ������� ����#������� ������ �<��� ����� ���������� ���� ������ ����
��������������������������������������������������������������������������������������� �
��������������������������������������������� �������������������0������������������������
����������������������������������������#��������������������������������������������������
���������%���� ����%���������������������������������������������������������������������
���������������������������� ����������������������� ���������������������������������
����������������������� �������������������� ���������������������������������� ������
���������������60%������������� ����$��������������������������������������������� �������
������������������������ ����%���������������������������������������������������������
��������������������
� �������� ������������������������������������ ������� ��������������������������������
������������� ������� ������������!Constants�"������� ���������� �� ���� ����� ������ �������� ����
,)
� � ������ ������ ��������������� �� ��� �����%�� ������ �������������� ������� ���� �������
������ �%������������������������������� Edges������� �����������������������#������� ������
������ �� ��� ���� ��������������� ������� ��� ������������ �� ��� ��� ���� ���� ������������
����� ���� ������� ��� ���� ������� �� �������� ��������� ������ ������ �� ����������� ��� � ���� ����
�������#,������������������������������������&'����� ����������������#EZface� ��� ��������
� �������������� �������������������������%�������
������������������������
���� � ���� ����� �� �������� ���#�������� ��� �������� ������������ ������� ����� ����� ���
�����������������EZface��������������������������������������������������0���� ����������
������������������������������������������������������� ���������������������������������
���������������������������������������#100%����� ���������������� ����������������
�����������������������
��� �������������.�
� �������������!20°������#�� �������������� ������������� ���������������������������
����������������������������!�����II�"�
� �� ���������������!����������180°"�
� ��������������������� �������� ������������������������������������������ �����������
Edges��������
� �������������������������!� ����������"���� �������������������������������������
������� ��������� �������� ������� ����� �������� ������ ������ �� ������ ��� ������ ��
������������
� ���������������������'/����������������2���������� ������������������������
����������������������������������������������������� ������������������������d4��
� ���� ��������!)''����� ����� ������ �������� %���"� ������ �� ����#Edges������ �����
������������������������d4, fox�
� � ������ ������������������������ ���� ������ ������������� ����� ��������������� �����
���� ��
� ��������������������������������������������� �����������������������������������
����������������������������� ���������������dull�
,�
� ��������������������������������� �������9�
� �����������������������%��������������� ����������������
���������������������
����������������� ������������������������������������������������������������������� ��
� ��#��� � ������ ����� � ����� ���� �������� ����� ��� ��� ��������� ������ ����� ������ �����
%�������������������������������������� ����������.�
� ������������������������
o ���������������������������������%��������%��������
o ��������������������������������������������������
o ���������������#7$8������������������������������������������������
� ���������������������Edges����������������������������������
� ��������������������������������%���������������������������� ��������������������������
��������������������������
� ��������������������������������� �������������
������ ���� ���� ������ ������ ����� �������� ���� ��
������� �������������� ������������&$�����������
��� ����#������������� ������� ������������ �����
������������������������������������ ������� �
��� ������������������� ���������������������
�����������������������������������������������
� ���������������������������������������� �������
dull�������������������������
� ����� �������� �������� ��������RGB���� ���
YCrCb� ������� ������� ���� ���� ������ ���� �� � �� �����#���� ���� ������ ����
����������������������������������������������������������������
� � ������ ��������������� ���� ���!�� ������ ��� �� �0����� ������ ��������� ������
������"�
Rmax
Rmin
���� 53�.��������������������������������������������
,$
%�����!������ ������� ��� �������� ������ ����������� ������ ���� ���� �������� �������� ����� �����
� ����� ����� ����� ������ ��� ��� ������ ���������������� ��� ���������� ������ ����� ����� ��� ��
EZface Ltd� ����� �������� ����� ��� ����� ����� ��������� ������� ����� ���� ������ � �
�������������� ��� ������������������������� ������������ ������������� ������� ���� ����
�������������������������������������������������������������������
����� ������� ������ � �� ������ ��������� ��� ����� ���� ������ ������ ������� ����� �������
����������� ���������������� ���������������RGB��������YCrCb� ��� ���� ����������������������
RGB����� ������� ���������#�� �� #YCrCb�%������ ���� �����#������������� ����������� ��������� � ��
���� �������� ��� �������� ������ ��� ������ ����� ������ ������������������ ��� ��������� ����
�������������������������������������������������� ����������������������� �������������������
��� ������ ����� ���� ����� �������������� ���� � ������������ �������� �� ������ �����������
���������������������������������������
���������������� ����������������� �������� � �����%������������� ����������� ���������
���� ����� ��� � � �� �� ����� ���������������� ��� �� ������ ������ ��� ���� ������ ������� ���
�����������������������������������������������������������������������������������������#
�����������������������������������������������������������RGB�������� #������������ �����
������ ���������������������������� � ������ ���������������������������������!����������� �"�����
������������������ ���#�������%����������������������������� �������
����������������������������������������� ����������������������������EZface�� ����
���������� ������ ������ ������� ������ ����� ���� ��� ������ ������ ����� ��� ������ � ���� ����
��������������������������� �.��������������������������������������!Crop�"�������������������
�� ������� ����0� ����� ������� ���� �� ���� ������� ������ ������ ����� ������#������� ��� ����� ���
�������������������������� �������������������#���������������������������������������
������������ ����� ����������� �������� ���������������� ������ ���������������������� #� � ��������
���������� ����������������������������� ��������� ���������������������������������%����� ����
���������������� ������������������������������������ �������������������������������������������
�����������[20]4���� ��������������������������IEEEI-23 ��
4����������������������������������������������������� ����������������������
,(
'��������������[1] R.A. Schowengerdt, "Digital image classification," Techniques for Image Processing
and Classification in Remote Sensing, chapter 3, pp. 129-207, UP of Orlando, Florida,
1983.
[2] M.S. Yang, D.J. Kriegman, and N. Ahuja, "Detecting Faces in Images: A Survey," IEEE
Trans. on Pattern Analysis and Machine Intelligence, vol. 24, no. 1, pp. 34-58, January
2002.
[3] R. L. Hsu, M. A. Mattaleb, and A.K. Jain, "Joint Face Detection in Color Images," IEEE
Trans. on Pattern Analysis and Machine Intelligence, vol. 24, no. 5, pp. 696-706, May
2002.
[4] W. Pratt, Digital Image Processing. New York: John Wiley & Sons Inc., 2nd ed 1991.
[5] Martinkauppi Birgitta, "Face Colour under Varying Illumination - analysis and
applications," PhD thesis, Department of Electrical and Information Engineering, Univ.
of Oulu, 2002, http://herkules.oulu.fi/isbn9514267885/ (3/2004).
[6] J. Canny, "A Computational Approach to Edge Detection," IEEE Transactions on
Pattern Analysis and Machine Intelligence, vol. 8, no. 6, pp. 679-698, June 1986.
[7] MathWorks Inc., " chapter 7: Analyzing and Enhancing Images," and "chapter 8: Binary
Image Operations," MATLAB Image Processing Toolbox User’s Guide, Version 3,
MathWorks Inc., 2001.
[8] A. K. Sohaib, "Canny's Edge Detector: Implementation," LUMS, Prentice Hall, Oct.
2002. http://suraj.lums.edu.pk/~cs436a02/CannyImplementation.htm (10/2003).
[9] Manolalus Dimitris and Shaw Garv, "Detection Algorithms for Hyperspectral Imaging
Applicaitions," IEEE Signal Processing Magazine, January 2002.
[10] Naiman Aaron, "Numerical Methods, Online Course," JCT, Jerusalem, summer 2003.
http://math.jct.ac.il/~naiman/nm/ (4/2004).
[11] Eastman Kodak Company, "Introduction to Digital Imaging," Digital Learning Center,
Eastman Kodak Company. http://www.kodak.com/US/en/digital/dlc/book3/index.shtml
(4/2004).
[12] Ward Matthew, "Digital Color," 1999. http://davis.wpi.edu/~matt/courses/color/
(4/2004).
,&
[13] Bill Green, "Canny Edge Detection Tutorial," 2002. http://www.pages.drexel.edu/
~weg22/can_tut.html (4/2004).
[14] Perez Asher, "Digital Image Processing Course," Dept. Electronic Engineering, JCT,
2003.
[15] A. Hadid, M. Pietikäinen, and B. Martinkauppi, "Color-Based Face Detection using Skin
Locus Model and Hierarchical Filtering," In 16th Int. Conf. on Pattern Recognition, vol.
IV, pp. 196-200, IEEE Press, Québec, Canada, August 2002.
[16] EZface inc., "EZface Home-Page - The Virtual Makeover Experience," EZface inc.,
2004.� http://www.ezface.com/site/index.html (4/2004).
7)+8 ��#�������������������������������������� ���������������������#������)**,�
7)-8 �����������������������������������������������#������)*-+�
7)*8 ��������������� ����� ������ �������� ����� ����������� ��������� ����� �2003��
http://multimedia.haifa.ac.il:16080/course/intro/intro.html�(11/2003)5��
7�'8 ��������������������������������������(#��������#���������#����������������������������������
������������������������������������''(�
7�)8 ������ ���� ��� � ��� ��������� ������ �������'')� �http://hebrew-
academy.huji.ac.il/decision4.html��(4/2004)�
5�!�������������������������������������������� �������������������"
,,
(������! �
(�������������������������
(�������� ����� �������������������
����������� ���������������������������� ������������������������������ ������������
����������������������������������������������������������4��6��8��10��ornit��dull��������
������ �����������5� �9� �d4� �� �� ���������� � � ������ ���� ����� ��������� � ������� �������� ��� �
��������
�
���� 54�.����������������������������
,+
(������������������������!� *+,+-.-�/+012,34��
� ����� ���� �� ������� ������ ����� ������ ������Minimum Distance� ����� � ������� ���
� ������ ���������������������� ����� ������� ���� ������� �������� ����� ���� ����� ���� � �� � �� ������
������ ������������������&&�����������������������ornit� �������������� ������ � �� ��������
�����������������������������������������������
�
�
���� 55�.����������������������������Minimum Distance�
������
���������
���������
���������
���������
������!�
��d>100 d>=300
� �
�
,-
(�������� �����������������567��
���� ������ ������ ������� ������� ������ ����� ����� ������ �������� ���� ���� �� ������ �����
������ ����� ��������������������� ������ ���� ������ ���������� ���� ��� ����� ����������������������
�� �����#Matlab�������������������������� ��������� �������������������������� ������������� ���
������� �������������������������������������������������������������������� �����)��
�
��
>> file: 4,jpg----------------------Face3 (num points=93831)0 89645 938283343 0 935332 199 0
lips1 (num points=5555)0 5555 55550 0 11140 4241 0
lips2 (num points=1176)0 538 1072584 0 106097 102 0
lips3 (num points=9353)0 8702 9226594 0 3339119 5719 0
hair1 (num points=30512)0 2809 413126177 0 1110025795 17925 0
hair2 (num points=40723)0 13352 1617623588 0 1881723340 20333 0
hair3 (num points=92997)0 32517 3890454300 0 4646052070 42916 0
in percents :----------------------Face30 96 1004 0 1000 0 0
lips10 100 1000 0 200 76 0
lips20 46 9150 0 908 9 0
lips30 93 996 0 361 61 0
hair10 9 1486 0 3685 59 0
hair20 33 4058 0 4657 50 0
hair30 35 4258 0 5056 46 0
��� 5.������ ����� RGB ��������������������������
,*
�
�>> file: 10,jpg----------------------Face1 (num points=68009)0 68009 680090 0 680090 0 0
Face2 (num points=3603)0 3603 36030 0 35900 3 0
Face3 (num points=98063)0 98063 980630 0 980630 0 0
Eyes1 (num points=406)0 405 3930 0 2808 97 0
Eyes2 (num points=391)0 391 3910 0 2490 125 0
Eyes3 (num points=2515)0 2513 24680 0 198241 392 0
lips3 (num points=11891)0 11891 118910 0 111220 436 0
hair1 (num points=15389)0 15389 153890 0 153710 7 0
hair3 (num points=112310)0 112278 11231012 0 1118170 109 0
in percents :----------------------Face10 100 1000 0 1000 0 0
Face20 100 1000 0 1000 0 0
Face30 100 1000 0 1000 0 0
Eyes10 100 970 0 692 24 0
Eyes20 100 1000 0 640 32 0
Eyes30 100 980 0 792 16 0
lips30 100 1000 0 940 4 0
hair10 100 1000 0 1000 0 0
hair30 100 1000 0 1000 0 0
��������&�.������������RGB���������������������������
+'
�
�
�
�
�
>> file: 6,jpg----------------------Face1 (num points=62580)0 62377 62580132 0 625800 0 0
Face2 (num points=48578)0 38203 485785948 0 485780 0 0
Face3 (num points=50542)0 50024 50542304 0 505420 0 0
Eyes1 (num points=1934)0 1347 1280467 0 767598 932 0
Eyes2 (num points=895)0 452 518430 0 824373 58 0
Eyes3 (num points=5090)0 3143 34661784 0 32971546 1506 0
lips1 (num points=10316)0 10316 103160 0 103160 0 0
lips3 (num points=12445)0 12445 124450 0 124450 0 0
hair3 (num points=182680)0 117152 11437416148 0 5786749493 78959 0
in percents :----------------------Face10 100 1000 0 1000 0 0
Face20 79 10012 0 1000 0 0
Face30 99 1001 0 1000 0 0
Eyes10 70 6624 0 4031 48 0
Eyes20 51 5848 0 9242 6 0
Eyes30 62 6835 0 6530 30 0
lips10 100 1000 0 1000 0 0
lips30 100 1000 0 1000 0 0
hair30 64 639 0 3227 43 0
��������&�.������������RGB���������������������������
+)
(���������!�������������������567��
� �������� �� ������������ ������ ��� ��������� ���B:C��� �������� ������ ������������ ��������
������� �������������������������������<����� ���� �������������������� ��#��������������������
����� ������ ������� � � ������#$���#������ ������� ��� �������������� ������� ��� ������� ����,'���
� �����#B:C���� �������� ������� ����� ������� ��������� .� ���!B� "� ����!:� "� ��� !C"� ������
��������������������������������������������������������������������������������������������
� ������ ������ ����������������� ������ ������ �� ����� %����������������� ������� ���� ��������� ���
�"��� ������ ���������� ����� ������ �������� ��� ����� ������ �� �������� ������ ��� �����
������������������������������������������
���� 56�.����������������RGB������������������������������������
+�
���� 57�.����������������RGB��������������������������������������
+$
���� 58�.����������������RGB�������������������������
+(
���� 59�.����������������RGB����������������������
+&
�
�
�
�
Area R G B �������#�� Face1: 236 200 175 ��� Face2: 240 219 183 ����� Face3: 231 199 171 �����1������ Eyes1: 11 29 41 ���� Eyes2: 84 111 96 ���� Eyes3: 210 231 223 ���� lips1: 208 154 167 �������� lips2: 211 217 186 ������ lips3: 210 147 151 ������ hair1: 15 21 25 �������� hair2: 42 35 30 ������� hair3: 24 27 27 ������
���� 60�.�������������������������������RGB�����������������������4.jpg�.���������������������������������������������������������������������������������������������������
�
�
�
+,
(���%�����!�������������������567�!�����
� ��� ��������� ������[15]�������������������������������������������������������� �� ���������
� ��� � ��������������RGB������ ������� ������� ������� �� ��� ��������� ����� ������ ������.
13 ( )I R G B� � �� �� �� ��������� ������ ��� ���� ������ ������ ��� �� ��� ������ � � ��� ����� �R+G+B�
�������������������������#� �����������������������������
���� �������������� ������� ���� ��� ����� �� ������� ���������������� ����������� ��� �����
� ����� ������ ���������������� ���� �������� � ������ ���������� ����� �� ����� ��� ��� ��� �����
���������� ������������ � � ����#�������������������� ������� ������� ���� ���� ����� ������ ����
���������������������������������� �� �������������������!��������+�)�,��"�
���� 61�.����������������������������RGB������������4.jpg�
++
(���'�����������!�������567�$�����!����������
��������������������� ������ ������ � ����������� ��� ������� ����� � ����������� ��� �
���� �)���#�'�����������������#������������!True or False�"�
�
���� 62�.����������������RGB��������������������������
+-
�
�
�
���� 63�.����������������RGB������������������������������
���� 64�.����������������RGB������������������������������
+*
�
�
�
�
���� 65�.����������������RGB�������������������������������!�����[3]"
���� 66�.����������������RGB������������������������������
-'
(���(������� ������������!���567��
��������������������,������������ �������� ���������� ������ ��������������� �������� ������
��#������ ����������������������������������������������������������������������������������� �
���������������������������� ����������������� ������������������� ������ ������������ �
������������ ��������� ����� ������� ���� ������� ����������� ������ ���� ����� ��� ���� ������ ����
����.�1�R-G, 2�G-B, 3�R-B, a�R/G, b�G/B, c�R/B� ������� .1-2�(R-G)-(G-B)=R+B-2G��
a/b�(R/G)/(G/B)=RB/G2��� �!������ ����������������������������������������������� ��
�
Face1 R G B4 236 200 1756 200 178 1348 174 102 8210 218 137 120dull 256 241 226ornit 231 195 158
Face24 240 219 1836 245 242 1978 167 103 8310 211 124 120dull 253 235 221ornit 224 187 152
Face34 231 199 1716 189 168 1138 119 72 5910 164 110 93dull 246 217 192ornit 247 222 190
lips14 208 154 1676 231 198 1678 179 89 9210 193 108 100dull 242 178 173ornit 233 138 126
lips34 210 147 1516 235 204 1728 183 82 8910 201 113 103dull 246 178 173ornit 248 161 136
>120 >70 >50
Face1R-G G-B R-B4 36 25 616 22 44 668 72 20 9210 81 17 98dull 15 15 30ornit 36 37 73
Face24 21 36 576 3 45 488 64 20 8410 87 4 91dull 18 14 32ornit 37 35 72
Face34 32 28 606 21 55 768 47 13 6010 54 17 71dull 29 25 54ornit 25 32 57
lips14 54 -13 416 33 31 648 90 -3 8710 85 8 93dull 64 5 69ornit 95 12 107
lips34 63 -4 596 31 32 638 101 -7 9410 88 10 98dull 68 5 73ornit 87 25 112
Face1 R/G G/B R/B4 1.18 1.1429 1.34866 1.1236 1.3284 1.49258 1.7059 1.2439 2.12210 1.5912 1.1417 1.8167dull 1.0622 1.0664 1.1327ornit 1.1846 1.2342 1.462
Face24 1.0959 1.1967 1.31156 1.0124 1.2284 1.24378 1.6214 1.241 2.01210 1.7016 1.0333 1.7583dull 1.0766 1.0633 1.1448ornit 1.1979 1.2303 1.4737
Face34 1.1608 1.1637 1.35096 1.125 1.4867 1.67268 1.6528 1.2203 2.016910 1.4909 1.1828 1.7634dull 1.1336 1.1302 1.2813ornit 1.1126 1.1684 1.3
lips14 1.3506 0.92216 1.24556 1.1667 1.1856 1.38328 2.0112 0.96739 1.945710 1.787 1.08 1.93dull 1.3596 1.0289 1.3988ornit 1.6884 1.0952 1.8492
lips34 1.4286 0.97351 1.39076 1.152 1.186 1.36638 2.2317 0.92135 2.056210 1.7788 1.0971 1.9515dull 1.382 1.0289 1.422ornit 1.5404 1.1838 1.8235
R>G G>B*0.92 R>B*1.1
R>G
G>B
-15
R>B
+30
��� 6.����������������������RGB���������������
-)
Face1 1-2 3+2 3+14 11 86 976 -22 110 888 52 112 16410 64 115 179dull 0 45 45ornit -1 110 109
Face24 -15 93 786 -42 93 518 44 104 14810 83 95 178dull 4 46 50ornit 2 107 109
Face34 4 88 926 -34 131 978 34 73 10710 37 88 125dull 4 79 83ornit -7 89 82
lips14 67 28 956 2 95 978 93 84 17710 77 101 178dull 59 74 133ornit 83 119 202
lips34 67 55 1226 -1 95 948 108 87 19510 78 108 186dull 63 78 141ornit 62 137 199
Face1 a-b c+b c+a4 0.037143 2.4914 2.52866 -0.20476 2.8209 2.61618 0.46198 3.3659 3.827810 0.44957 2.9583 3.4079dull -0.004131 2.1991 2.195ornit -0.049562 2.6962 2.6466
Face24 -0.10083 2.5082 2.40746 -0.21603 2.4721 2.25618 0.3804 3.253 3.633410 0.66828 2.7917 3.4599dull 0.013247 2.2081 2.2214ornit -0.032402 2.7039 2.6715
Face34 -0.0029387 2.5146 2.51176 -0.36173 3.1593 2.79768 0.43244 3.2373 3.669710 0.30811 2.9462 3.2543dull 0.0034322 2.4115 2.4149ornit -0.055808 2.4684 2.4126
lips14 0.42849 2.1677 2.59626 -0.018962 2.5689 2.54998 1.0438 2.913 3.956910 0.70704 3.01 3.717dull 0.33065 2.4277 2.7584ornit 0.59317 2.9444 3.5376
lips34 0.45506 2.3642 2.81936 -0.034086 2.5523 2.51828 1.3104 2.9775 4.287910 0.68167 3.0485 3.7302dull 0.35312 2.4509 2.804ornit 0.35655 3.0074 3.3639
��������,�.���������������������RGB���������������
-�
�
�
�
�
Face1 1/2 3*2 3*14 1.44 1525 21966 0.5 2904 14528 3.6 1840 662410 4.7647059 1666 7938dull 1 450 450ornit 0.97297297 2701 2628
Face24 0.58333333 2052 11976 0.066666667 2160 1448 3.2 1680 537610 21.75 364 7917dull 1.285714 448 576ornit 1.0571429 2520 2664
Face34 1.1428571 1680 19206 0.38181818 4180 15968 3.6153846 780 282010 3.1764706 1207 3834dull 1.16 1350 1566ornit 0.78125 1824 1425
lips14 -4.1538462 -533 22146 1.0645161 1984 21128 -30 -261 783010 10.625 744 7905dull 12.8 345 4416ornit 7.91666667 1284 10165
lips34 -15.75 -236 37176 0.96875 2016 19538 -14.428571 -658 949410 8.8 980 8624dull 13.6 365 4964ornit 3.48 2800 9744
Face1 a/b c*b c*a4 1.0325 1.5412 1.59136 0.84585 1.9826 1.6778 1.3714 2.6395 3.619810 1.3938 2.074 2.8908dull 0.99613 1.2079 1.2032ornit 0.95984 1.8044 1.7319
Face24 0.91574 1.5695 1.43726 0.82414 1.5277 1.25918 1.3065 2.4969 3.262310 1.6467 1.8169 2.992dull 1.0125 1.2173 1.2325ornit 0.97366 1.813 1.7653
Face34 0.99747 1.5721 1.56816 0.7567 2.4866 1.88168 1.3544 2.4614 3.333610 1.2605 2.0858 2.6291dull 1.003 1.4481 1.4525ornit 0.95224 1.5189 1.4464
lips14 1.4647 1.1486 1.68226 0.98401 1.64 1.61388 2.079 1.8822 3.913210 1.6547 2.0844 3.449dull 1.3214 1.4393 1.9018ornit 1.5416 2.0253 3.1222
lips34 1.4674 1.3539 1.98686 0.97126 1.6205 1.57398 2.4222 1.8945 4.588810 1.6213 2.1409 3.4712dull 1.3432 1.4631 1.9652ornit 1.3012 2.1587 2.8089
��������,�.���������������������RGB���������������
-$
(���)�����������!���������� �����������������������
��#������ ������� ��� � ��� ���� �� ������ ��������� � � ����� ���������� ������ ������� �������
������#�Least Squares���������������������������#������%���������� ����������������������
��������������,+��������������� ������������������� ��������� �������� ����������������������
����� ��������lips1�!�������������"������
� �������� ������� �������� ��������� ���+�
� ����� ������� ��� �� ��� ����,+�� ��������
� ���������� ����� ����� ������������ �
� �����#�Least Squares�� ������� ����� �
�7.2.1. ������������������y=ax+b��������
�����������������!+�)�+�"�
���� 67�.��������������������������� ���������#RGB
��� 7.���������� ��#Least Squares�����������������RB/G2�
a/b face1 face2 face3
d 1.557352 2.844871 1.424529
a 1.343963 0.765072 1.542192
b 0.029316 0.655885 -0.11798
� �!��������������y=ax+b=1.5x
2+3 ���������
0
20
40
60
80
100
120
140
0 50 100 150
1�����
2�����
3�����
����������1/2
-35
-30
-25
-20
-15
-10
-5
0
5
10
15
0 5 10 15 20 25 1�����
2�����
3�����
1-2 ���������
0
10
20
30
40
50
60
70
80
90
100
-50 0 50 100
1�����
2�����
3�����
1-2 ���������
0
10
20
30
40
50
60
70
80
90
100
-50 0 50 100
1�����
2�����
3�����
��!������a-b
-0.2
0
0.2
0.4
0.6
0.8
1
1.2
-0.6 -0.4 -0.2 0 0.2 0.4 0.6 0.8
1�����
2�����
3�����
��!������a-b
-0.2
0
0.2
0.4
0.6
0.8
1
1.2
-0.6 -0.4 -0.2 0 0.2 0.4 0.6 0.8
1�����
2�����
3�����
c*b ��!�����
0
0.5
1
1.5
2
2.5
3
3.5
4
4.5
0 1 2 3 4
1�����
2�����
3�����
c*b ��!�����
0
0.5
1
1.5
2
2.5
3
3.5
4
4.5
0 1 2 3 4
1�����
2�����
3�����
a/b ��!�����
0
0.5
1
1.5
2
2.5
0 0.5 1 1.5 2
1�����
2�����
3�����
a/b ��!�����
0
0.5
1
1.5
2
2.5
0 0.5 1 1.5 2
1�����
2�����
3�����
�face
�lips1
face1
face2
face3
face1
face2
face3
face1
face2
face3
face1
face2
face3
face1
face2
face3
face1
face2
face3
�face
�face
�lips1
�lips1 �lips1
�lips1 �lips1
�face
�face
�face
�
�
�
�
-(
(���8������������!��������$�����!����������
�
�
�
���� 68�.���������������������#�����������������.���������������������� ������������������������!low-pass�"�����29x29
���� 69�.������������������������#��������������������������������.������������������������������������
� �
� �
-&
(����9�����!������������������������:;<;=��
����������������������� ���������������������DEFEG����������������������������� �� �����#�
DEFEG�������������������������.����!EF�"�����!D�"���� !EG�"�
�
���� 70�.����������������YCrCb������������������������������
-,
���������+'�.����������������YCrCb������������������������������
-+
�
�
�
Area R G B �������#�� Face1: 135 189 117 ��� Face2: 134 221 114 ����� Face3: 141 197 111 ����1����� Eyes1: 119 40 137 ���� Eyes2: 119 97 131 ���� Eyes3: 125 204 130 ���� lips1: 150 160 123 �������� lips2: 135 175 121 ������ lips3: 153 151 122 ������ hair1: 128 42 128 �������� hair2: 131 44 125 ������� hair3: 130 45 126 ������
face
eyes
lips
hair
face
eyes
lips
hair
1 2 31 2 3
���� 71�.�������������������������������YCrCb�����������������������4.jpg�.���������������������������������������������������������������������������������������������������
�
�
�
--
(�������������!����� ���:;<;=��
���������������������+������������������������������������������������������������������
� ����� ����!� ����Cr/Cb� "��� ���������� ������ ������������ �� ��� ���� ������ �� ��� ��������
�������������������������� �������������������������������������������� �[0,255]������������
���� ������������������������������������������������������������������������������������
������������������������������������������������������������������������� ������4�����������
����������������������
�
�
�
CCrr CCrr22 CCrr//CCbb 11--CCrr
CCbb CCbb22 CCbb//CCrr 11--CCbb
�����72.�����������������YCrCb�
-*
(�������������:;<;=�$�����!����������
�
�
�
���� 73�.����������������YCrCb����������������������������
���� 74�.����������������YCrCb����������������������������
*'
�
�
�
�����76.�����������������YCrCb������������������������������������ �
���� 75.�����������������YCrCb������������������������������������
*)
(�������������>?@40�$��������������!���������
�
�
�����77�.���������#������������������Sobel����������Canny����������������������
�
�
�
*�
�
�
�
HpHp--filterfilter Hp+LpHp+Lp--filterfilter HpHp--filterfilter Hp+LpHp+Lp--filterfilter
thrshH=0.05, pwH=7 thrshL=0.1, pwL=19 thrshH=0.05, pwH=7 thrshL=0.1, pwL=19
���� 78�.����������������#������������������������������������� �����������������!hp-filter + lp-filter�"�
���� 79�.��������������������������������#����������
*$
�
�
�
���� 80�.�������������������������� �����
���� 81�.�������������������������������������������������������������������.����#����������1��� �������
*(
(������ �������� ���������
(��������������������!��*+,+-.-�/+012,34���
������������������������������������#������������������������������������������������
��������������������� �����������������������!4Classes� "����������� �����������������
����������������������Mi���������������������i�� �����������-������������������������������ �
����� ���������� ����� ���� ���� ����� �������� ��#������ ���
����� ������� �������������� ����� �������������������������
������������ ������� �������������������������������
���������������������������������������������������
�������� ����������������������� ����������������������
���� ��� �� ������ ��� ���� �� �� ��� ���#� ����� � ������
��������������������������������������#�[20]���#�[1]��
������ �� ���������� ������� ���� ����� � �� ������ ��������� ����� ������� �� ��������
� ��� ���������� ����� � ��� ������� �������� ������� ����� � � ��� ���������� ����� ��� ����������� �
�����������������������������������������������������#���������!����������� ��3.2.3. "��
��� ��������� ������� ��� ������ ��� ��� ������ ����� ��� �����#����� �� �� ������ � �i��������� %�����
� �������Mi������ � ��#� ���Hi� �������� �������� ��������i������ ��������� ���� �� ���� ������� ����
����������������������������������� ������������������� ��#�������������!����������������"��
� �������� ������.�� �2
22
122
( / ) exp i
ii
X MP X i�
� �� � � �
� ��� � �
��
����������������������� ��� ������������������������ ��������������������������
������ ���� ������� ���� ������ ��� �� ����� �� �������� �� ���������� �������Max(P(i/x))��
� ����� ���� �����!( / ) ( / ) ( ) ( )P i x P x i P i P x� �� "� ���� ��� ����� �����#Max(P(x/i)P(i))� ���������
lan()�������������������������������������������������� �#Max(lan(P(x/i))P(i))���
��������������������������������������������������������������������������������.
�� ������������� � � ���������������������i=�j=�0���� ������������������� �����������������
P(i)=P(j)=P0������������������ ������������������������������������������� �����!�0�"�����������
���� ����������������������������������������������������������������������������������������� �����
�������������������������������������������������.�
(�7.1) * + � �21 12 2ln ( / ) ln( ( )) ln ( ) ( )t
i i i i i k ik ik
P X i P i X M X M X M x d�, -� � . �. � � � / 0� �
� �� �
1 11 1
1
1
,
( ) ( )
1
i i in
i i
in i n inn
N
j ij k ik
ijk
M
x x
N
� � �
� � �
� ��
� � � � �� � � � �� . �� � � � �
� � � �� � � � ��
�� �
�
�
�
� � � �
�
� �
���� 82�.����������������������������������#����
*&
(������������$Least Squares��
�����������������%��������������������������������������������������� ��������������
��������������������������������� ����� �%������������������������������������ �������������������
�������������� �����%��� ��� ������ ��������������� ���������� ������ ������� ���� ��� ���� ��� ����
��������������������������������������������������������������������������������������� ����
�����������������������������������������������������#�[10]��
����������� ����������������y=ax+b������� ������%����� ��������������� ������
�����-��������������#Least Squares����������������
���� ��������� ����������� ���������������������������
������%����������������������������������������������
�����a��#b�����������������������������������������
����������������������.2 2
0 0
0 , 0m m
k kk k
e ea b� �
1 1� �
1 1� �������������������� k k ke ax b y� � ��
�#I������ ��� ������� ����� ����� �������� ���� ��� ������ � ���� ��� �������� �ek���������� �����
������������ �������������������������������� ��� ����
�������������������.��
(�7.2)
2
0 0 0
0 0
( 1)
m m m
k k k kk k k
m m
k kk k
x a x b x y
x a m b y
� � �
� �
� � � � � �� �� � � � � �
� � � � � �
� � � �� � �� � � �
� � � �
� � �
� �
������������������������������!d����������."�
(�7.3) � � 2
0 0 0 2
0 02
0 0 0 0
11
, ( 1)1
m m m
k k k k m mk k k
k km m m mk k
k k k k kk k k k
a m x y x yd
d m x x
b x y x x yd
� � �
� �
� � � �
� , -� � � 2 3
� �� / 0� � � �
, - � �� � 2 3� / 0�
� � �� �
� � � �
�
Ym���y1y0y
Xm���X1X0X
Ym���y1y0y
Xm���X1X0X
��� 8�.����������������%��������
*,
(����� �������
��������� ����� ��MATLAB�����,�&������ ���������������������� �������������������
casting�� ������#double()� ����� ����������� ���� ��� ����Logical� �������� ������ �������� ����� ���
���������!���������������� �������������������������"�
���������������������������� ��������������� ������������������������������������
�� ������ ������ ����� ������ ���� ��� ��� ��� ������� �������� ������ ������ ������� ����� �������� �
%������������������������� #�%��������������!��������7.6����"
Clasify4.m %%% ������� �������� ����� ����������� ������������� ��������� ��� �������������������� �
clc % clear the screen�
clear all;�
close all; % destroy all the figure window from the last run�im_file='6'; %_YCbCr';�
iptsetpref ('TruesizeWarning','off'); iptsetpref('ImshowBorder','tight'); % display images options�
image=imread (im_file,'jpg'); % read the picture by band��
if exist(['features_',im_file,'.mat'])�
load(['features_',im_file,'.mat'])� num_cls=length(class(:,1));�
else�
class=['Face1';'Face2';'Face3';'Eyes1';'Eyes2';'Eyes3';'lips1';'lips2';'lips3';'hair1';'hair2';'hair3'];� num_cls=length(class(:,1));�
bands=3;�
M(num_cls,bands)=0;� hist(256,bands,num_cls)=0;�
end �
not_saved=0;��
figure(1), imshow(image) % show the pic�
while 1� disp('first close interval of the part, and chooze class')�
cls=menu('Feature to clasified', class(1,:), class(2,:), class(3,:), class(4,:), class(5,:), class(6,:),...
class(7,:), class(8,:), class(9,:), class(10,:), class(11,:), class(12,:), 'Features','Exit');� if (cls==(num_cls+2)) break, end
if (cls==(num_cls+1))�
for i=1:num_cls � if (hist(:,:,i)==0) continue, end
figure, plot(hist(:,3:-1:1,i));�
for j=1:bands, c(j)=max(hist(:,j,i)); end hold on, plot([M(i,3:-1:1); M(i,3:-1:1)],[zeros(1,bands); c(3:-1:1).*1.05],'--') % plot avrages�
title(class(i,:))�
disp([class(i,:),': ',num2str(M(i,:))]);� end
continue�
*+
end � figure(1), imshow(image);�
[im,xi,yi]=select(image);�
[M(cls,:),hist(:,:,cls)]=avrage(histog(im,xi,yi));� not_saved=1;�
title(class(cls,:))�
disp([class(cls,:),' average: ',num2str(M(cls,:))]);� pause�
close all % destroy all the figure window from the last run�
end �
if (not_saved)�
j=menu('To save the changes','Yes','No');� if (j==1) �
save (['features_',im_file],'class','bands','M', 'hist'); �
end end
Select.m function [masked_im, x_indx_vect, y_indx_vect] = select(image)
%recieve an image, return a mouse masked image�
bands=3;�[mask,x_indx_vect, y_indx_vect] = roipoly; % set the part of the image that I want to collect the info on it�
for i=1:bands, masked_im(:,:,i)=immultiply(image(:,:,i),mask); end
Histog.m function hst = histog(image,xi,yi)�
%%% ��������������������� ����� ������������������������������ �
r(256)=0; % constract array to sum the namber of the pixel in r�
g(256)=0; % constract array to sum the namber of the pixel in g�
b(256)=0; % constract array to sum the namber of the pixel in b�pnts = 0;�
image=double(image);�
for y=floor(min(yi)):ceil(max(yi)) % the main curl - check the relations� for x=floor(min(xi)):ceil(max(xi))�
if (image(y,x,:)==0) continue, end
pnts=pnts+1;� r(image(y,x,1)+1)=r(image(y,x,1)+1)+1;�
g(image(y,x,2)+1)=g(image(y,x,2)+1)+1;�
b(image(y,x,3)+1)=b(image(y,x,3)+1)+1;� end
end
�hst(:,1)=r(:);�
hst(:,2)=g(:);�
hst(:,3)=b(:);�% this algorithm is not exact. it not take in acount black pixels in the selected bound.�
% if you want so you have to receive, as argument, the "mask" that was selected. then �
% change the if above to "if (mask==0) continue, end"�
*-
Avrage.m function [avrage_of_feature,a1] = avrage(a)
%%% Adaptive Mode Quantization �� ���������� ������������� ����� bands=3;�
t=0.3;�
s=0.4;�a1=a;�
for j=1:8; % IIR * 8�
for i = 2:255;� a1(i,:)=t.*a1(i-1,:)+s.*a1(i,:)+(1-t-s).*a1(i+1,:);�
end
end �
for i=1:bands; % normalization�
a1(:,i)=a1(:,i)/sum(a1(:,i)); �end
�
x1=10; x2=245; mult=8; % margin range�for j=1:bands; % if max*mult>margin_max then mean is max�
if max(a1(:,j)) > mult*max(a1(x1:x2,j))�
[c(j),avrg(j)]=max(a1(:,j)); % for moment mean == max� else�
[c(j),avrg(j)]=max(a1(x1:x2,j)); % for moment mean == max�
avrg(j)=avrg(j)+x1-1;� end
end
�
c=c.*0.6;�
for j=1:bands; % Adaptive Mode Quantization�
if (avrg(j)==1 | avrg(j)==256) continue, end % still what was� left(j)=avrg(j); right(j)=left(j);�
while (left(j)>1 & a1(left(j),j)>c(j)) left(j)=left(j)-1; end
while (right(j)<256 & a1(right(j),j)>c(j)) right(j)=right(j)+1; end if (left(j)~=1 & right(j)~=256) avrg(j)=round((left(j)+right(j))/2); end
end �
figure, plot(a1(:,bands:-1:1));�hold on, plot([avrg(3:-1:1); avrg(3:-1:1)],[zeros(1,bands); c(3:-1:1).*1.7],'--') % plot averages�
hold on, plot([left(3:-1:1); left(3:-1:1)],[zeros(1,bands); c(3:-1:1)],':') % plot lefts�
hold on, plot([right(3:-1:1); right(3:-1:1)],[zeros(1,bands); c(3:-1:1)],':') % plot rights�avrage_of_feature=avrg;
figure_detect.m %%% � �� ������� �������� ����� �����!������ ���"������� ���"��������� �� �
clc % clear the screen�
clear;�close all;�
im_file='8';�
image=imread (im_file,'jpg'); % read the picture by band�iptsetpref('TruesizeWarning','off'); iptsetpref('ImshowBorder','tight'); % display images options�
**
figure, imshow(image); ��
%%% pre-calculations %%%�
t_calc = clock; % sample the time�im=double(image);�
R=(im(:,:,1))/255; G=(im(:,:,2))/255; B=(im(:,:,3))/255; % pre-calcules�
Y = 16 + 65.481*R + 128.553*G + 24.966*B;�Cb = (128 - 37.797*R - 74.203*G + 112*B);�
Cr = (128 + 112*R - 93.786*G - 18.214*B);�
t_calc=etime(clock,t_calc);��
%%% main detections %%%�
t0 = clock; % sample the time�hair_mask = hair(image,Y,Cb,Cr);�
%hair_mask = Edges(image(:,:,1)); %%% also good results�
se5 = strel('disk', 5,0); se8 = strel('disk', 8); se10 = strel('disk', 10); se20 = strel('disk', 20);�show_mask (image,imdilate(hair_mask,se5), [0 255 0],5); % show the mask on the original image�
t1=etime(clock,t0);�
�
t2 = clock; % sample the time�
skin_mask = skin(R,G,B,Cr,hair_mask);�
t2=etime(clock,t2);�show_mask (image,imopen(imerode(imfill(imdilate(hair_mask&~skin_mask,se8),'holes'),se10),se20), [0 255 0],5);
% show the mask on the original image�
im1=show_mask (image,skin_mask, [255 0 0],5); % show the mask on the original image��
t3 = clock; % sample the time�
eyes_mask = eyes(Cb,Cr,skin_mask,hair_mask);�t3=etime(clock,t3);�
im1=show_mask (im1,imdilate(eyes_mask,se20), [0 0 255],3); % show the mask on the original image�
�
t4 = clock; % sample the time�
lips_mask0 = lips(R,G,B,skin_mask,eyes_mask);�
t4=etime(clock,t4);�show_mask (im1,imdilate(lips_mask0,se10), [254 0 255],3); % show the mask on the original image�
�
t4a = clock; % sample the time�lips_mask = lips7(Cb,Cr,skin_mask);�
t4a=etime(clock,t4a);�
show_mask (im1,imdilate(lips_mask,se10), [254 0 255],3); % show the mask on the original image�t_end=etime(clock,t0);�
�
t4b = clock; % sample the time�lips_mask1 = lips8(R,G,B,skin_mask,eyes_mask);�
t4b=etime(clock,t4b);�
show_mask (im1,imdilate(lips_mask1,se10), [254 0 255],3); % show the mask on the original image�show_face (image, eyes_mask, lips_mask0,3);�
show_face (image, eyes_mask, lips_mask,3);�
show_face (image, eyes_mask, lips_mask1,3);�t_end=etime(clock,t0);�
)''
�
%%% tuntime conclusion %%%�
disp(' '); disp(['(',im_file,'.jpg)']);�
disp(' computes times [seconds]');�disp(' =======================');�
disp(['pre calculation time = ',num2str(t_calc)]); �
disp(['time module 1 (Edges) = ',num2str(t1)]);�disp(['time module 2 (skin) = ',num2str(t2)]);�
disp(['time module 3 (eyes) = ',num2str(t3)]);�
disp(['time module 4 (lips) = ',num2str(t4)]);�disp(['time module 4a (lips7) = ',num2str(t4a)]);�
disp(['time module 4b (lips8) = ',num2str(t4b)]);�
disp(['time to show results = ',num2str(t_end-t1-t2-t3-t4-t4a-t4b)]);�disp(['total time (of modules) = ',num2str(t1+t2+t3+t4a)]);�
�
%%% propose to save if relevnate %%%�if exist([im_file,'_mask.tif'])�
old_skin_mask=imread ([im_file,'_mask.tif']); % read the picture by band�
end if exist([im_file,'_eyes.tif'])�
old_eyes_mask=imread ([im_file,'_eyes.tif']); % read the picture by band�
end if exist([im_file,'_lips.tif'])�
old_lips_mask=imread ([im_file,'_lips.tif']); % read the picture by band�
end if (~exist([im_file,'_mask.tif']) | ~exist([im_file,'_eyes.tif']) | ~exist([im_file,'_lips.tif']) ...�
| skin_mask~=old_skin_mask | eyes_mask~=old_eyes_mask |
lips_mask~=old_lips_mask)� j=menu('To save the masks','Yes','No');�
if (j==1) �
if (~exist([im_file,'_mask.tif']) | skin_mask~=old_skin_mask) %% save skin� imwrite (skin_mask,[im_file,'_mask.tif'],'tif','Compression','fax3');�
end
if (~exist([im_file,'_eyes.tif']) | eyes_mask~=old_eyes_mask) %% save skin� imwrite (eyes_mask,[im_file,'_eyes.tif'],'tif','Compression','fax3');�
end
if (~exist([im_file,'_lips.tif']) | lips_mask~=old_lips_mask) %% save skin� imwrite (lips_mask,[im_file,'_lips.tif'],'tif','Compression','fax3');�
end
end end
hair.m function hair_mask=hair(image,Y,Cb,Cr)�
% detection of hair (and maybe others that are not face)�
hair1 = Edges(image(:,:,1));�hair2 = ((Cr-Cb)<10) & (Y < mean(mean(Y))/2); % add "black" hair�
hair_mask = (hair1 | hair2);
)')
Edges.m %%% vertical Edges of the image�
function edge_mask=Edges(gray_image)�
pwH = 7; % the filter power (optimal for skin detection)�hp = hp_filterY(gray_image,pwH);
hp = hp>max(max(hp))/20*mean(mean(uint8(hp))) & hp>8;�
se5 = strel('disk', 10);�edge_mask=imclose(hp,se5);
hp_filterY.m function hp_mask=hp_filterY(mask,power)�
%%% A vertical high pass filter�
% I not checked it but power must be odd�filt=-ones(1+round((power+1)/6)*2,power); % creat the high pass filter�
div=-sum(sum(filt))-1;�
filt(1+round((power+1)/7),round(power/2)) = div; % for example filt=[-1,-1,-1,6,-1,-1,-1]�sz=size(mask);�
con = conv2(mask,filt/div); % 2-D convolution�
hp_mask = zeros (sz(1), sz(2));�hp_mask((power+1)/2:sz(1)-(power+1)/2,(power+1)/2:sz(2)-(power+1)/2) = con(power:sz(1)-1,power:sz(2)-1);
�
skin.m function skin_mask=skin(R,G,B,Cr,not_skin) % not_skin is hair (and more...)�
%%% �� ���������� ������ �� �������������#� ���# �
%%% A primary mask �skin=(R>=G & G>=B & R>=B*1.1 & R>0.5 & Cr>mean(mean(Cr)) & ~imtop(uint8(Cr),2)); �
skin = (skin & ~not_skin);�
%%% optimize the mask �
se10 = strel('disk', 10); �
skin=imerode(imfill(imdilate(skin,se10),'holes'),se10); % fill in holes�se16 = strel('disk', 16);�
skin_mask=imopen(skin, se16); % delete small forms
eyes.m function eyes_mask=eyes(Cb,Cr,face,hair)
%%% � � ���� ������ �� ��x2=Cb./Cr.*face;�
x2=x2./max(max(x2))*255; % normalize to requested range�
eye1=imtop(uint8(x2),2); % the top 0.5% of x2�eye1 = eye1 & hair; % for eliminate lips etc.�
se10 = strel('disk', 10);�
eyes_mask = imopen(imclose(eye1,se10),se10);
lips8.m function lips_mask=lips(R,G,B,skin,eyes) % color is a vecror�%%% lips.m algorithm with optimisation II�
mask=(skin&~imdilate(eyes,strel('disk', 40)));�
�
%%% basic detection�
)'�
d=1/255;�rltn=mask.*(R+d).*(B+d)./((G+d).^2); % RB/G^2 on the skin�
av=sum(sum(rltn))/sum(sum(mask)); % max cause no-detection beacaus of parasites so we used AVerage�
lips1=imtop(uint8(rltn/(av*2)*255),2); % just 1persent to prevent problem in pics like 4.jpg (red nose)��
%%% optimize the detection�
se5 = strel('disk', 5,0);�lips1=imclose(lips1,se5);�
l_1=strel('line',50,-45); l0=ones(2,50); l1=strel('line',50,45);�
lips_mask = imopen(lips1,l_1) | imopen(lips1,l0) | imopen(lips1,l1);
show_face.m function show_face(image,eyes,lips,width) % calculate and show the face triangle and ellipse�
%%% triangle calculation�
sz=size(eyes);�[x,y]=find(eyes==1);�
[x1,y1]=find(eyes(:,1:mean(y))==1);�
[x2,y2]=find(eyes(:,mean(y):sz(2))==1);�y2=y2+mean(y);�
[x3,y3]=find(lips==1);�
clear x; clear y;�x = [mean(x1) mean(x2) mean(x3)];�
y = [mean(y1) mean(y2) mean(y3)]; �
figure, imshow(image) % show the pic�hold on, plot([y y(1)],[x x(1)],'y','linewidth',width);�
�
%%% triangle calculation and plot�o=[mean(y) mean(x)]; % the central mass of the triangle�
teta=atan2((x(2)-x(1)),(y(2)-y(1))); % rotate angle�
[x,y]=rotate(x,y,-teta,o);�a=y(2)-y(1);�
b=2.1*(x(3)-o(2));�
t=0:pi/50:2*pi;�y=a*cos(t)+y(1)+y(2)-o(1); % Oy=My-(oy-My)�
x=b*sin(t)+o(2)-0.1*b; % Ox=ox-0.1b�
[x,y]=rotate(x,y,teta,o); % rerotate to the original angle�plot(y,x,'y','linewidth',width);
rotate.m function [x,y]=rotate(x,y,teta,o)�
% the form is [x,y]=rotate(x,y,teta,o)�
%�% x,y - form points vectors�
% teta - the rotate angle�
% o - the center of the rotation�%�
Mrot=[cos(teta) -sin(teta); sin(teta) cos(teta)];�
c=Mrot*[y-o(1); x-o(2)]; % multiplication by the rotate matrix�y=c(1,:)+o(1); x=c(2,:)+o(2); % return to the original place
)'$
imtop.m function top_mask=imtop(Gim,p)�
% return the top p% of a gray image.�% NOTE: the image must be normalized to integers in [0:255]�
x=imhist(Gim);�
x(1)=0; % important to not take acount the background�x=cumsum(x);�
T=x(end)*(1-p/100);�
top_mask = x(imadd(Gim,1))>T;
show_mask.m function image=show_mask(image,mask,color,width) % color is a vecror�%%% show the mask on the original image �
Rim=image(:,:,1); Gim=image(:,:,2); Bim=image(:,:,3); �
if (color(1)==max(color)), Rim(mask)=255; % do the transparant mask�elseif (color(2)==max(color)), Gim(mask)=200;�
elseif (color(3)==max(color)), Bim(mask)=220;�
end mask=imdilate(bwperim(mask),strel('disk', width)); % do the conture line�
Rim(mask)=color(1); Gim(mask)=color(2); Bim(mask)=color(3);�
image(:,:,1)=Rim; image(:,:,2)=Gim; image(:,:,3)=Bim;�figure, imshow(image);
�
)'(
(����������!�����
�����������������������.�� �������������������������������������������������������
�� ����������� ������ ����� �� ����� ��� �� ��� ���%��� ��� ������� � �� ���� ��� �������� ���
�����%��������� ������������������������� �����������!�� �Z�"������������� ����������
��������������������������� ��������[20]�������������� ��
�
)'&
�
�
)',
�
�
)'+
�
�
)'-
�
�
)'*
�
�
))'
�
�
)))
�
�
))�
(�%�����������������
Unsupervised Classifying Land Development in High Resolution Multi - Spectral Satellite Photos
Uri Lipowezky, Yoram Furth and Ephraim Luson
Jerusalem College of Technology – Machon Lev, Department of Electronics �
1. Introduction Automatic decipherment of terrain features using satellite photos is difficult problem with a multitude of applications. It was shown in study [3] that different kinds of details in space photos, such as forests, bushes, shadows, meadows, shelter belts etc. could be deciphered with reasonable accuracy inside the specified type of the land development, such as urban, rural, wildness, residential etc. However, the tessellation of a given photo (with possible overlap) into the different types of land development is challenging task, having a lot of applications in the monitoring, thematic maps updating, land use planning and so on. There are two main approaches to the land development type classification. The first of them called down – up, deals with generalization of the results of decipherment, obtaining from the high resolution photos. In other words if there are too many trees in selected test area, it could be supposed that the area belongs to a forest. This approach apparently is not suitable to the purpose of fast and accurate object decipherment and is used mainly in geographical studies. Another approach, called up-down [5] is based on analysis of straight line statistics and suffers from time consuming and low reliability. Recently available high resolution gray scale ICONOS satellite photos, having spatial resolution about 94 cm/pix and coming along with 4 m/pix multi – spectral photos open new perspective towards fast and reliable land development classification. Since multi – spectral photo provides near infra red, red, green, blue and bands (MS-4) a novel approach, exploits relative relationships between the bands, combined with the local information about frequencies distribution is proposed. This approach resembled well-known color locus description technique, widely used in facial features extraction such as human skin, eyes, mouth, hair style and so on [1]. One of the problems to be solved for locus – based approach adaptation to MS-4 satellite photos is the selection of the optimal color space, since space YCrCb, which is used in [1] does not suits well for all types of land development. This problem can be overcome by concerning of every one of land development types. 2. Vegetation Leaf area is one of the most well – studied details in the MS-4 photos. It detection is easily implemented by using the soil and atmosphere resistant vegetation index (Sarvi2), which was introduced in [4]. It is defined as � � � �2 25 1 6 7.5Sarvi I R I R B� � � , where , , ,R G B I are red, green, blue and infra – red band values, normalized
into the interval* +0,1 . The distribution of Sarvi2 over the frame of MS-4 photo can be represented for leaf area as
� � � � � � � �0 02 | , 1 ,v vF Sarvi Leaf N m N m� � � �� � , (1)
where � �21 1
, , exp22
x mN x m �
�� �
� �� �� � �� �� �� �� �is the one – dimensional Gaussian distribution, � �,v vm � are the leaf
area average and standard deviation, � �0 0,m � are the average and standard deviation of non-vegetation objects and �
is the part of the leaf area over the selected region. Reconstruction parameters of (1) i.e., 0 0, , ,v vm m� � and� can be proceeded using decomposition [2] with rough prior value � and the fact that 0vm m for all kinds of vegetation. An example of trees area detection is given in figure 1. 3. Bare soils Bare soil regions such as sand, dry meadows, arable lands and so on could be detected using the indicator � �2sI R G B� � , which usually is high for bare soils. However, decomposition (1) is not good enough in this case and additional homogeneity criterion have to be used. This homogeneity criterion can be constructed as follows
� � � �2 2sH LH HL� � , (2)
where LH and HL and low – high and high – low sub bands of Daubechies 9/7 wavelet transform for scale 1:8. Decomposition of model (1) applies to (2) only inside the region suits to sI criterion. 3. Water pounds Rivers and water open ponds could be detected by using low values of the normalized difference vegetation index
� � � �Ndvi I R I R� � and the fact that water is usually the coolest detail over the scene. Hence, additional
term � �X Z Y , where XYZ are the components of CIE XYZ color space, emphasizes the water pool delineation. Eventually the criterion can be expressed as:
wI R X Z
II R Y
� 4
� ��
, (3)
where positive factors �and 4are chosen as follows. Let us assume that both �and 4are cathetus of a triangle,
having a unit hypotenuse, so sin� 5�andcos4 5�, where* +0, 25 �$. This assumption does not lead to the loss of
))$
generality while the relative value of (3) via model (1) is used. Factors � and 4 are selected so, that expression (3) becomes the most informative i.e. the dispersion of distribution (3) reaches its maximum. The dispersion of (3) can be written down as follows:
� � � � � �2
sin cosr r x xF
D I I I I dF5 5 5, -� � / 0� , (4)
where � � � �rI I R I R� � , F is the bounded area of wI definition, rI and xI are the averages of rI and xI . The integral (4) can be calculated as: � � 2 2 2 2sin sin sin 2r x x yD 5 � 5 � 5 6� � 5� � � , (5)
where r� is the standard deviation of rI , x� is the standard deviation of xI and 6 is the coefficient of correlation
between rI and xI . Dispersion (5) reaches the maximum when 0dD d5 � , so � �2 2 sin 2 2 cos2 0r x r x� � 5 6� � 5 � � .
Eventually, the optimal value 5 can be expressed as: 2 221
2r x
r x
arctg6� �
5� �
� �� � �
� �� �. Substitution 5 into (4), using
sin� 5� and cos4 5� allows decomposing (1) with the initial parameters � �0 0m � , � �0vm � , � �0 0� � , � �0v� � ,
where 0� is the prior probability of the water in the region, � �0 0w wm E I I �, -� &/ 0,
� �1
20 0w wD I I� �, -� &/ 0, � �0v w wm E I I �, -� / 0, � �
12
0v w wD I I� �, -� / 0, � �0wI � is the 0� quantile of the
distribution (3), * +E symbolizes expectation and * +D dispersion. The result of the water detection is represented in figure 1. 4. Conclusion. The proposed method allows fast and reliable detection of the different regions of interest. The detection of water, vegetation and bare soils on MS4 ICONOS photo takes only 30 seconds per 1M pixels using standard Pemtium-4 PC with Intel 800 MHz. processor. The next stage of the accurate decipherment of the precise details such as trees, bushes, shrubs etc. [3] takes only 18 minutes for 1M pixels of BW ICONOS high-resolution photo instead of 1 hour without the prior classification. 5. References [1] Hsu R. L., M. A. Mattaleb and A.K. Jain, (2002) “Joint Face Detection in Color Images”, IEEE Trans. on Pattern Analysis and Machine Intelligence, vol. 24, No. 5. May 2002, pp. 696-706. [2] Lanterman A. D., Grenender U., and M.I. Miller, (2000) “Bayesian Segmentation via Asymptotic Partition Functions”, IEEE Trans. on Pattern Analysis and Machine Intelligence, vol. 22, Nr. 4, April 2000, pp. 337-347. [3] Lipowezky, U., (2002),”Grove Decipherment Using Aerial or Space Photos and Prototype Matching”. Proc. of the 2nd Pattern Recognition for Remote Sensing Workshop (PRRS-2002). Niagara Falls, Canada, August 16, 2002, BMVA Press, ISBN 1 901 725 189, pp. 24-33. [4] Lymburger L., Beggs P.J., and C.R. Jackobson, (2000) “Estimation of Canopy-Average Surface-Specific Leaf Area Using Landsat TM Data”, Photogrammetric Engineering and Remote Sensing, vol. 66, Nr. 2, pp. 183-191. [5] Ünsal C. and K. Boyer, (2002) “Classifying Land Development in High Resolution Satellite Images Using Straight Line Statistics”, Proc. 16th International Conference on Pattern Recognition, Québec, IEEE Press, vol. 1, pp. 127-130.
An example of MS4 ICONOS photo (RGB bands)
Results of the water ponds detection Results of the vegetation detection
Figure1. An example of MS4 ICONOS photo and the results of water and vegetation detection.
))(
(�'�� �������!����������
%������������������������� ������������������������� ������� ������#MATLAB��
������� ������� ��� �� ������ ������� ��� ���� ��� �� �������� ���� ��� ���� #� ����-$������� ����� ��
�������� ��� ��MATLAB R13 6.5����������������������������������� ������������ �#��������
��� ������������ ������������������#Office XP��������
DiskRoot�)���� ��� ����� �������� ��� �� ��������
� ������!Report*.*"� �� ����!*.ppt"� �� �� �� ����IEEEI-23�
!Article*.doc"� ��� ������ ������ ������� ���� ���������
������ ���������������������������.ppt��������������
�������������� ���������������� �������
Study0_MinDistLand_ForEfiProject�2���� ������ ����
�������������������[20]� �����������������������������
���� ������#������������������Minimum Distance� ���� ������
�� �����#�[20]� �� �� �� � �������� ������� �����(� �������2�
RGB���������#������� ������ ���� ��� ���� �Classify.m����
������������������ �����������������������������������
� �� ���������� ��� � ���� ����� �� ����� ����������� ��������
min_dist.m�������� ������������������������������
���� ������� ������ ����� ������� ��������� �� ������ ����
� ���� ���������� ��������� ������ ���� �� �� ����*.mat������� ������� ����� ������� ����� ����
feat5cls.mat������������������������ ��#&���#��������feat7cls.mat����������������� ��������
�������#+������������
�Study1_MinDistFace�2�������������������������������� ����������#��������������������
Minimum Distance� ������������������������ ����������������������������������� �*.jpg���
��������� �����������������*.mat�����������������������������������*2.*���������������� �
�#+���#������������������������� �7.1.2� �� ��������*3.*������������������������������������� �#(�
��#���������
Study2_ModelBuilding�2�������� ���������������������� ����� ���������� ���� �������
������� ��������� ��� ��� ��� � �*.jpg������������������ �*.m� ���������� �������#MATLAB��
*.mat�������������������������������������������#*.tif������� �������������������������%���
� ����HardImages.rar������������������������ �������������������� ������� ��������������������
DiskRoot J KLStudy0_MinDistLand_ForEfiProject J KLStudy1_MinDistFace J KLStudy2_ModelBuilding J KLFinalModel J KLUtils J MLAccessories J KLEfiProject J MLFavorite_Links
���� 83:%���������� ����
))&
� �����_fx� ���_f���������� ��������� ������������ ��� ���� �������7.1.5� �������� ����� ����� ��� �����
_YCrCb� ������� ��� �������� ���������RGB�� ������#CrYCb� ������ ������� �������� �����
���������������Clasify4.m� ��#figure_detect.m��������������������������������������� ����
������� ������� ��� ���� ���� ���� ��������� ������� � � ����� ��������� ����� ������ ������ ���
�������� �� �����Eyes0.m...Eyes6.m��� ����� ������ ��� ������ ������� ������� ��#Eyes.m����� ���
������� ��� ������ ��� ������� ����� ��� ����� ��������� ��� ������ � ��figure_detect.m��� ����
MATLAB� � ���������������������������������������� ���� ������ ����� ����������������
������������ ���8.jpg��������������������������������im_file='8';��
FinalModel�2���� ����� ����� ������� ������� ��������� � � ������������ ��� ����� �������
����� ����� ������� ��� �� ��� ������� ���� %���� ��� ������ � � �%����� �� ���
final_model_4matlabR12.rar������������������������������� ��� ��#MATLAB R12��
Utils�2�������������������������������������%�������������������������������������� �����
�������#MATLAB���
Accessories�2������� ������ ������%����� ��������� ��� ����� ������ �������� ������� �� ����� ���
��� ������ ������ ��������� ������������������������Canny� ������ ������������� ������ ��� � ���
����������������������%������������ #�������������������� EfiProject�������������������[20]�
��������������������%������������
)),
Abstract�Novel algorithms for facial features Detection are developed in EZface Ltd, in order to
allow applying a virtual makeup system. The detection has to be very accurate, and it is
difficult to be performed within reasonable execution time. Therefore, the Algorithms
developing in EZface are a trade-off type between accuracy and time-consuming. This project
proposes a novel approach toward initial fast and generic facial features detections, in order to
be integrated into the pre-processing EZface Algorithms stages, and so to speed up and
increase the efficiency.
At the first stage the proposed algorithm detects the different categories exploiting
special color features, by using both RGB and YCrCb color spaces only, and special
technique that has been developed. At the second stage the algorithm combines the latter with
textural features to eliminate hair and other objects having similar colors. At the last stage
morphological tools are used in order to improve the segmentations accuracy. Besides, is
computed and delineated the face oval based on the face triangle. Unlike much studies, this
work deals with textural detection problems as well, using its combination with color features
such as blond hair, red details of wear and background and so on.
The study is implemented in MATLAB environment, it shows good results on set of
various images (about fifty), and has satisfying performance time (few seconds). The results
of the project could be extended in multitude aspects such as air and satellite photos
classifications and decipherment, medical image processing and so forth. The results are using
now in EZface Ltd for face detection algorithms and some of them are going to be published
in IEEEI-23 conference.