⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 clsfacedetectionwrapper.cpp

📁 face detection Face detection can be regarded as a more general case of face localization In face
💻 CPP
字号:
#include ".\clsfacedetectionwrapper.h"
#using <mscorlib.dll>


clsFaceDetectionWrapper::clsFaceDetectionWrapper(void)
{
	faceLocator = new FaceLocator();		
}

clsFaceDetectionWrapper::~clsFaceDetectionWrapper(void)
{
	delete faceLocator;
}

int clsFaceDetectionWrapper::WrapDetectFaces(System::Drawing::Bitmap* Image)
{
	//convert from Managed Image to IplImage
	 
	IplImage* ImageData = cvCreateImage(cvSize(Image->Width,Image->Height),8,1);
	int i=0;
	for (int y=0;y<Image->Height;y++)
	{
		for (int x=0;x<Image->Width;x++)
		{	    
			//ARGB cahnnel
			ImageData->imageData[i++] =(char)Image->GetPixel(x,y).ToArgb();						
		}
	}	

	return faceLocator->DetectFaces(ImageData);
}

int clsFaceDetectionWrapper::WrapGetFaceCordinates(int index, int &lx, int &ly, int &rx, int &ry)
{
	return faceLocator->GetFaceCordinates(index, lx, ly, rx, ry);
}

int clsFaceDetectionWrapper::WrapGetEyeCordinates(int index, int &lx, int &ly, int &rx, int &ry)
{
	return faceLocator->GetEyeCordinates(index, lx, ly, rx, ry);
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -