Click here to Skip to main content
15,881,802 members
Articles / Desktop Programming / MFC

Face Detection C++ Library with Skin and Motion Analysis

Rate me:
Please Sign up or sign in to vote.
4.92/5 (242 votes)
16 Jan 2008GPL319 min read 1.1M   70.8K   744  
The article demonstrates face detection SSE optimized C++ library for color and gray scale data with skin detection, motion estimation for faster processing, small sized SVM and NN rough face prefiltering, PCA/LDA/ICA/any dimensionality reduction/projection and final NN classification

#ifndef MotionDetector_h
#define MotionDetector_h


class vec2D;
class vec2Dc;
class FaceDetector;


class MotionDetector
{
public:
        MotionDetector();
        //MotionDetector(const MotionDetector& md);
        ~MotionDetector();

// Operators
        //const MotionDetector& operator=(const MotionDetector& md);
        void init(unsigned int image_width, unsigned int image_height);
        void close();

        const vec2Dc* detect(const vec2D* frame, const FaceDetector* fdetect);        //frame 0...255
        void clear_last_frame();

// Operations
// Access
        inline int status() const;
        inline const vec2Dc* get_motion_vector() const;
        inline float threshold() const;
        inline void threshold(float th);


// Inquiry

protected:
private:
        MotionDetector(const MotionDetector& md);
        const MotionDetector& operator=(const MotionDetector& md);

        int m_status;
        vec2D* m_last_frame;
        vec2Dc* m_motion_vector;
        float m_TH;

};

// Inlines
inline int MotionDetector::status() const
{
        return m_status;
}

inline const vec2Dc* MotionDetector::get_motion_vector() const
{
        return m_motion_vector;
}

inline float MotionDetector::threshold() const
{
        return m_TH;
}

inline void MotionDetector::threshold(float th)
{
        if (th < 0.0f)
                th = 0.0f;
        if (th > 255.0f)
                th = 255.0f;
        m_TH = th;
}

#endif MotionDetector_h

By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.

If a file you wish to view isn't highlighted, and is a text file (not binary), please let us know and we'll add colourisation support for it.

License

This article, along with any associated source code and files, is licensed under The GNU General Public License (GPLv3)


Written By
Engineer
Russian Federation Russian Federation
Highly skilled Engineer with 14 years of experience in academia, R&D and commercial product development supporting full software life-cycle from idea to implementation and further support. During my academic career I was able to succeed in MIT Computers in Cardiology 2006 international challenge, as a R&D and SW engineer gain CodeProject MVP, find algorithmic solutions to quickly resolve tough customer problems to pass product requirements in tight deadlines. My key areas of expertise involve Object-Oriented
Analysis and Design OOAD, OOP, machine learning, natural language processing, face recognition, computer vision and image processing, wavelet analysis, digital signal processing in cardiology.

Comments and Discussions