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

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

?? aminarearect.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 "CVTest.h"
#include "float.h"

CvSeq* atsCvtHullToContour( CvSeq* hull, CvMemStorage* storage )
{
    CvSeqWriter writer;
    CvSeqReader hull_reader;
    cvStartWriteSeq( CV_SEQ_POLYGON, sizeof(CvSeq), sizeof(CvPoint), storage, &writer );
    cvStartReadSeq( hull, &hull_reader, 0 );

    CvPoint* hull_elem;
    int i = 0;
    for( i = 0; i < hull->total; i++ )
    {           
        CV_READ_SEQ_ELEM( hull_elem, hull_reader );
        CV_WRITE_SEQ_ELEM( hull_elem[0], writer )        
    }

    return cvEndWriteSeq( &writer );
}

atsCheckMinAreaRect( CvPoint* points, int n, CvPoint2D32f anchor, 
                     CvPoint2D32f vect1, CvPoint2D32f vect2 )
{
    float acc = 1.f;
    CvPoint2D32f Anchor = cvPoint2D32f(0,0);
    CvPoint2D32f Vect1 = cvPoint2D32f(0,0);
    CvPoint2D32f Vect2 = cvPoint2D32f(0,0);
    float minarea = FLT_MAX;

    //consequently get 2 points
    for( int i = 0; i < n; i++ )
    {
        CvPoint p1 = points[i];
        CvPoint p2 = points[(i+1)%n];

        CvPoint2D32f main_vect;
        main_vect.x = (float)(p2.x - p1.x);
        main_vect.y = (float)(p2.y - p1.y);

        //project all points to this vector
        int right = -1, left = -1, top = -1;
        float right_val = -FLT_MAX, left_val = FLT_MAX, top_val = -FLT_MAX;
               
        for( int j = 0; j < n; j++ )
        {
            CvPoint2D32f tmp_vect;
            tmp_vect.x = (float)(points[j].x - p1.x);
            tmp_vect.y = (float)(points[j].y - p1.y);

            //compute dot product and find min & max
            float prod = main_vect.x*tmp_vect.x + main_vect.y * tmp_vect.y;
            if( prod > right_val )
            {
                right_val = prod;
                right = j;
            }
            if( prod < left_val )
            {
                left_val = prod;
                left = j;
            }

            //compute perpendicular
            prod = -main_vect.y * tmp_vect.x + main_vect.x * tmp_vect.y;
            if( prod > top_val )
            {
                top_val = prod;
                top = j;
            }
        }

        /*compute area  */

        //1. find main vector norm
        float norm = (float)sqrt( main_vect.x*main_vect.x + main_vect.y * main_vect.y );
        
        main_vect.x /= norm;
        main_vect.y /= norm;

        CvPoint2D32f co;
        co.x = (float)(points[right].x - points[left].x);
        co.y = (float)(points[right].y - points[left].y);

        float width = main_vect.x* co.x + main_vect.y * co.y;

        CvPoint2D32f per;
        per.x = (float)(points[top].x - p1.x);
        per.y = (float)(points[top].y - p1.y);

        float height = -main_vect.y* per.x + main_vect.x * per.y;

        float area = height * width;

        if( area < minarea )
        {
            minarea  = area;
            CvPoint2D32f ico;
            ico.x = (float)(points[left].x - p1.x);
            ico.y = (float)(points[left].y - p1.y);


            //fill output
            float ret = main_vect.x* ico.x + main_vect.y * ico.y;

            //compute anchor
            Anchor.x = p1.x + main_vect.x * ret;
            Anchor.y = p1.y + main_vect.y * ret;

            //compute output vecs
            Vect1.x = main_vect.x * width;
            Vect1.y = main_vect.y * width;

            Vect2.x = -main_vect.y * height;
            Vect2.y = main_vect.x * height;
        } 
    }

    //compare computed & input
    
    //calc all vertices
    CvPoint2D32f v[4];
    CvPoint2D32f V[4];

    v[0] = anchor;
    v[1] = cvPoint2D32f( anchor.x + vect1.x, anchor.y + vect1.y );
    v[2] = cvPoint2D32f( v[1].x + vect2.x, v[1].y + vect2.y );
    v[3] = cvPoint2D32f( anchor.x + vect2.x, anchor.y + vect2.y );

    V[0] = Anchor;
    V[1] = cvPoint2D32f( Anchor.x + Vect1.x, Anchor.y + Vect1.y );
    V[2] = cvPoint2D32f( V[1].x + Vect2.x, V[1].y + Vect2.y );
    V[3] = cvPoint2D32f( Anchor.x + Vect2.x, Anchor.y + Vect2.y );


    //return (atsCompSinglePrec( &(anchor.x), &(Anchor.x), 2, acc ) +
    //       atsCompSinglePrec( &(vect1.x), &(Vect1.x), 2, acc ) +
    //       atsCompSinglePrec( &(vect2.x), &(Vect2.x), 2, acc ));
        
    //compare vertices
    int err = 1;
    for( int j = 0; j < 4; j++ )
    {
        int e  = atsCompSinglePrec( &(v[0].x), &(V[j].x), 2, acc );
            e += atsCompSinglePrec( &(v[1].x), &(V[(j+1)%4].x), 2, acc );
            e += atsCompSinglePrec( &(v[2].x), &(V[(j+2)%4].x), 2, acc );
            e += atsCompSinglePrec( &(v[3].x), &(V[(j+3)%4].x), 2, acc );

        if( !e ) 
        {
            err = 0;
            break;
        }
    }

    return err;
}

