Thank you for your quick response. As I understand, these 2 files, viola_24x24, and jesen_24x24, are face databse in gray scale. Matrix x is face image, and y is idicator whether or not it's a posotive or negative. Am I right?
For increasing efficient of detection, I'd read some papers, one of them is:
Joint Haar-like Features for Face Detection
The paper above is introduce some extend Haar-like feature to improve efficience of detection. So, I wonder where you define Haar-like feature, and how you define them.
Your code is very great. I learn a lot from your code. Regard to training haar detector, as I understood, before running train_cascade, we have to have 2 matrix: jensen_24x24 and viola_24x24 for detecting face. However, in my project, I intend to detect user's eyes, not the face. Could you please give me a hint how to create the matrix for training Haar detector? For more detail, I don't know how to create Xpos matrix for detecting eye:
Xpos = X(: , : , find(y == 1));
Xpos = cat(3 , Xpos , X(: , : , find(y == 1)));