kasi kapag natapat po ng picture na galing sa cellphone o kaya picture na may mukha nung tao narerecognize po
You mean nade-detect, hindi nare-recognize. Remember, detection is different from recognition in our context.
Ibig sabihin nun gumagana yung face detection algorithm. Kahit mag draw ka ng mukha ng tao sa papel at ilagay mo sa harap ng camera madedetect pa rin yan.
Sa OpenCV yung primary algorithm na ginagamit sa pag detect is Haar Cascades classifier.
Basic idea is you have a separate trainer program that you feed with positive and negative images. Positive: images na may mukha ng tao. Negative: images na walang mukha ng tao. Number of positive images must be more than negative images. Preferably 2x more. The result is then saved to a file.
Then yung classifier you will feed it input from a different source-- a video camera for instance, it will scan each frame beginning upper-left corner of the image with 20x20 bounded square pixels at a time until it reaches the lower-right of the image.
Habang nags-scan, hinahanap nya yung features na nagmamatch sa images na na-train. One feature na nags-stand out sa mukha ng tao are the eyes. Yung mata are usually darker in color compared to the bridge of our nose or compared to forehead or cheeks. So yung algorithm kapag ang mata nasa loob ng 20x20 window, it will know that there is a match. It will then try to match that frame with other features in the training set, gaya halimbawa ng shape ng mukha, or lapad ng forehead, lips, nose, etc. Remember, mukha ang target dito so lahat ng features ng mukha ng tao kasama sa positive training set.
Face detection is actually the easy part because you almost always get accurate results basta ba magandang quality ng training sets mo, compared to face recognition where it uses a different algorithm like those I mentioned in my previous post.
Go to OpenCV's website meron silang mga overview ng algorithm. If you want to go deeper with face recognition and meron access ang school mo sa IEEE/IET Electronic Library or Association of Computing Machinery (ACM), you should log on there. There you'll find dozens of peer-reviewed publications/journals related to Computer Vision.