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

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

?? adrawing.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 <windows.h>*/
#ifdef WIN32

#include <stdlib.h>
#include <assert.h>
#include <limits.h>
#include <float.h>

#include "CvTest.h"

static char* funcs[] =
{
    "cvLine",
    "cvLineAA",
    "cvEllipse",
    "cvEllipseAA"
};

static char *test_desc = "Comparing with the simple algorithm";

#define DRAW_LINE          0
#define DRAW_LINEAA        1
#define DRAW_ELLIPSE       2
#define DRAW_ELLIPSEAA     3

/* actual parameters */
static int  test_iters = 0;
static int  min_img_size = 0;
static int  max_img_size = 0;

/* which tests have to run */
static int fn_l = 0, fn_h = ATS_DIM(funcs)-1,
           ch_l = 0, ch_h = 1;

static int init_drawing_params = 0;

static void read_drawing_params( void )
{
    if( !init_drawing_params )
    {
        int func, channels;

        /* Determine which tests are needed to run */
        trsCaseRead( &func, "/a/l/la/e/ea", "a",
                     "Function type: \n"
                     "a  - all\n"
                     "l  - line\n"
                     "la - antialiased line\n"
                     "e  - ellipse\n"
                     "ea - antialiased ellipse\n");
        if( func != 0 ) fn_l = fn_h = func - 1;

        trsCaseRead( &channels, "/a/1/3", "a", "a - all, 1 - single channel, 3 - three channels" );
        if( channels != 0 ) ch_l = ch_h = channels - 1;

        /* read tests params */
        trsiRead( &min_img_size, "3", "minimal image size (size is choosen randomly)" );
        trsiRead( &max_img_size, "300", "maximal image size (size is choosen randomly)" );
        trsiRead( &test_iters, "1000", "number of figures" );

        init_drawing_params = 1;
    }
}


