Статья: Реализация метода главных компонент с помощью библиотеки OpenCV

cvLoadImage = (IplImage*(__stdcall *)( const char* filename, int iscolor))GetProcAddress(highgui, "cvLoadImage");

if (!cvLoadImage) return;

cvSaveImage = (int(__stdcall *)( const char* filename, const CvArr* image))GetProcAddress(highgui, "cvSaveImage");

if (!cvSaveImage) return;

cvNamedWindow = (int(__stdcall *)( const char* name, int flags ))GetProcAddress(highgui, "cvNamedWindow");

if (!cvNamedWindow) return;

cvShowImage = (void(__stdcall *)( const char* name, const CvArr* image ))GetProcAddress(highgui, "cvShowImage");

if (!cvShowImage) return;

cv = LoadLibrary("cxcore100.dll");

if (!cv) return;

cvCreateImage_ = (IplImage*(__stdcall *)( CvSize size, int depth, int channels ))GetProcAddress(cv, "cvCreateImage");

if (!cvCreateImage_) return;

cvDotProduct_ = (double(__stdcall *)( const CvArr* src1, const CvArr* src2))GetProcAddress(cv, "cvDotProduct");

if (!cvDotProduct_) return;

cvMul_ = (void(__stdcall *)( const CvArr* src1, const CvArr* src2, CvArr* dst, double scale=1))GetProcAddress(cv, "cvMul");

if (!cvMul_) return;

cvaux = LoadLibrary("cv100.dll");

if (!cvaux) return;

cvThreshold_ = (void(__stdcall *)(const CvArr* src, CvArr* dst, double threshold,double max_value, int threshold_type))GetProcAddress(cvaux, "cvThreshold");

if (!cvThreshold_) return;

Objs=new IplImage*[obj_number];

Objs[0] = cvLoadImage( ".\\et\\1.bmp", 0);

show_im(Image1->Canvas,Objs[0]);

Objs[1] = cvLoadImage( ".\\et\\2.bmp", 0);

show_im(Image2->Canvas,Objs[1]);

Objs[2] = cvLoadImage( ".\\et\\3.bmp", 0);

show_im(Image3->Canvas,Objs[2]);

String fname="6.bmp";

Object = cvLoadImage((".\\in\\"+fname).c_str(), 0);

К-во Просмотров: 336
Бесплатно скачать Статья: Реализация метода главных компонент с помощью библиотеки OpenCV