亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? condens.cpp

?? 微軟的基于HMM的人臉識別原代碼, 非常經典的說
?? CPP
?? 第 1 頁 / 共 2 頁
字號:
/*M///////////////////////////////////////////////////////////////////////////////////////
//
//  IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING.
//
//  By downloading, copying, installing or using the software you agree to this license.
//  If you do not agree to this license, do not download, install,
//  copy or use the software.
//
//
//                        Intel License Agreement
//                For Open Source Computer Vision Library
//
// Copyright (C) 2000, Intel Corporation, all rights reserved.
// Third party copyrights are property of their respective owners.
//
// Redistribution and use in source and binary forms, with or without modification,
// are permitted provided that the following conditions are met:
//
//   * Redistribution's of source code must retain the above copyright notice,
//     this list of conditions and the following disclaimer.
//
//   * Redistribution's in binary form must reproduce the above copyright notice,
//     this list of conditions and the following disclaimer in the documentation
//     and/or other materials provided with the distribution.
//
//   * The name of Intel Corporation may not be used to endorse or promote products
//     derived from this software without specific prior written permission.
//
// This software is provided by the copyright holders and contributors "as is" and
// any express or implied warranties, including, but not limited to, the implied
// warranties of merchantability and fitness for a particular purpose are disclaimed.
// In no event shall the Intel Corporation or contributors be liable for any direct,
// indirect, incidental, special, exemplary, or consequential damages
// (including, but not limited to, procurement of substitute goods or services;
// loss of use, data, or profits; or business interruption) however caused
// and on any theory of liability, whether in contract, strict liability,
// or tort (including negligence or otherwise) arising in any way out of
// the use of this software, even if advised of the possibility of such damage.
//
//M*/
#include <windows.h>
#include <streams.h>
#include <initguid.h>
#include <olectl.h>
#if (1100 > _MSC_VER)
#include <olectlid.h>
#endif
#include "iCondens.h"
#include "Condensprop.h"
#include "Condens.h"
#include "Condensuids.h"


// setup data
const AMOVIESETUP_MEDIATYPE sudPinTypes =
{
    &MEDIATYPE_Video,       // Major type
    &MEDIASUBTYPE_NULL      // Minor type
};

const AMOVIESETUP_PIN psudPins[] =
{
    {
        L"Input",           // String pin name
        FALSE,              // Is it rendered
        FALSE,              // Is it an output
        FALSE,              // Allowed none
        FALSE,              // Allowed many
        &CLSID_NULL,        // Connects to filter
        L"Output",          // Connects to pin
        1,                  // Number of types
        &sudPinTypes },     // The pin details
      { L"Output",          // String pin name
        FALSE,              // Is it rendered
        TRUE,               // Is it an output
        FALSE,              // Allowed none
        FALSE,              // Allowed many
        &CLSID_NULL,        // Connects to filter
        L"Input",           // Connects to pin
        1,                  // Number of types
        &sudPinTypes        // The pin details
    }
};


const AMOVIESETUP_FILTER sudCCondens =
{
    &CLSID_CCondens,        // Filter CLSID
    L"Condens",                    // Filter name
    MERIT_DO_NOT_USE,               // Its merit
    2,                              // Number of pins
    psudPins                        // Pin details
};


// List of class IDs and creator functions for the class factory. This
// provides the link between the OLE entry point in the DLL and an object
// being created. The class factory will call the static CreateInstance

CFactoryTemplate g_Templates[2] = {

    { L"Condens"
    , &CLSID_CCondens
    , CCondens::CreateInstance
    , NULL
    , &sudCCondens }
  ,
    { L"Condens Property Page"
    , &CLSID_CCondensPropertyPage
    , CCondensProperties::CreateInstance }
};
int g_cTemplates = sizeof(g_Templates) / sizeof(g_Templates[0]);



//
// Constructor
//
CCondens::CCondens(TCHAR *tszName,LPUNKNOWN punk,HRESULT *phr) :
    CTransInPlaceFilter(tszName, punk, CLSID_CCondens,phr)    
   