/* ///////////////////// drawing_test ///////////////////////// */
static int drawing_test( void* arg )
{
    const double success_error_level = 20;
    const double min_A = 1e-2, max_A = 1e2;
    const double min_e = 0, max_e = 3;
    const int e_flt_bits = 5;
    const double min_arc = -1000, max_arc = 1000;
    const int  min_color = 50;
    const int  depth = IPL_DEPTH_8U;
    const double max_el_size = 2000;

    const int  iter = -1;

    int   param    = (int)arg;
    int   func     = param>> 1;
    int   channels = param & 1;
    int   antialiased = func == 1 || func == 3;
    int   img_alloc_size;

    int   seed = atsGetSeed();

    /* position where the maximum error occured */
    int   merr_iter = 0;

    /* test parameters */
    int     i = 0;
    double  max_err = 0.;
    int     code = TRS_OK;

    IplROI       roi, roi3;
    IplImage    *img, *img2, *img3;
    AtsRandState rng_state;

    CvPoint wnd_org = { 100, 100 };
    CvSize  wnd_size = { 800, 800 };
    CvPoint dst_org = { 0, 0 };
    int window = 0;

    atsRandInit( &rng_state, 0, 1, seed );

    read_drawing_params();

    img_alloc_size = max_img_size;

    if( !(ATS_RANGE( func, fn_l, fn_h+1 ) &&
          ATS_RANGE( channels, ch_l, ch_h+1 ))) return TRS_UNDEF;

    channels = channels*2 + 1;

    img  = atsCreateImage( img_alloc_size, img_alloc_size, depth, channels, 0 );
    img2 = atsCreateImage( img_alloc_size, img_alloc_size, depth, channels, 0 );
    img3 = atsCreateImage( img_alloc_size, img_alloc_size, depth, channels, 0 );

    roi.coi = 0;
    roi.xOffset = roi.yOffset = 0;
    roi3.coi = 0;

    img->roi = img2->roi = img3->roi = &roi;

    for( i = 0; i <= test_iters; i++ )
    {
        double err0, err1;
        int  w = 0, h = 0;
        int  xc = 0, yc = 0, xe = 0, ye = 0;
        int  color, std_color;
        int  dilate_size;
        CvStatus  result = CV_OK;
        IplImage* img0 = i == iter ? img : img2;

        /* generate image size */
        atsRandSetBounds( &rng_state, min_img_size, max_img_size + 1 );
        w = atsRand32s( &rng_state );
        h = atsRand32s( &rng_state );

        /* generate two random points */
        atsRandSetBounds( &rng_state, -w/2, w*3/2 + 1 );
        xc = atsRand32s( &rng_state );
        xe = atsRand32s( &rng_state );

        atsRandSetBounds( &rng_state, -h/2, h*3/2 + 1 );
        yc = atsRand32s( &rng_state );
        ye = atsRand32s( &rng_state );

        /* generate random color */
        atsRandSetBounds( &rng_state, min_color, 256 );
        color = atsRand32s( &rng_state );
        color |= atsRand32s( &rng_state ) << 8;
        color |= atsRand32s( &rng_state ) << 16;

        std_color = color;

        if( i == iter )
        {
            std_color = 0xffffff;
            color = 0x808080;
            w = h = 300;
        }

        roi.width = w;
        roi.height = h;

        iplSet( img, 0 );
        iplSet( img2, 0 );
        iplSet( img3, 0 );

        if( func <= DRAW_LINEAA )
        {
            CvPoint pt1, pt2;

            pt1.x = xc;
            pt1.y = yc;

            pt2.x = xe;
            pt2.y = ye;

            atsDrawLine( img0, (float)xc, (float)yc, (float)xe, (float)ye, std_color );

            if( i == iter )
            {
                window = atsCreateWindow( "proba", wnd_org, wnd_size );
                atsDisplayImage( img, window, dst_org, wnd_size );
            }

            if( !antialiased )
                cvLine( img, pt1, pt2, color );
            else
                cvLineAA( img, pt1, pt2, color );
        }
        else
        {
            double mag, e;
            int    angle;
            int    arc0, arc1;

            /* get random eccentricity (e) and A parameters */
            atsRandSetBounds( &rng_state, min_A, max_A );
            mag = atsRand32f( &rng_state );
            atsRandSetBounds( &rng_state, min_e, max_e );
            e = atsRand32f( &rng_state );
            atsRandSetFloatBits( &rng_state, e_flt_bits );

            /* get integer-value random angles in degrees */
            atsRandSetBounds( &rng_state, min_arc, max_arc );

            angle = atsRand32s( &rng_state );
            arc0  = atsRand32s( &rng_state );
            arc1  = atsRand32s( &rng_state );

            if( e >= 0.9 ) e = 0.9/(0.1 + e);

            if( i < iter ) continue;

            //if( func <= DRAW_ELLIPSEAA )
            {
                double a, b;
                CvSize el_size;
                CvPoint center;

                center.x = xc;
                center.y = yc;

                a = mag/(1. - e*e);
                b = sqrt(mag*a);

                if( a > max_el_size ) a = max_el_size;
                if( b > max_el_size ) b = max_el_size;

                el_size.width  = atsRound(a);
                el_size.height = atsRound(b);

                if( !antialiased )
                    cvEllipse( img, center, el_size, angle, arc0, arc1, color, 1 );
                else
                    cvEllipseAA( img, center, el_size, angle, arc0, arc1, color, 0 );

                if( i == iter )
                {
                    window = atsCreateWindow( "proba", wnd_org, wnd_size );
                    atsDisplayImage( img, window, dst_org, wnd_size );
                }

                atsDrawEllipse( img0, (float)center.x, (float)center.y,
                                (float)el_size.width, (float)el_size.height,
                                (float)angle, (float)arc0, (float)arc1, std_color );
            }
            /*else
            {
                double A, B, C, D, E;
                CvPoint pt1, pt2;

                if( atsCalcQuadricCoeffs( xc, yc, mag, e, angle, arc0, arc1,
                                          &A, &B, &C, &D, &E, &pt2, &pt1 ) < 0 ) continue;


                result = atsConic( img, atsRound(A), atsRound(B), atsRound(C),
                                   atsRound(D), atsRound(E),
                                   pt1, pt2, color, 0 ) >= 0 ? 0 : -1;

                if( i == iter )
                {
                    window = atsCreateWindow( "proba", wnd_org, wnd_size );
                    atsDisplayImage( img, window, dst_org, wnd_size );
                }

                atsDrawConic( img0, (float)xc, (float)yc, (float)mag, (float)e,
                          (float)angle, (float)arc0, (float)arc1, std_color );
            }*/
        }

        if( result < 0 )
        {
            code = TRS_FAIL;
            goto test_exit;
        }

        /*
        if( i == iter )
        {
            Sleep(3000);
            atsDisplayImage( img, window, dst_org, wnd_size );
            Sleep(3000);
            atsDestroyWindow( window );
            window = 0;
        }
        */

        if( antialiased )
        {
            int c;
            iplThreshold( img, img, 1 );
            for( c = 1; c <= channels; c++ )
            {
                int val = (color >> 8*(c-1)) & 0xff;
                roi.coi = c;
                iplSubtractS( img, img, 255 - val, 0 );
            }
            roi.coi = 0;
        }

        dilate_size = 3;

        /* check that ats_func_result is in dilate(ippi_func_result) */
        iplMaxFilter( img, img3, dilate_size, dilate_size, dilate_size/2, dilate_size/2 );
        iplSubtract( img2, img3, img3 );
        iplThreshold( img3, img3, 1 );
        roi3.xOffset = roi3.yOffset = 1 + antialiased*2;
        roi3.width = w - (1 + antialiased*2)*2;
        roi3.height = h - (1 + antialiased*2)*2;
        if( roi3.width <= 0 || roi3.height <= 0 ) continue;

        img3->roi = &roi3;
        err0 = iplNorm( img3, 0, IPL_L1 )/(255*channels);

        dilate_size += antialiased*2;

        /* check that ippi_func_result is in dilate(ats_func_result) */

        img3->roi = &roi;
        iplMaxFilter( img2, img3, dilate_size, dilate_size, dilate_size/2, dilate_size/2 );
        iplSubtract( img, img3, img3 );
        iplThreshold( img3, img3, 1 );

        img3->roi = &roi3;
        err1 = iplNorm( img3, 0, IPL_L1 )/(255*channels);
        img3->roi = &roi;

        err0 = MAX( err0, err1 );

        if( err0 > max_err )
        {
            merr_iter = i;
            max_err   = err0;
            if( max_err > success_error_level ) goto test_exit;
        }
    } /* end of test loop */

test_exit:

    img->roi = img2->roi = img3->roi = 0;
    atsReleaseImage( img );
    atsReleaseImage( img2 );
    atsReleaseImage( img3 );

    //if( code == TRS_OK )
    {
        trsWrite( ATS_LST, "Max err is %g at iter = %d, seed = %08x",
                           max_err, merr_iter, seed );

        return max_err <= success_error_level ?
            trsResult( TRS_OK, "No errors" ) :
            trsResult( TRS_FAIL, "Bad accuracy" );
    }
    /*else
    {
        trsWrite( ATS_LST, "Fatal error at iter = %d, seed = %08x", i, seed );
        return trsResult( TRS_FAIL, "Function returns error code" );
    }*/
}

