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

mpisearch/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(){
00008         m_Detector.setPixelMax(2560);
00009 }    // Constructor
00010 FilterInterface::~FilterInterface(){}   // Destructor
00011 
00012 // ================================================================
00013 
00014 int FilterInterface::runInterface(BYTE *pData, int imgWidth, int imgHeight)
00015 {
00016         static int lastimgWidth = 0, lastimgHeight = 0;
00017         if (imgWidth != lastimgWidth || imgHeight != lastimgHeight) {
00018                 m_pixels.setSize(imgWidth, imgHeight);
00019                 lastimgWidth = imgWidth;
00020                 lastimgHeight = imgHeight;
00021         }
00022 
00023         // convert image to grayscale and out of directshow coordinates
00024         GreyScaleFlipVideo(imgWidth, imgHeight, (RGBTRIPLE *)pData, m_pixels);
00025 
00026         m_Detector.search(m_pixels, m_faces);
00027         m_faces.simplify(0.2f);
00028 
00029         if (m_faces.size()) {
00030                 m_failedCycles = 0;
00031                 m_failedSearch = false;
00032                 m_lastFace = m_faces;
00033         }
00034         else m_failedSearch = true;     
00035 
00036         m_faces.clear();
00037 
00038         return 0;
00039 }
00040 
00041 // ================================================================
00042 
00043 void FilterInterface::printFrame(RGBTRIPLE *prgb, int cxImage, int cyImage) {
00044                 DrawBoxes(prgb, cxImage, cyImage);
00045                 m_failedCycles++;
00046 }
00047 
00048 // ================================================================

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