{
    m_params.nSamples = 64;
    m_params.x = 0.4f; 
    m_params.y = 0.3f;
    m_params.width = 0.2f;
    m_params.height = 0.3f;

    m_params.Smin = 20;
    m_params.Vmin = 40;
    m_params.view = 0;

    m_Indicat1.x = 0; 
    m_Indicat1.y = 0;
    m_Indicat1.width = 100;
    m_Indicat1.height = 60;
    IsTracking = false;
    IsInit =false;
    ConDens=cvCreateConDensation(4,4,m_params.nSamples);
    CvMat Dyn = cvMat(4,4,CV_MAT4x4_32F,ConDens->DynamMatr);
    cvmSetIdentity(&Dyn);
    cvmSet(&Dyn,0,1,0.9);
    cvmSet(&Dyn,2,3,0.9);
    ASSERT(tszName);
    ASSERT(phr);
} // CCondens
CCondens::~CCondens()
{
    cvReleaseConDensation(&ConDens);
} // ~CCondens


//
// CreateInstance
//
// Provide the way for COM to create a CCondens object
//
CUnknown * WINAPI CCondens::CreateInstance(LPUNKNOWN punk, HRESULT *phr) {

    CCondens *pNewObject = new CCondens(NAME("Condens"), punk, phr);
    if (pNewObject == NULL) {
        *phr = E_OUTOFMEMORY;
    }
    return pNewObject;

} // CreateInstance


//
// NonDelegatingQueryInterface
//
// Reveals ICCondens and ISpecifyPropertyPages
//
STDMETHODIMP CCondens::NonDelegatingQueryInterface(REFIID riid, void **ppv)
{
    CheckPointer(ppv,E_POINTER);

    if (riid == IID_ICCondens) {
        return GetInterface((ICCondens *) this, ppv);
    } else if (riid == IID_ISpecifyPropertyPages) {
        return GetInterface((ISpecifyPropertyPages *) this, ppv);
    } else {
        return CTransInPlaceFilter::NonDelegatingQueryInterface(riid, ppv);
    }

} // NonDelegatingQueryInterface



void  CCondens::ApplyCamShift( CvImage* image, bool initialize )
{
    CvSize size;
    int bins = 20;

    m_cCamShift.set_hist_dims( 1, &bins );
    m_cCamShift.set_thresh( 0, 1, 180 );
    m_cCamShift.set_min_ch_val( 1, m_params.Smin );
    m_cCamShift.set_max_ch_val( 1, 255 );
    m_cCamShift.set_min_ch_val( 2, m_params.Vmin );
    m_cCamShift.set_max_ch_val( 2, 255 );
    
    cvGetImageRawData( image, 0, 0, &size );
	
    if( m_object.x > size.width - m_object.width - 1 )
        m_object.x = size.width - m_object.width - 1;
	if( m_object.x < 0 ) m_object.x = 0;
    
    if( m_object.y > size.height - m_object.height - 1 )
        m_object.y = size.height - m_object.height - 1;
	if( m_object.y < 0 ) m_object.y = 0;
    m_cCamShift.set_window(m_object);
    
    if( initialize )
    {
        m_cCamShift.reset_histogram();
        m_cCamShift.update_histogram( image );
    }

    m_cCamShift.track_object( image );
    m_object = m_cCamShift.get_window();

    LBound[0] = (float)m_object.x;
    LBound[1] = (float)-m_object.width*0.5f;
    LBound[2] = (float)m_object.y;
    LBound[3] = (float)- m_object.height*0.5f;
    UBound[0] = (float)m_object.x + m_object.width;
    UBound[1] = (float)m_object.width*0.5f;
    UBound[2] = (float)m_object.y + m_object.height;
    UBound[3] = (float)m_object.height*0.5f;
    Measurement[0] = (float)m_object.x+m_object.width*0.5f;
    Measurement[1] = initialize ? 0 : (float)(Measurement[0] - m_Old.x);
    Measurement[2] = (float)m_object.y+m_object.height*0.5f;
    Measurement[3] = initialize ? 0 : (float)(Measurement[2] - m_Old.y);
    m_Old.x = cvRound( Measurement[0] );
    m_Old.y = cvRound( Measurement[2] );
    if( initialize )
    {
        CvMat LB = cvMat(4,1,CV_MAT4x1_32F,LBound);
        CvMat UB = cvMat(4,1,CV_MAT4x1_32F,UBound);
        cvConDensInitSampleSet(ConDens,&LB,&UB);
    }
    XCor = 1.5f/m_object.width;
    VXCor = 3.0f/m_object.width;
    YCor = 1.5f/m_object.height;
    VYCor = 3.0f/m_object.height;
    CondProbDens(ConDens,Measurement);

    m_Old.x = cvRound( Measurement[0] );
    m_Old.y = cvRound( Measurement[2] );
}