#define LINE_8U_C1         0
#define LINE_8U_C3         1
#define LINEAA_8U_C1       2
#define LINEAA_8U_C3       3
#define ELLIPSE_8U_C1      4
#define ELLIPSE_8U_C3      5
#define ELLIPSEAA_8U_C1    6
#define ELLIPSEAA_8U_C3    7

void InitADrawing( void )
{
    /* Register test functions */
    trsRegArg( funcs[0], test_desc, atsAlgoClass, drawing_test, LINE_8U_C1 );
    trsRegArg( funcs[0], test_desc, atsAlgoClass, drawing_test, LINE_8U_C3 );
    trsRegArg( funcs[1], test_desc, atsAlgoClass, drawing_test, LINEAA_8U_C1 );
    trsRegArg( funcs[1], test_desc, atsAlgoClass, drawing_test, LINEAA_8U_C3 );
    trsRegArg( funcs[2], test_desc, atsAlgoClass, drawing_test, ELLIPSE_8U_C1 );
    trsRegArg( funcs[2], test_desc, atsAlgoClass, drawing_test, ELLIPSE_8U_C3 );
    trsRegArg( funcs[3], test_desc, atsAlgoClass, drawing_test, ELLIPSEAA_8U_C1 );
    trsRegArg( funcs[3], test_desc, atsAlgoClass, drawing_test, ELLIPSEAA_8U_C3 );
}
/* InitADrawing */

