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

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關(guān)于我們
? 蟲蟲下載站

?? condens.cpp

?? 微軟的基于HMM的人臉識(shí)別原代碼, 非常經(jīng)典的說
?? CPP
?? 第 1 頁 / 共 2 頁
字號(hào):
/*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 );

?? 快捷鍵說明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號(hào) Ctrl + =
減小字號(hào) Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
日本精品一区二区三区高清 | 国产一区二区成人久久免费影院 | 7777精品伊人久久久大香线蕉完整版| av一区二区久久| av一区二区不卡| 成人黄色综合网站| 国产99久久久国产精品潘金网站| 国产在线日韩欧美| 韩国成人在线视频| 国产米奇在线777精品观看| 国产一区二区久久| 国产精品18久久久久久久网站| 经典三级视频一区| 国产电影精品久久禁18| 高清国产一区二区三区| 波多野结衣精品在线| av在线播放一区二区三区| 色综合天天综合网国产成人综合天| 91在线视频观看| 欧亚洲嫩模精品一区三区| 欧美日韩一区三区| 日韩精品中文字幕一区 | 麻豆国产91在线播放| 久久99精品久久久久久久久久久久| 久久精品国产澳门| 国产精品123| eeuss鲁片一区二区三区在线观看| 99精品黄色片免费大全| 欧美三级蜜桃2在线观看| 日韩欧美国产电影| 中文字幕第一区| 亚洲一区二区视频| 久久99在线观看| www.性欧美| 欧美日本不卡视频| 久久蜜桃av一区精品变态类天堂 | 成人av电影免费观看| 色婷婷综合久色| 在线成人午夜影院| 精品国产乱码久久久久久图片| 久久久精品免费网站| 日韩美女视频19| 日韩高清在线观看| 国产成人亚洲综合a∨婷婷图片| 色综合久久久久网| 日韩一区二区三区观看| 国产精品美女一区二区三区| 一区二区三区久久| 国产一区二区三区高清播放| 色综合天天在线| 欧美mv日韩mv国产网站| 亚洲视频 欧洲视频| 麻豆精品视频在线观看视频| 99国产精品国产精品久久| 日韩一区二区三区四区五区六区| 欧美激情一区不卡| 日韩和欧美一区二区三区| 国产suv精品一区二区6| 51久久夜色精品国产麻豆| 国产精品久久久久久妇女6080| 青草国产精品久久久久久| 91在线看国产| 久久精品夜色噜噜亚洲aⅴ| 亚洲v日本v欧美v久久精品| 国产·精品毛片| 91精品国产日韩91久久久久久| 国产精品大尺度| 激情文学综合网| 欧美巨大另类极品videosbest| 国产精品美女久久久久久久久 | 成人黄色av电影| 日韩午夜精品视频| 亚洲国产成人av网| 不卡av在线免费观看| 精品国产一区二区三区久久久蜜月| 亚洲自拍另类综合| aaa欧美大片| 久久精品网站免费观看| 日本午夜一本久久久综合| 色综合久久综合网| 欧美激情一区二区在线| 久久国产尿小便嘘嘘| 欧美少妇bbb| 亚洲欧洲中文日韩久久av乱码| 国产精品亚洲第一| 欧美大片一区二区三区| 午夜欧美在线一二页| 欧美在线免费观看亚洲| 综合久久国产九一剧情麻豆| 高潮精品一区videoshd| 久久综合狠狠综合久久综合88| 日韩高清中文字幕一区| 欧美日韩一区中文字幕| 亚洲综合男人的天堂| 91在线免费播放| 成人欧美一区二区三区在线播放| 高清在线成人网| 久久蜜臀精品av| 国产精品性做久久久久久| 久久久久成人黄色影片| 国产精品综合一区二区| 久久久久久亚洲综合影院红桃| 蜜桃免费网站一区二区三区| 欧美丰满少妇xxxbbb| 日本aⅴ精品一区二区三区| 欧美高清视频一二三区 | 久久99国产精品成人| 日韩视频中午一区| 麻豆成人久久精品二区三区小说| 欧美一区二区三区四区在线观看| 七七婷婷婷婷精品国产| 日韩亚洲欧美在线| 久久99精品国产.久久久久久| 精品播放一区二区| 国产一区二区三区在线看麻豆 | 免费成人性网站| 欧美变态口味重另类| 国产一区二区三区免费观看| 国产欧美精品一区二区色综合朱莉| 国产经典欧美精品| 亚洲国产精品成人久久综合一区| 成人小视频免费观看| 亚洲美女精品一区| 欧美日韩久久不卡| 青草国产精品久久久久久| 精品国产乱码久久久久久久久| 精品一区二区国语对白| 中文字幕高清一区| 日本福利一区二区| 免费观看成人鲁鲁鲁鲁鲁视频| 久久一区二区三区四区| 成人国产精品免费观看动漫| 亚洲日本韩国一区| 91精品国产乱码| 国产成人精品一区二区三区四区| 国产精品久久久久久久久快鸭| 欧美性生活久久| 久久电影网电视剧免费观看| 日本一区二区三区在线不卡| 色婷婷亚洲婷婷| 蜜臀va亚洲va欧美va天堂| 国产喂奶挤奶一区二区三区| 99精品热视频| 日本三级亚洲精品| 中文字幕乱码久久午夜不卡| 欧洲精品一区二区三区在线观看| 日韩高清不卡一区二区三区| 国产亚洲成aⅴ人片在线观看| 色婷婷久久久综合中文字幕| 六月丁香婷婷久久| 成人欧美一区二区三区1314| 5月丁香婷婷综合| 99在线热播精品免费| 日韩成人av影视| 国产精品理伦片| 日韩欧美中文一区| 99精品国产99久久久久久白柏| 首页国产欧美久久| 国产精品乱码一区二区三区软件| 欧美男人的天堂一二区| 成人激情免费电影网址| 秋霞影院一区二区| 亚洲黄色小视频| 久久夜色精品国产噜噜av| 欧美日韩中文精品| 成人精品一区二区三区四区| 免费不卡在线观看| 一区二区三区91| 中文av一区特黄| 日韩欧美激情在线| 欧美视频一区二区| 不卡欧美aaaaa| 国产精品一区二区男女羞羞无遮挡| 亚洲一级二级三级在线免费观看| 国产精品素人视频| 欧美大片顶级少妇| 欧美视频你懂的| 99精品在线观看视频| 国产在线观看一区二区| 婷婷丁香激情综合| 亚洲一区二区三区四区在线免费观看 | 国产在线视视频有精品| 亚洲高清免费在线| 亚洲免费观看在线观看| 国产精品色哟哟| 久久久.com| 久久综合色鬼综合色| 欧美一区二区三区免费大片| 欧美在线色视频| 一本色道久久综合狠狠躁的推荐| 国产黄人亚洲片| 国产一区二区三区综合 | 欧美一区二区视频在线观看2022 | 欧美午夜精品理论片a级按摩| youjizz国产精品| 懂色一区二区三区免费观看| 久久精品国产999大香线蕉| 日本成人中文字幕| 日韩国产在线观看一区| 亚洲国产毛片aaaaa无费看|