void  CCondens::CheckBackProject( CvImage* image )
{
    if( m_params.view != 0 )
    {
        IplImage* src = m_cCamShift.get_back_project();
        if( src && src->imageData && image )
        {
            iplGrayToColor( src, image, 0, 0, 0 );
        }
    }
}


//
// Transform
// Transform the  sample 'in place'
//
HRESULT CCondens::Transform(IMediaSample *pSample)
{
	BYTE*   pData;
    CvImage image;

	IplImage* image2;    //ianni  <======

	pSample->GetPointer(&pData);

    AM_MEDIA_TYPE* pType = &m_pInput->CurrentMediaType();
    VIDEOINFOHEADER *pvi = (VIDEOINFOHEADER *) pType->pbFormat;

    // Get the image properties from the BITMAPINFOHEADER
    CvSize size = cvSize( pvi->bmiHeader.biWidth, pvi->bmiHeader.biHeight );
    int stride = (size.width * 3 + 3) & -4;

	image2=cvCreateImage(cvSize(100,100),IPL_DEPTH_8U, 3);  //ianni <========
	cvReleaseImage(&image2); //ianni <===========
        
    cvInitImageHeader( &image, size, IPL_DEPTH_8U, 3, IPL_ORIGIN_TL, 4, 1 );
    cvSetImageData( &image, pData,stride );

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
国产一区二区0| 久久成人av少妇免费| 一区二区日韩av| 日本一不卡视频| 国产精品久久久久桃色tv| 日日夜夜精品视频免费| 国产原创一区二区三区| 色爱区综合激月婷婷| 精品成人在线观看| 一区二区三区在线视频播放| 琪琪久久久久日韩精品| 91在线国产观看| 日韩欧美卡一卡二| 亚洲免费观看高清| 亚洲一区二区三区四区在线观看 | 91女厕偷拍女厕偷拍高清| 欧美人狂配大交3d怪物一区 | 欧美亚洲日本国产| 久久精品夜色噜噜亚洲a∨| 精品一区二区三区免费毛片爱| 一区二区三区在线影院| 国产一区二区三区久久久| 欧美自拍偷拍午夜视频| 国产精品入口麻豆原神| 日韩精品一级二级 | 午夜久久久久久电影| 99re成人精品视频| 亚洲图片激情小说| 成人教育av在线| 中文字幕亚洲区| jlzzjlzz亚洲女人18| 国产精品久久久久久久久久久免费看| 国产一区二区在线影院| 久久免费电影网| 国产精品性做久久久久久| 精品国产伦理网| 精品亚洲免费视频| 国产三级精品三级| 不卡一区二区在线| 亚洲欧美一区二区不卡| 97精品久久久午夜一区二区三区| 国产精品久久久久7777按摩| 97精品久久久久中文字幕 | 中文在线免费一区三区高中清不卡| 麻豆国产精品视频| 久久九九久久九九| 成人黄页在线观看| 亚洲精品日日夜夜| 日韩亚洲欧美高清| 国产福利一区二区| 亚洲精品视频自拍| 欧美丰满少妇xxxbbb| 久久国产乱子精品免费女| 欧美国产精品久久| 91热门视频在线观看| 石原莉奈一区二区三区在线观看| 欧美一区在线视频| 国产综合久久久久久久久久久久| 国产亚洲成aⅴ人片在线观看| 国产成人福利片| 一区二区三区免费网站| 欧美一区二区高清| 国产剧情一区在线| 一区二区三区四区不卡在线| 欧美一卡二卡在线观看| 成人av在线资源网站| 亚洲国产一二三| 国产亚洲欧美日韩在线一区| 欧美日韩一区视频| 免费成人美女在线观看| 日韩欧美在线观看一区二区三区| 日韩免费看的电影| 久久久久久99久久久精品网站| 婷婷综合久久一区二区三区| 精品国一区二区三区| 国产激情视频一区二区在线观看| ●精品国产综合乱码久久久久| 国产成人丝袜美腿| 美国av一区二区| 日韩一区在线免费观看| 欧美亚洲动漫另类| 久久精品国产精品亚洲综合| 中文字幕一区二区三区在线观看 | 亚洲在线视频免费观看| 久久新电视剧免费观看| 欧美日韩另类国产亚洲欧美一级| 国产自产2019最新不卡| 午夜精品久久久久久久99水蜜桃| 亚洲国产成人一区二区三区| 欧美人妖巨大在线| 一本久久a久久免费精品不卡| 久久99久久久久久久久久久| 亚洲电影你懂得| 成人欧美一区二区三区1314| 久久综合色天天久久综合图片| 在线观看欧美日本| 成人动漫中文字幕| 国产精品综合av一区二区国产馆| 日本欧美一区二区三区| 亚洲国产另类精品专区| 亚洲视频免费看| 国产蜜臀av在线一区二区三区| 制服丝袜亚洲色图| 欧美久久一二三四区| 欧美日韩另类一区| 欧美视频在线播放| 色88888久久久久久影院按摩| 成人毛片老司机大片| 久久精品国产亚洲高清剧情介绍| 亚洲一区二区三区视频在线播放| 国产精品高潮久久久久无| 久久精品水蜜桃av综合天堂| 日韩欧美综合一区| 欧美一区二区性放荡片| 日韩午夜激情免费电影| 欧美日韩欧美一区二区| 欧美视频你懂的| 欧美偷拍一区二区| 欧美日韩精品一区二区天天拍小说| 91麻豆国产自产在线观看| 99久久久免费精品国产一区二区| 国产不卡视频一区二区三区| 成人免费视频caoporn| 91女厕偷拍女厕偷拍高清| 色噜噜夜夜夜综合网| 91黄色免费版| 欧美日韩成人综合| 在线不卡一区二区| 日韩午夜在线观看视频| 国产日韩欧美高清| 1000精品久久久久久久久| 1区2区3区精品视频| 一区二区成人在线视频| 亚洲国产精品天堂| 久久精品国产成人一区二区三区| 精品一区二区三区免费毛片爱| 国产福利精品导航| av一区二区三区| 色哟哟精品一区| 欧美日韩中文字幕一区| 日韩免费高清av| 久久久国产精品不卡| 中文字幕不卡在线观看| 亚洲精品乱码久久久久久| 一区二区三区成人在线视频| 日韩精品成人一区二区在线| 国产美女久久久久| 色综合久久久久久久久| 69堂精品视频| 久久久久久久久久久黄色| 国产精品亲子伦对白| 亚洲图片欧美色图| 国产成+人+日韩+欧美+亚洲| 欧美图区在线视频| 国产日韩欧美亚洲| 午夜电影一区二区| 国产乱人伦偷精品视频不卡| 91久久精品午夜一区二区| 日韩一卡二卡三卡四卡| 中文字幕一区二区视频| 免费人成黄页网站在线一区二区| 成人毛片视频在线观看| 欧美日本一区二区| 国产精品毛片大码女人| 日日夜夜一区二区| 福利91精品一区二区三区| 日韩久久久精品| 成人免费一区二区三区视频| 久久精品噜噜噜成人88aⅴ| 91麻豆免费看片| 国产视频一区在线播放| 人人狠狠综合久久亚洲| 在线视频一区二区三区| 国产亚洲一区二区在线观看| 亚洲va欧美va人人爽| 91同城在线观看| 国产欧美视频在线观看| 蜜臀av一区二区| 777奇米成人网| 亚洲一区二区3| 91蝌蚪porny九色| 国产精品美女视频| 国产精品一级黄| 欧美精品一区二区三| 青青草97国产精品免费观看 | 欧美激情一区二区三区不卡| 捆绑调教一区二区三区| 538prom精品视频线放| 一区二区三区国产精品| 99re成人在线| 亚洲三级免费电影| 懂色av一区二区在线播放| 精品国产乱码久久久久久牛牛 | 国产婷婷一区二区| 韩国一区二区视频| 日韩欧美另类在线| 久久精品999| 久久免费电影网| 国产69精品久久久久毛片| 国产亚洲一区二区在线观看|