The Machine Perception Toolbox

[Introduction]- [News]- [Download]- [Screenshots]- [Manual (pdf)]- [Forums]- [API Reference]- [Repository ]

 

Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Namespace Members | Class Members | File Members | Related Pages

eyefinder/windows/FilterSrc/FilterInterface.cpp

Go to the documentation of this file.
00001 #include <streams.h>
00002 #include <ctime>
00003 
00004 #include "FilterInterface.h"
00005 
00006 
00007 FilterInterface::FilterInterface()  // Constructor
00008 {
00009         m_eyefinder = new MPEyeFinderBinary();
00010         m_eyefinder->setPixelMax(2560);
00011 }   
00012 
00013 FilterInterface::~FilterInterface()
00014 {
00015         delete m_eyefinder;
00016 }       // Destructor
00017 
00018 // ================================================================
00019 
00020 int FilterInterface::runInterface(BYTE *pData, int imgWidth, int imgHeight)
00021 {
00022         static int lastimgWidth = 0, lastimgHeight = 0;
00023         if (imgWidth != lastimgWidth || imgHeight != lastimgHeight) {
00024                 m_eyefinder->initStream(imgWidth, imgHeight);
00025                 m_pixels.setSize(imgWidth, imgHeight);
00026                 lastimgWidth = imgWidth;
00027                 lastimgHeight = imgHeight;
00028         }
00029 
00030         // convert image to grayscale and out of directshow coordinates
00031         GreyScaleFlipVideo(imgWidth, imgHeight, (RGBTRIPLE *)pData, m_pixels);
00032 
00033         m_eyefinder->findEyes(m_pixels, m_faces, 1.25, wt_avg);
00034 
00035         if (m_faces.size()) {
00036                 m_failedCycles = 0;
00037                 m_failedSearch = false;
00038                 m_lastFace = m_faces;
00039         }
00040         else m_failedSearch = true;
00041         
00042 
00043         return 0;
00044 }
00045 
00046 // ================================================================
00047 
00048 void FilterInterface::printFrame(RGBTRIPLE *prgb, int cxImage, int cyImage) {
00049                 DrawBoxes(prgb, cxImage, cyImage);
00050                 m_failedCycles++;
00051 }
00052 
00053 // ================================================================

Generated on Mon Nov 8 17:07:34 2004 for MPT by  doxygen 1.3.9.1