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

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

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