/* Testing parameters */
static char test_desc[] = "MinAreaRect";
static char TestClass[] = "Algorithm";
static char* func_name = "cvMinAreaRect";

static int lScreenSize;
static long lLoopsProp;
static long lNumPoints;   

static int fmaMinAreaRect(void)
{ 
    long lErrors = 0;     
    
    static int  read_param = 0;
    int j;
    
    CvPoint* points;
    CvContour* contour;
    CvSeq* hull = NULL;
    CvMemStorage* storage;

    if(!read_param)
    {
        read_param=1;
        
        /* Reading test-parameters */
        trslRead( &lNumPoints, "50", "number of points" ); 
        trslRead( &lLoopsProp, "50", "Loops" ); 
    }

    storage = cvCreateMemStorage(0);
    points = (CvPoint*)icvAlloc( lNumPoints * sizeof(CvPoint) );
    
    for( j = 0; j < lLoopsProp; j++ )
    {
        int numpts;
        ats1iInitRandom( 5, 1024, &lScreenSize, 1 );
        ats1iInitRandom( 5, lNumPoints, &numpts, 1 );
        ats1iInitRandom( 0, lScreenSize, (int*)points, 2*numpts ) ;
       /* numpts = 7;
        points[0] = cvPoint( 4, 33);
        points[1] = cvPoint( 5, 34);
        points[2] = cvPoint( 34, 33);
        points[3] = cvPoint( 34, 2);
        points[4] = cvPoint( 14, 0);
        points[5] = cvPoint( 8, 8);
        points[6] = cvPoint( 5, 22);
       */ 
        contour = (CvContour*)cvCreateSeq( CV_SEQ_SIMPLE_POLYGON, sizeof(CvContour),
                               sizeof(CvPoint), storage);  
 
        cvSeqPushMulti( (CvSeq*)contour, points, numpts );
        hull = cvContourConvexHull( (CvSeq*)contour, CV_COUNTER_CLOCKWISE, storage );   
        
        if( hull->total < 3 ) continue;
        //convert hull
        CvContour* contour2 = (CvContour*)atsCvtHullToContour( hull, storage );
        /* check errors */
        
        cvCvtSeqToArray( (CvSeq*)contour2, points ); 
        CvPoint2D32f anchor;
        CvPoint2D32f vect1, vect2;
        cvMinAreaRect( points, contour2->total, -1, -1, -1, -1, &anchor, &vect1, &vect2 );
        
        lErrors += atsCheckMinAreaRect( points , contour2->total, anchor, vect1, vect2 );
               
        cvClearMemStorage( storage );
    } /* for */

    icvFree(&points);
    cvReleaseMemStorage(&storage);
    
   if( lErrors == 0 ) return trsResult( TRS_OK, "No errors fixed for this test" );
   else return trsResult( TRS_FAIL, "Total fixed %d errors", lErrors );

}        

void InitAMinAreaRect(void)
{
    /* Register test function */    
    trsReg( func_name, test_desc, atsAlgoClass, fmaMinAreaRect );
    
} /* InitAMinAreaRect */