#endif

/* End of file. */

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
一区二区三区蜜桃| 国产精品高潮呻吟久久| 国产福利精品导航| 亚洲主播在线观看| 亚洲国产电影在线观看| 91 com成人网| 色综合久久综合| 国产精品一区二区x88av| 日韩精品国产精品| 亚洲激情成人在线| 国产精品美日韩| 精品国产一区二区在线观看| 欧美揉bbbbb揉bbbbb| 91在线无精精品入口| 精品亚洲国内自在自线福利| 午夜av一区二区三区| 中文字幕在线观看一区| 久久精品欧美一区二区三区不卡| 欧美精品v国产精品v日韩精品 | 青青草原综合久久大伊人精品 | 亚洲一区二区三区视频在线| 欧美—级在线免费片| 欧美成人精精品一区二区频| 欧美日韩亚洲丝袜制服| 欧美在线观看视频在线| 91在线视频网址| 成人黄色大片在线观看| 国产黑丝在线一区二区三区| 韩国三级在线一区| 精久久久久久久久久久| 理论片日本一区| 日韩激情在线观看| 日韩激情一区二区| 男男视频亚洲欧美| 麻豆精品在线视频| 男人的天堂久久精品| 日韩av电影免费观看高清完整版在线观看| 亚洲乱码国产乱码精品精98午夜| 国产精品初高中害羞小美女文| 中文字幕精品在线不卡| 国产三区在线成人av| 久久精品一区蜜桃臀影院| 国产欧美日韩激情| 国产精品毛片大码女人| 中文字幕一区二区三区精华液| 国产精品五月天| 欧美激情一区三区| 国产精品久久久久久久久晋中| 欧美激情在线看| 亚洲免费资源在线播放| 亚洲日韩欧美一区二区在线| 亚洲激情自拍偷拍| 亚洲午夜在线视频| 日日欢夜夜爽一区| 韩国欧美国产1区| 高清不卡在线观看| 99国产精品久久久久| 欧美亚洲国产一区二区三区va | 26uuu欧美| 国产欧美va欧美不卡在线| 中文字幕人成不卡一区| 亚洲h精品动漫在线观看| 亚洲中国最大av网站| 蜜桃久久久久久| 国产精品888| 色综合久久精品| 日韩一级二级三级| 久久久久久久网| 亚洲精品日韩综合观看成人91| 视频一区欧美精品| 国产精品99久久久久久久vr| 91啪九色porn原创视频在线观看| 欧美日韩一区二区三区在线| 日韩午夜精品电影| 国产精品久久看| 亚洲成av人在线观看| 国产在线播放一区三区四| www.亚洲色图| 欧美精品九九99久久| 久久九九全国免费| 亚洲国产欧美在线人成| 韩国精品主播一区二区在线观看| 成人av先锋影音| 欧美日韩国产a| 日本一二三不卡| 五月天婷婷综合| 成人午夜av电影| 制服.丝袜.亚洲.另类.中文| 国产三级久久久| 无码av中文一区二区三区桃花岛| 懂色一区二区三区免费观看| 欧美日韩日日骚| 中文字幕精品在线不卡| 日本不卡视频一二三区| 91亚洲大成网污www| 日韩精品中午字幕| 亚洲综合一二区| 国产91丝袜在线18| 日韩欧美电影在线| 亚洲精品成人悠悠色影视| 国产suv一区二区三区88区| 欧美久久高跟鞋激| 亚洲女人的天堂| 国产传媒欧美日韩成人| 91麻豆精品91久久久久同性| 国产精品久久久久影院色老大| 免费成人结看片| 欧美日韩国产小视频| 亚洲欧洲日韩综合一区二区| 久久国产精品99久久久久久老狼 | 972aa.com艺术欧美| 亚洲精品一区二区在线观看| 丝袜脚交一区二区| 色婷婷久久99综合精品jk白丝| 国产精品免费av| 国产91高潮流白浆在线麻豆| 精品少妇一区二区三区视频免付费 | 婷婷丁香久久五月婷婷| 97se亚洲国产综合在线| 中日韩av电影| 国产成人99久久亚洲综合精品| 日韩视频免费直播| 亚洲成人动漫在线观看| 91国产丝袜在线播放| 亚洲欧美日韩中文播放 | 成人黄色在线视频| 久久久亚洲综合| 国产美女在线精品| 久久色.com| 国产福利91精品一区| 国产日韩一级二级三级| 国产风韵犹存在线视精品| 久久久久久久久久看片| 激情成人综合网| 欧美不卡激情三级在线观看| 男男视频亚洲欧美| 日韩精品一区二区三区中文精品| 日韩国产在线观看一区| 欧美日韩不卡在线| 日韩av中文字幕一区二区 | 亚洲欧美日韩电影| 91黄色免费版| 亚洲成在人线在线播放| 精品污污网站免费看| 婷婷中文字幕综合| 日韩视频免费观看高清完整版 | 成人午夜电影久久影院| 国产精品国产三级国产普通话99| 成人高清免费观看| 亚洲人成人一区二区在线观看| 日本韩国欧美一区二区三区| 亚洲一区二区三区四区的 | 国产欧美精品一区| 91色.com| 婷婷综合五月天| 久久九九国产精品| 91视频在线看| 五月天婷婷综合| 久久色在线观看| 色综合久久久久综合体| 日韩和的一区二区| 日本一区二区视频在线| 色噜噜狠狠色综合中国| 日韩激情视频在线观看| 国产亚洲欧洲一区高清在线观看| 9久草视频在线视频精品| 亚洲高清免费观看| 久久综合色一综合色88| 91小视频免费看| 日本aⅴ精品一区二区三区| 久久久久国产精品免费免费搜索 | 欧美va亚洲va| 波多野结衣亚洲一区| 日日夜夜免费精品| 中文字幕不卡一区| 3d成人动漫网站| 成人国产视频在线观看| 五月天激情综合| 欧美国产日韩精品免费观看| 欧美日韩一区二区在线观看视频 | 久久电影网电视剧免费观看| 国产精品拍天天在线| 欧美日韩国产精品自在自线| 国产精品 欧美精品| 亚洲成人自拍网| 日本一区二区成人| 日韩一区二区在线看片| 91在线观看污| 激情成人午夜视频| 午夜伦理一区二区| 国产精品久久久久久久久久久免费看 | av在线综合网| 免费欧美高清视频| 亚洲色图欧美偷拍| 欧美r级电影在线观看| 欧美日本高清视频在线观看| 成人av资源网站| 国产在线精品一区二区夜色| 亚洲二区在线观看| 成人欧美一区二区三区在线播放|