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

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

?? achesscorners.cpp

?? 微軟的基于HMM的人臉識別原代碼, 非常經典的說
?? CPP
字號:
/*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 <stdlib.h>
#include <assert.h>
#include <limits.h>
#include <float.h>

#include <windows.h>
#include "CvTest.h"
#include "HighGUI.h"

//#define WRITE_POINTS

static char* funcs[] =
{
    "cvFindChessBoardCornerGuesses, cvFindCornerSubPix"
};

static char *test_desc[] =
{
    "Regression test"
};


/*void show_points( IplImage* gray, CvPoint2D32f* u, int u_cnt, CvPoint2D32f* v, int v_cnt )
{
    CvSize size;
    int i;

    cvGetImageRawData( gray, 0, 0, &size );
    
    IplImage* rgb = cvCreateImage( size, 8, 3 );
    cvCvtPlaneToPix( gray, gray, gray, 0, rgb );

    for( i = 0; i < v_cnt; i++ )
    {
        cvCircle( rgb, cvPoint(cvRound(v[i].x), cvRound(v[i].y)), 3, CV_RGB(255,0,0), CV_FILLED);
    }

    for( i = 0; i < u_cnt; i++ )
    {
        cvCircle( rgb, cvPoint(cvRound(u[i].x), cvRound(u[i].y)), 3, CV_RGB(0,255,0), CV_FILLED);
    }

    named_window( "test", 0 );
    show_iplimage( "test", rgb );

    wait_key(0);
}*/

/* ///////////////////// chess_corner_test ///////////////////////// */
static int chess_corner_test( void )
{
#ifndef WRITE_POINTS    
    const double rough_success_error_level = 2.5;
    const double precise_success_error_level = 0.2;
    int i = 0, n = 0, j = 0;
    double err = 0, max_rough_error = 0, max_precise_error = 0;
#endif

    const char* all_is_ok = "No errors";
    const char* error_string = all_is_ok;

    /* test parameters */
    char   filepath[100];
    char   filename[100];

    CvPoint2D32f*  u = 0;
    CvPoint2D32f*  v = 0;

    IplImage* img = 0;
    IplImage* gray = 0;
    IplImage* thresh = 0;

    int  idx;

    atsGetTestDataPath( filepath, "CameraCalibration", 0, 0 );

    for( idx = 1; ; idx++ )
    {
        int etalon_count = -1;
        int count = 0;
        CvSize etalon_size = { -1, -1 };
        int result;
        
        /* read the image */
        sprintf( filename, "%schess%d.jpg", filepath, idx );

        img = load_iplimage( filename );
        
        if( !img )
        {
            if( idx == 0 )
                error_string = "one of chess*.jpg images can't be readed"; 
            goto test_exit;
        }

        gray = cvCreateImage( cvSize( img->width, img->height ), IPL_DEPTH_8U, 1 );
        thresh = cvCreateImage( cvSize( img->width, img->height ), IPL_DEPTH_8U, 1 );
        iplColorToGray( img, gray );
        iplMirror( gray, gray, 0 );

        sprintf( filename, "%schess_corners%d.dat", filepath, idx );

#ifndef WRITE_POINTS
        u = (CvPoint2D32f*)atsReadMatrix( filename, &n, &i );

        if( u == 0 )
        {
            if( idx == 0 )
                error_string = "chess_corners*.dat files can't be read"; 
            goto test_exit;
        }

        if( n > 0 )
        {
            etalon_size.width = cvRound( u[0].x );
            etalon_size.height = cvRound( u[0].y );
            etalon_count = etalon_size.width*etalon_size.height;
        }

        if( i != 2 || n != etalon_count + 1 ||
            etalon_size.width <= 0 || etalon_size.height <= 0 )
        {
            error_string = "one of chess_corners*.dat files is corrupted"; 
            goto test_exit;
        }
#else
        etalon_size.width = 5;
        etalon_size.height = 7;
        etalon_count = etalon_size.width*etalon_size.height;
#endif

        /* allocate additional buffers */
        v = (CvPoint2D32f*)malloc( (etalon_count + 1)*sizeof(v[0]));

        count = etalon_size.width*etalon_size.height;

        OPENCV_CALL( result = cvFindChessBoardCornerGuesses(
                     gray, thresh, 0, etalon_size, v + 1, &count ));

        if( !result || count != etalon_count )
        {
            error_string = "chess board is not found"; 
            goto test_exit;
        }

#ifndef WRITE_POINTS
        err = 0;
        for( j = 0; j < etalon_count; j++ )
        {
            double dx = fabs( v[j+1].x - u[j+1].x );
            double dy = fabs( v[j+1].y - u[j+1].y );

            dx = MAX( dx, dy );
            if( dx > err )
            {
                err = dx;
                if( err > rough_success_error_level )
                {
                    error_string = "bad accuracy of corner guesses"; 
                    goto test_exit;
                }
            }
        }
        max_rough_error = MAX( max_rough_error, err );
#endif

        OPENCV_CALL( cvFindCornerSubPix( gray, v + 1, count, cvSize( 5, 5 ), cvSize(-1,-1),
                            cvTermCriteria(CV_TERMCRIT_EPS|CV_TERMCRIT_ITER,30,0.1)));

        //show_points( gray, u + 1, etalon_count, v + 1, count );

#ifndef WRITE_POINTS
        err = 0;
        for( j = 0; j < etalon_count; j++ )
        {
            double dx = fabs( v[j + 1].x - u[j + 1].x );
            double dy = fabs( v[j + 1].y - u[j + 1].y );

            dx = MAX( dx, dy );
            if( dx > err )
            {
                err = dx;
                if( err > precise_success_error_level )
                {
                    error_string = "bad accuracy of adjusted corners"; 

                    goto test_exit;
                }
            }
        }
        max_precise_error = MAX( max_precise_error, err );
#else
        v[0].x = (float)etalon_size.width;
        v[0].y = (float)etalon_size.height;
        atsWriteMatrix( filename, etalon_count + 1, 2, (float*)v );
#endif

        free( u );
        free( v );
        u = v = 0;
        cvReleaseImage( &img );
        cvReleaseImage( &gray );
        cvReleaseImage( &thresh );
    }

test_exit:

    /* release occupied memory */
    if( u )
        free( u );
    if( v )
        free( v );

    cvReleaseImage( &img );
    cvReleaseImage( &gray );
    cvReleaseImage( &thresh );

    if( error_string == all_is_ok )
    {
        trsWrite( ATS_LST, "Max rough error is %g, max precise error is %g",
                  max_rough_error, max_precise_error );
        return trsResult( TRS_OK, "No errors" );
    }
    else
    {
        trsWrite( ATS_LST, "Fatal error" );
        return trsResult( TRS_FAIL, error_string );
    }
}