?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
91丨porny丨在线| 91高清视频在线| 蜜桃久久久久久久| 奇米一区二区三区| 免费观看久久久4p| 久久精品国产99国产精品| 看片网站欧美日韩| 国产综合久久久久影院| 国产精品影视天天线| 国产精品12区| 成人一区二区三区视频| av成人老司机| 在线免费精品视频| 欧美精品久久一区| 日韩欧美一区在线| 欧美电视剧在线观看完整版| 精品国产sm最大网站免费看| 欧美激情一区二区三区不卡| 国产精品美女久久久久aⅴ国产馆| 国产精品成人免费| 一区二区在线免费观看| 天天免费综合色| 黄色日韩网站视频| 国产91精品一区二区麻豆亚洲| 久久99精品久久久久| 日韩不卡一二三区| 五月开心婷婷久久| 国产曰批免费观看久久久| 国产成人午夜精品5599| 福利电影一区二区三区| 91视视频在线直接观看在线看网页在线看| 一本一道综合狠狠老| 欧美日韩电影在线播放| 久久网站热最新地址| 亚洲天堂2016| 日本欧洲一区二区| 成人午夜私人影院| 欧美色老头old∨ideo| 日韩欧美中文字幕一区| 国产精品伦一区二区三级视频| 一区二区不卡在线视频 午夜欧美不卡在| 午夜影院久久久| 国产精品99久久久久久有的能看| 色一情一乱一乱一91av| 日韩欧美aaaaaa| 亚洲日本欧美天堂| 老司机精品视频导航| 99久久精品国产网站| 欧美又粗又大又爽| 亚洲综合在线电影| 首页国产欧美久久| 成人免费看黄yyy456| 欧美人与z0zoxxxx视频| 国产精品午夜久久| 青青草国产成人99久久| 99久久精品国产网站| 日韩欧美在线不卡| 亚洲精品国产一区二区三区四区在线 | 91久久香蕉国产日韩欧美9色| 日韩免费观看高清完整版| 1000部国产精品成人观看| 精久久久久久久久久久| 精品视频在线视频| 国产精品久久久久久久久免费相片 | 日韩欧美专区在线| 亚洲你懂的在线视频| 国产精品99久| 日韩免费观看2025年上映的电影| 亚洲伊人色欲综合网| 成人一区二区三区视频| 99热99精品| 欧美色欧美亚洲另类二区| 国产欧美精品一区aⅴ影院| 午夜精品爽啪视频| 色综合咪咪久久| 日本一区二区电影| 国产美女娇喘av呻吟久久| 欧美一级黄色大片| 性欧美大战久久久久久久久| 色狠狠一区二区三区香蕉| 国产女同性恋一区二区| 极品少妇xxxx偷拍精品少妇| 宅男在线国产精品| 亚洲成在人线在线播放| 色先锋资源久久综合| 亚洲女人的天堂| 99久久亚洲一区二区三区青草| 国产三级三级三级精品8ⅰ区| 久久国产精品99久久久久久老狼 | 久久亚洲一级片| 日韩高清在线电影| 欧美视频一区二区在线观看| 亚洲免费av高清| 成人av免费在线观看| 亚洲国产高清在线| 成人av资源在线| 国产精品久久久久精k8| jvid福利写真一区二区三区| 国产精品三级在线观看| 成人av先锋影音| 亚洲日本在线视频观看| 色狠狠一区二区三区香蕉| 亚洲一区二区在线观看视频| 欧美亚洲国产一区二区三区| 亚洲一区在线观看免费| 欧美日韩日日夜夜| 亚洲v精品v日韩v欧美v专区| 欧美日韩不卡一区二区| 调教+趴+乳夹+国产+精品| 欧美久久久久久久久久| 日本午夜精品视频在线观看| 精品理论电影在线观看| 国产伦精品一区二区三区免费| 精品国产乱码久久久久久1区2区| 国产精品一区在线观看乱码 | 亚洲在线观看免费| 欧美日韩视频在线第一区 | 制服丝袜亚洲播放| 久久99精品久久久久婷婷| 久久久国产综合精品女国产盗摄| 国产99一区视频免费| ...中文天堂在线一区| 91福利精品视频| 奇米精品一区二区三区在线观看一| 精品国产91久久久久久久妲己| 丁香婷婷综合网| 亚洲欧洲日韩女同| 欧美日韩在线播放三区四区| 久久草av在线| 中文字幕亚洲精品在线观看| 欧美日韩国产综合一区二区| 精品一区二区日韩| 中文字幕一区二区三区蜜月| 欧美视频日韩视频| 国产揄拍国内精品对白| 日韩理论在线观看| 欧美一二三四区在线| 成人av在线影院| 午夜精品一区在线观看| 国产网站一区二区| 色老综合老女人久久久| 精品亚洲成a人在线观看| 中文字幕制服丝袜成人av | 欧美激情一区三区| 欧美在线观看视频在线| 国产一区二区女| 一区二区成人在线观看| 久久伊人中文字幕| 91高清在线观看| 国产精品69久久久久水密桃 | 欧美日韩中文字幕精品| 国产麻豆91精品| 亚洲丰满少妇videoshd| 国产欧美精品一区aⅴ影院| 欧美精品一二三四| a美女胸又www黄视频久久| 日本亚洲免费观看| 亚洲四区在线观看| 欧美大尺度电影在线| 在线亚洲一区二区| 韩国女主播一区二区三区| 一区二区免费看| 国产亚洲欧洲997久久综合| 欧美日韩国产免费| 99国产精品久久久| 激情国产一区二区| 日本中文字幕一区二区有限公司| 亚洲色图视频免费播放| 久久奇米777| 日韩一区二区在线观看视频 | 国产精品免费丝袜| 精品国产免费人成在线观看| 欧美军同video69gay| 91蝌蚪国产九色| 成熟亚洲日本毛茸茸凸凹| 老司机精品视频线观看86| 亚洲123区在线观看| 亚洲天堂福利av| 中文字幕va一区二区三区| 久久婷婷国产综合精品青草| 欧美一区二区久久久| 欧洲视频一区二区| 99国产精品久久久久久久久久| 国产福利一区在线| 乱一区二区av| 免费人成精品欧美精品| 亚洲一区二区三区中文字幕| 成人免费一区二区三区在线观看| 国产日韩亚洲欧美综合| 欧美精品一区在线观看| 日韩网站在线看片你懂的| 欧美日韩精品欧美日韩精品| 欧美视频自拍偷拍| 在线一区二区三区做爰视频网站| 99国产精品国产精品毛片| 成人app软件下载大全免费| 床上的激情91.| 欧美国产精品专区| 日韩精品在线一区二区| 欧美一卡在线观看|