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

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

?? hmmdemodoc.cpp

?? 基于隱馬爾可夫模型的人臉識(shí)別源代碼,是作模式識(shí)別的最好學(xué)習(xí)代碼
?? CPP
字號(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*/// HMMDemoDoc.cpp : implementation of the CHMMDemoDoc class
//

#include "stdafx.h"
#include "HMMDemo.h"
#include "InfoDialogs.h"
#include "HMMDemoDoc.h"
#include "ImageBaseView.h"

#include "MainFrm.h"

#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif

extern CStringArray maskFileNameArray;
extern CString GetLastDirectory(CString originalDirectory);
/////////////////////////////////////////////////////////////////////////////
// CHMMDemoDoc

IMPLEMENT_DYNCREATE(CHMMDemoDoc, CDocument)

BEGIN_MESSAGE_MAP(CHMMDemoDoc, CDocument)
	//{{AFX_MSG_MAP(CHMMDemoDoc)
	//}}AFX_MSG_MAP
END_MESSAGE_MAP()

/////////////////////////////////////////////////////////////////////////////
// CHMMDemoDoc construction/destruction

CHMMDemoDoc::CHMMDemoDoc()
{
}

CHMMDemoDoc::~CHMMDemoDoc()
{
}

BOOL CHMMDemoDoc::OnNewDocument()
{
	if (!CDocument::OnNewDocument())
		return FALSE;

    m_base.SetBaseView( GetImageBaseView() );
    m_base.SetFileName("untitled_base.txt");
    m_base.SetModified(false);

	return TRUE;
}


/////////////////////////////////////////////////////////////////////////////
// CHMMDemoDoc serialization

BOOL CHMMDemoDoc::OnOpenDocument(LPCTSTR path)
{
    bool result = false;
    
    int length = strlen( path );
    const char* tmp = path + length - 3;

    if( _stricmp(tmp,"bmp") == 0 || _stricmp(tmp,"jpg") == 0 || 
        _stricmp(tmp-1,"jpeg") == 0 )
    {
        CHMMDemoView* camera_view = GetCameraView();

        CCamera& camera = camera_view->Camera();

        if ( camera.IsRunning() ) camera.Stop();

        //load image from disk
        CImage& image = camera.GetFrame();
        image.Load( path, 1 );

	    camera_view->Invalidate();
        camera_view->SetSelection(0); 
        
    }
    else if( _stricmp(tmp,"txt") == 0 )
    {   
        DeleteContents();
        SetModifiedFlag();  // dirty during de-serialize

        m_base.SetBaseView( GetImageBaseView() );

        {
            CWaitCursor wait;
            m_base.SetFileName( path );
            result = m_base.Load();
        }

        if( !result )
        {
            m_base.SetFileName("");
            AfxMessageBox("Failed to open database");
        }
        else
        {
            SetModifiedFlag(FALSE);     // start off with unmodified

            //try to read appropriate config file.
            //create cfg file name
            CString cfg_name = path;
            cfg_name.Replace( ".txt", "CFG.txt" );
            
            //reset parameters (HMM, Sampling etc.) for whole application
            CHMMDemoApp* app = (CHMMDemoApp*)AfxGetApp();
            app->LoadConfig( cfg_name, true );
        }
    }
    return  result;
}


BOOL CHMMDemoDoc::OnSaveDocument(LPCTSTR path)
{
    bool result = false;

    CWaitCursor wait;
    result = m_base.Save();

    if( !result )
    {
        AfxMessageBox("Failed to save database");
    }

    SetModifiedFlag(FALSE);     // start off with unmodified
    return  result;
}


/////////////////////////////////////////////////////////////////////////////
// CHMMDemoDoc commands

void CHMMDemoDoc::DeleteContents() 
{
    m_base.Unload();
    CDocument::DeleteContents();
}


CPerson* CHMMDemoDoc::AskPersonName(CString promptFileName)
{
	// Modified by Harley 2005.03.24
	// For no using the class CPersonName
    CPerson* person = 0;
    person = m_base.FindPersonByName( promptFileName );
    if( !person )
    {
        person = m_base.AddPerson( promptFileName, 0, false );
        if( !person )
        {
            AfxMessageBox("Can't create person folder\n");
        }
    }
   
/*    CPerson* person = 0;
    CPersonName dlg( m_base );

	dlg.SetPromptFileName(promptFileName);//Added by Harley 2005.03.24

    if( dlg.DoModal() == IDOK )
    {
        CString name = dlg.GetPersonName();
	    if( name.GetLength() != 0 )
        {
            person = m_base.FindPersonByName( name );
            if( !person )
            {
                person = m_base.AddPerson( name, 0, false );
                if( !person )
                {
                    AfxMessageBox("Can't create person folder\n");
                }
            }
        }
    }
*/
    return person;
}

void  CHMMDemoDoc::AddObj( CImage& img, CRect roi, CStringList* otherImages )
{
    CImageBaseView* view = GetImageBaseView();

	CString promptFileName;

    if( view )
    {
        int new_person_index = 0;
        int index = view->GetPersonIndex();
        CPerson* person = 0;

		// Move here by Harley 2005.03.24
		promptFileName = otherImages->GetTail();

        if( index < 0 ) // no person selected
        {
			CString maskFileName = GetLastDirectory(promptFileName);	

            person = AskPersonName( maskFileName);
            if( !person ) return;
            
            new_person_index = m_base.GetPersonIndex( person );
        }
        else
        {
            person = GetFaceBase().GetPerson(index);
            if( !person )
            {
                ASSERT( 0 );
                return;
            }
        }

        person->AddImage( 0, &img, roi , promptFileName);
        if( otherImages )
        {
            POSITION pos = otherImages->GetHeadPosition();
            //skip first image, bacause it have already beeb added 
            otherImages->GetNext( pos );

            while( pos )
            {
                CString path = otherImages->GetNext(pos);
                char drive[1024], dir[1024];
                _splitpath( path, drive, dir, 0, 0 );
                strcat( drive, dir );
                if( _stricmp( drive, person->GetFolder()) == 0 )
                {
                    person->AddImage( path, 0, CRect(0,0,0,0) ,promptFileName );
                }
                else
                {
                    CImage img;
                    img.Load( path, 0 );
                    person->AddImage( 0, &img, CRect(0,0,0,0) ,promptFileName);
                }
            }
        }
       
        if( index >= 0 )
            view->RefreshView();
        else
            view->SwitchMode( new_person_index, true );
    }
}

bool  CHMMDemoDoc::RemoveObj( int person_index, int active_index )
{
    bool removed = false;
    
    if( person_index >= 0 )
    {
        CPerson* person = m_base.GetPerson( person_index );
        if( person )
        {
            POSITION pos = person->GetImgList().FindIndex( active_index );
            if( pos )
            {
                int res = AfxMessageBox( "Remove image?", MB_YESNO );
                if( res == IDYES )
                {
                    person->RemoveImage( pos );
                    removed = true;
                    
                }
            }
        }
    }
    else
    {
        POSITION pos = m_base.GetPersonList().FindIndex( active_index );
        if( pos )
        {
            int res = AfxMessageBox( "Remove person from the base?\n"
                                     "(files will not be deleted physically)",
                                     MB_YESNO );
            if( res == IDYES )
            {
                m_base.RemovePerson( pos );
                removed = true;
            }
        }
    }

    return removed;
}

void CHMMDemoDoc::ChangeBaseParams()
{
    CBaseInfo dlg( m_base );

    if( dlg.DoModal() == IDOK )
    {
        m_base.SetName( dlg.GetBaseName());
        m_base.SetFileName( dlg.GetFileName());
        m_base.SetModified();
    }
}

void  CHMMDemoDoc::DeleteHMMInfo( int person_index )
{
    if( person_index >= 0 )
    {
        CPerson* person = m_base.GetPerson(person_index);
        if( person )
        {
            person->DeleteHMMInfo();
        }
    }
    else
    {
        m_base.DeleteHMMInfo();
    }
}

?? 快捷鍵說(shuō)明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號(hào) Ctrl + =
減小字號(hào) Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
欧美成人福利视频| 日韩三区在线观看| 极品销魂美女一区二区三区| 国产精品美女视频| 欧美一区二区三区免费观看视频| 丁香天五香天堂综合| 偷拍自拍另类欧美| 亚洲人成7777| 国产欧美一区二区三区在线看蜜臀| 欧美性猛交xxxx乱大交退制版| 国产一区二区在线观看免费| 亚洲高清免费视频| 亚洲人成精品久久久久久| 精品国精品自拍自在线| 91久久香蕉国产日韩欧美9色| 国产美女一区二区三区| 日产欧产美韩系列久久99| 亚洲图片另类小说| 国产欧美一区二区精品忘忧草| 日韩一区二区三区观看| 欧美午夜在线一二页| www.欧美色图| 福利一区二区在线| 韩国毛片一区二区三区| 日本在线不卡视频| 亚洲成a人片在线观看中文| 亚洲日本欧美天堂| 中文字幕在线不卡| 国产精品美女久久久久久| 精品久久久久久久一区二区蜜臀| 91 com成人网| 欧美色涩在线第一页| 在线免费不卡电影| 色哟哟国产精品| 色综合天天综合| 日韩欧美亚洲国产精品字幕久久久| 91黄色在线观看| 在线欧美小视频| 日本高清视频一区二区| 色噜噜狠狠一区二区三区果冻| 91丨国产丨九色丨pron| 91免费在线视频观看| 99这里只有久久精品视频| av一区二区三区四区| 波多野结衣中文字幕一区二区三区| 国产成人精品影视| 成人美女视频在线看| 不卡欧美aaaaa| 99久久精品费精品国产一区二区| 99久久久精品| 在线观看国产一区二区| 欧美亚洲高清一区二区三区不卡| 在线观看日产精品| 欧美三级视频在线观看| 欧美精品亚洲二区| 欧美一区在线视频| 精品免费日韩av| 国产网站一区二区三区| 亚洲欧洲日韩综合一区二区| 亚洲男人的天堂av| 五月天丁香久久| 欧美a级理论片| 国产一区二区影院| 93久久精品日日躁夜夜躁欧美| 91搞黄在线观看| 日韩一级二级三级| 国产亚洲精品精华液| 一区二区中文视频| 亚洲成人高清在线| 国产一区二区福利视频| 成人精品鲁一区一区二区| 91黄色免费看| 欧美videos大乳护士334| 国产喷白浆一区二区三区| 亚洲欧美成aⅴ人在线观看| 亚洲成人www| 国产夫妻精品视频| 在线观看成人小视频| 日韩视频在线观看一区二区| 国产午夜精品美女毛片视频| 亚洲另类在线一区| 久久国产精品色| voyeur盗摄精品| 欧美一区二区三区视频免费| 欧美国产综合一区二区| 午夜一区二区三区视频| 国产精品性做久久久久久| 在线亚洲高清视频| 久久精品日韩一区二区三区| 亚洲综合视频网| 国产河南妇女毛片精品久久久| 色综合久久中文字幕综合网| 日韩欧美国产综合一区| 亚洲人快播电影网| 国内精品伊人久久久久av影院| 色天使久久综合网天天| 精品国内二区三区| 亚洲国产中文字幕| 成人av资源站| 精品理论电影在线| 亚洲高清一区二区三区| 国产iv一区二区三区| 777欧美精品| 亚洲欧美一区二区三区久本道91| 久久97超碰国产精品超碰| 在线观看av一区| 国产精品久久久久久久裸模| 日本不卡免费在线视频| 91久久人澡人人添人人爽欧美| 久久精品一区二区三区不卡牛牛| 偷拍一区二区三区四区| 91丨porny丨国产| 国产欧美一区二区三区在线看蜜臀 | 欧美性生活大片视频| 久久久综合视频| 麻豆传媒一区二区三区| 欧美视频一区在线| 亚洲精品久久7777| 成人激情文学综合网| 欧美精品一区在线观看| 日本v片在线高清不卡在线观看| 欧洲av一区二区嗯嗯嗯啊| 综合在线观看色| 不卡av在线网| 欧美国产精品v| 国产成人免费在线观看不卡| 欧美xxxx在线观看| 热久久久久久久| 91精品国产91热久久久做人人| 一区二区成人在线视频| 色乱码一区二区三区88| 亚洲人成精品久久久久| 92精品国产成人观看免费| 综合激情成人伊人| av一区二区三区在线| 国产精品女主播av| bt欧美亚洲午夜电影天堂| 国产精品久久久久桃色tv| 成人免费视频app| 国产精品国产自产拍高清av王其| 国产91精品免费| 国产精品久久久久影院老司| jlzzjlzz亚洲日本少妇| 综合中文字幕亚洲| 欧美亚洲国产一区二区三区| 亚洲综合视频网| 91精品在线一区二区| 天堂va蜜桃一区二区三区| 日韩丝袜美女视频| 国产在线精品免费| 欧美激情一区三区| 99国产精品久久久久久久久久久| 亚洲精品美国一| 欧美日韩国产天堂| 男人操女人的视频在线观看欧美| 欧美精品日韩精品| 久久99国内精品| 国产精品美女久久久久高潮| av资源网一区| 亚洲国产精品一区二区www在线| 欧美精品在线观看一区二区| 青青草原综合久久大伊人精品| 日韩免费观看高清完整版| 国产美女主播视频一区| 综合亚洲深深色噜噜狠狠网站| 欧美午夜一区二区三区免费大片| 爽好多水快深点欧美视频| 精品久久久久久久人人人人传媒| 国内成+人亚洲+欧美+综合在线| 国产嫩草影院久久久久| 91久久国产最好的精华液| 七七婷婷婷婷精品国产| 欧美国产日韩亚洲一区| 欧美色网一区二区| 国产精品乡下勾搭老头1| 亚洲精品日韩一| 精品欧美一区二区三区精品久久 | 日韩一级二级三级| av不卡免费电影| 日韩国产在线一| 国产日韩精品视频一区| 91成人免费电影| 国产专区综合网| 亚洲一区二区三区国产| 久久久国产精华| 欧美午夜一区二区三区| 国产一区二区三区久久久| 亚洲综合一区二区精品导航| 精品国内二区三区| 色噜噜狠狠色综合中国| 久久精品国产网站| 亚洲欧美日韩久久| 欧美精品v日韩精品v韩国精品v| 丁香六月久久综合狠狠色| 伊人夜夜躁av伊人久久| 欧美本精品男人aⅴ天堂| 欧美性生活久久| 国产一区二区福利| 亚洲高清视频在线| 亚洲欧美日韩中文播放|