void  InitAChessCorners(void)
{
    /* Registering test functions */
    trsReg( funcs[0], test_desc[0], atsAlgoClass, chess_corner_test );

} /* InitAChessCorners */

/* End of file. */

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
日本道精品一区二区三区| 久久99国产精品尤物| 国产精品久久久久永久免费观看| 欧美一区二区三区视频免费| 欧美日韩一区视频| 欧美在线观看一二区| 91色porny蝌蚪| 欧美色欧美亚洲另类二区| 欧美性生活影院| 精品视频999| 欧美一个色资源| ww亚洲ww在线观看国产| 国产亚洲成aⅴ人片在线观看| 国产欧美日韩久久| 亚洲欧洲一区二区在线播放| 一区二区三区精品在线| 天天综合色天天综合| 黄一区二区三区| 国产成人在线色| 色婷婷av一区二区三区软件| 欧美日韩一区二区三区免费看 | 欧美午夜精品免费| 91精品国产aⅴ一区二区| 欧美www视频| 亚洲另类色综合网站| 三级久久三级久久久| 国产成人亚洲精品青草天美| 99国产精品久久久久久久久久久 | 麻豆精品久久久| 国产成人8x视频一区二区| 色婷婷综合久久久| 日韩欧美综合一区| 中文字幕在线视频一区| 亚洲国产成人va在线观看天堂| 精品中文字幕一区二区| 91网站最新网址| 欧美α欧美αv大片| 亚洲一区在线视频| 国产精品亚洲午夜一区二区三区| 欧美在线综合视频| 国产午夜精品久久久久久免费视 | 国产成人亚洲综合a∨婷婷| 欧美日韩日日摸| 亚洲国产精品成人综合 | 国产精品免费看片| 日韩国产高清影视| 色一区在线观看| 日本一区二区三区国色天香| 日本成人在线网站| 91国偷自产一区二区三区成为亚洲经典 | 欧美性感一类影片在线播放| 国产亚洲视频系列| 天堂va蜜桃一区二区三区| 成人av免费在线观看| 精品成人在线观看| 性做久久久久久久久| 成人av在线观| 欧美va亚洲va在线观看蝴蝶网| 亚洲女同ⅹxx女同tv| 大胆欧美人体老妇| 久久久另类综合| 日韩福利电影在线| 欧美怡红院视频| 国产精品丝袜在线| 日韩成人精品在线观看| 一本色道久久综合亚洲91| 欧洲激情一区二区| 一卡二卡三卡日韩欧美| 成人av网址在线| 亚洲人成伊人成综合网小说| 日本免费在线视频不卡一不卡二 | 亚洲国产综合视频在线观看| 亚洲天堂中文字幕| 97超碰欧美中文字幕| 国产日韩欧美一区二区三区综合| 国内精品在线播放| 欧美tk—视频vk| 国产一区二区三区香蕉| 日韩视频不卡中文| 韩国一区二区三区| 91麻豆精品国产自产在线观看一区 | 欧美性大战久久久久久久蜜臀| 一区二区在线观看视频 | 亚洲综合一区二区精品导航| 成人黄色网址在线观看| 中文字幕亚洲成人| 国产成人综合精品三级| 欧美激情资源网| 成人福利视频在线看| 亚洲日本在线看| 成人av影视在线观看| 一区二区三区欧美久久| 在线看不卡av| 久久精品国产久精国产爱| 日韩欧美黄色影院| 成人国产电影网| 亚洲精品高清在线观看| 欧美色区777第一页| 天堂影院一区二区| 欧美成人女星排行榜| 成人在线视频一区| 中文字幕中文字幕在线一区| 91在线精品一区二区| 亚洲高清在线精品| 日韩欧美亚洲一区二区| 韩国三级中文字幕hd久久精品| 久久亚洲影视婷婷| 国产精品一区二区在线观看不卡| 亚洲丝袜自拍清纯另类| 91黄视频在线| 日本美女一区二区三区视频| 精品美女一区二区| 成人免费高清在线| 亚洲一区免费在线观看| 日韩欧美成人午夜| 99久久综合狠狠综合久久| 亚洲综合久久av| 精品久久久久久久久久久久久久久| 国产精品99久久久| 亚洲国产婷婷综合在线精品| 日韩一级片在线观看| 国产精品资源在线观看| 18欧美乱大交hd1984| 欧美日韩国产首页| 国产精品99久久久久久久女警| 亚洲精品免费电影| 精品国产一区二区三区四区四| 成人av免费网站| 婷婷综合另类小说色区| 精品日韩成人av| 制服丝袜在线91| 91在线高清观看| 日韩不卡一区二区三区| 亚洲人成小说网站色在线 | 亚洲国产aⅴ天堂久久| 26uuu成人网一区二区三区| 亚洲激情一二三区| 欧美久久久久久久久中文字幕| 午夜伊人狠狠久久| 国产精品国产三级国产| 精品久久久网站| 欧美精品日日鲁夜夜添| 国产美女在线观看一区| 蜜桃av噜噜一区| 亚洲成国产人片在线观看| 亚洲6080在线| 亚洲综合久久久久| 一区二区在线观看免费视频播放| 久久久久久夜精品精品免费| 精品精品国产高清a毛片牛牛 | 成人自拍视频在线观看| 午夜av电影一区| 日韩在线a电影| 日韩精品一区在线观看| 欧美日韩一区二区不卡| 色综合一区二区三区| 99热精品一区二区| 国产一区二区三区四区在线观看| 欧美高清在线一区二区| 国产欧美日韩不卡免费| 国产精品理伦片| 亚洲国产中文字幕| 美日韩一区二区| 国产一区二区三区四区五区入口| 偷偷要91色婷婷| 国内精品在线播放| www.66久久| 欧美一区二区视频在线观看2020| 欧美成人精精品一区二区频| 国产日产欧美一区二区三区| 久久女同精品一区二区| 国产精品麻豆欧美日韩ww| 午夜精品福利视频网站| 国内精品伊人久久久久av影院 | 精品综合久久久久久8888| 蜜桃视频在线一区| 99国产一区二区三精品乱码| 欧美视频在线不卡| 日韩午夜在线播放| 亚洲天堂av一区| 久久99国内精品| 欧美日本在线视频| 欧美激情一区二区| 国内精品久久久久影院薰衣草| 国产精品 欧美精品| 日韩免费高清视频| 视频一区在线视频| 国产成人免费网站| 日韩天堂在线观看| 亚洲成av人片在线观看| 色综合久久中文字幕| 久久久国产精品不卡| 午夜精品免费在线| 欧美日韩高清在线播放| 亚洲国产精品一区二区www| 在线亚洲免费视频| 欧美成人激情免费网| 久久99精品久久久| 亚洲国产精品成人综合| 成人三级伦理片|