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

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

?? pixeltopixelmorpher.cpp

?? 微軟的基于HMM的人臉識別原代碼, 非常經典的說
?? CPP
?? 第 1 頁 / 共 4 頁
字號:
/*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 "SubdivMorpher.h"
#include <malloc.h>
#include <assert.h>
#include <memory.h>
#include <stdio.h>
#include <math.h>

#define MAX_DIFFERENCE 20
#define COEFF_OCC 30
#define COEFF_MATCH 30
#define COEFF_MATCH_2 64
#define END_OF_PATH 1000000000

#define MAX3(xxx1,xxx2,xxx3) ( ( ( (xxx1) > (xxx2) ) && ( (xxx1) > xxx3 ) ) ? (xxx1) : ( ( (xxx2) > (xxx3) ) ? (xxx2) : (xxx3) ) )
#define MAX2(xxx1,xxx2) ( ( (xxx1) > (xxx2) ) ? (xxx1) : (xxx2) )
#define MIN3(xxx1,xxx2,xxx3) ( ( ( (xxx1) < (xxx2) ) && ( (xxx1) < xxx3 ) ) ? (xxx1) : ( ( (xxx2) < (xxx3) ) ? (xxx2) : (xxx3) ) )
#define MIN2(xxx1,xxx2) ( ( (xxx1) < (xxx2) ) ? (xxx1) : (xxx2) )

// This function allocates memory for FindFullCorr function
//      width               - width of image
//      height              - height of image
//      type                - type of memory for allocate ( the size of memory depends on it )
//      maxPixelDifference  - maximum value of pixel difference on two images
int* CCvPixelToPixelMorpher::corrAlloc( int width, int height, corrArrayType type, int maxPixelDifference )
{
    int* pointer;
    switch( type )
    {
    case CORR_ARRAY:
        {
            pointer = ( int* ) malloc( width * height * 2 * sizeof( int ) );
        }
        break;
    case NUM_CORR_ARRAY:
        {
            pointer = ( int* ) malloc( height * sizeof( int ) );
        }
        break;
    case CORR_EDGES:
        {
            int i;
            int width_1 = width - 1;

            pointer = ( int* ) malloc( width * 2 * sizeof( int ) );
            for( i = 0; i < width; i ++ ) {
                pointer[ i * 2 ]      = i - maxPixelDifference;
                pointer[ i * 2 + 1 ]  = i + maxPixelDifference;
            } // for( i = 0; i < width; i ++ )
            for( i = 0; i < width; i ++ ) {
                if( pointer[ i * 2 ] < 0 ) {
                    pointer[ i * 2 ]      = 0;
                }
                if( pointer[ i * 2 + 1 ] >= width ) {
                    pointer[ i * 2 + 1 ]  = width_1;
                }
            } // for( i = 0; i < width; i ++ )

        } // case CORR_EDGES:
        break;
    case CORR_TEMP:
        {
            pointer = ( int* ) malloc( width * width * 4 * sizeof( int ) );
        }
        break;
    default:
        {
            pointer = 0;
        }

    } // switch( type )

    return pointer;
} // corrAlloc

// This function searches correspondences for full image
//      _leftImage              - pointer to 3-channel left image
//      _leftLineStep           - size of one line on the left image in bytes
//      _rightImage             - pointer to 3-channel right image
//      _rightLineStep          - size of one line on the right image in bytes
//      _corrArray              - output integer array of correspondences ( size (width)X(height)X(2) ).
//                                each element of its array consists of two integer values, one of
//                                which represents number of pixel on the left image and the other
//                                corresponding to it point on the right image
//      _numCorrArray           - output array with numbers of finded correspondences on each line
//      width                   - width of images
//      height                  - height of images
//      maxPixelDifference      - maximum value of pixel difference on two images
void CCvPixelToPixelMorpher::FindFullCorr( unsigned char* _leftImage,
                   int _leftLineStep,
                   unsigned char* _rightImage,
                   int _rightLineStep,
                   int* _corrArray,
                   int* _numCorrArray,
                   int width,
                   int height,
                   int maxPixelDifference
                 )
{
    //int     width2 = width * width;
    //int     tempMemorySize = width2 * 4 * sizeof( int );
    int*    tempMemory;

    tempMemory  = corrAlloc( width, height, CORR_TEMP );

    int*    edges   = corrAlloc( width, height, CORR_EDGES, maxPixelDifference );

    int j;

    // lines cycle - processes each line
    for( j = 0; j < height; j ++ )
    {
        FindCorr( _leftImage + _leftLineStep * j,
                  _rightImage + _rightLineStep * j,
                  _corrArray + width * 2 * j,
                  _numCorrArray + j,
                  width,
                  edges,
                  tempMemory
                );
    } // for( j = 0; j < height; j ++ )

    free( edges );
    free( tempMemory );

} // FindFullCorr

// This function searches correspondence for one line only
//      _leftLine
void CCvPixelToPixelMorpher::FindCorr( unsigned char* _leftLine,
               unsigned char* _rightLine,
               int* _corrArray,
               int* numCorrArray,
               int width,
               int* edges,
               int* tempArray
             )
{
    int     width2      = width * width;
    int     width_1     = width - 1;
    int*    xArray      = tempArray;                // array, which shows the best previous point in path
    int*    yArray      = tempArray + width2;       // array, which shows the best previous point in path
    int*    costArray   = tempArray + width2 * 2;   // array of costs table
    int*    distArray   = tempArray + width2 * 3;   // array of distances between points on two images

    int blockSize = width2 * sizeof( int );
    memset( ( void* ) xArray, 0, blockSize );               // filling by zero
    memset( ( void* ) yArray, 0, blockSize );               // filling by zero
    memset( ( void* ) distArray, 0, blockSize );            // filling by zero

    int i;
    int j;
    int iTemp;
    int jTemp;

    int currCost;
    int bestHorCost;

    int srcOffset;
    int destOffset;
    int futureCost;

    // filling cost table by very big value ( initialization )
    for( j = 0; j < width; j ++ )
    {
        for( i = edges[ j * 2 ]; i <= edges[ j * 2 + 1 ]; i ++ )
        {
            costArray[ j * width + i ] = 2000000000;    // filling by very big value

        } // for( i = edges[ j * 2 ]; i < edges[ j * 2 + 1 ]; i ++ )

    } // for( j = 0; j < width; j ++ )

    // computing distances for all pairs of points ( between points on left image and on right image )
    for( j = 0; j < width; j ++ )
    {
        for( i = edges[ j * 2 ]; i <= edges[ j * 2 + 1 ]; i ++ )
        {
            distArray[ j * width + i ] = distance( _leftLine, _rightLine, width, j, i );

        } // for( i = edges[ j * 2 ]; i < edges[ j * 2 + 1 ]; i ++ )

    } // for( j = 0; j < width; j ++ )

    // filling left upper corner
    for( i = edges[ 0 ]; i <= edges[ 1 ]; i ++ )
    {
        // horizontal line
        xArray[ i ]             = END_OF_PATH;
        costArray[ i ]          = *( distArray + i );
        // vertical line
        xArray[ i * width ]     = END_OF_PATH;
        costArray[ i * width ]  = *( distArray + i * width );
    } // for( i = edges[ 0 ]; i <= edges[ 1 ]; i ++ )

    // normal dynamic programming
    for( j = 0; j < width_1; j ++ )
    {
        bestHorCost = costArray[ j * width + edges[ j * 2 ] ];
        //bestHorCost = 2000000000;
        for( i = edges[ j * 2 ]; i <= edges[ j * 2 + 1 ]; i ++ )
        {
            srcOffset   = j * width + i;
            currCost    = costArray[ srcOffset ];
            if( currCost - COEFF_MATCH < bestHorCost + COEFF_OCC )
            {
                bestHorCost = currCost;

                // filling the next horizontal line

                // first point
                if( i != width - 1 )
                {
                    destOffset  = j * width + ( i + width + 1 );
                    futureCost  = currCost + distArray[ destOffset ];
                    if( ( xArray[ srcOffset ] == i - 1 ) && ( yArray[ srcOffset ] == j - 1 ) ) {
                        futureCost -= COEFF_MATCH;
                    }
                    if( ( xArray[ srcOffset ] != i - 1 ) || ( yArray[ srcOffset ] != j - 1 ) ) {
                        futureCost -= COEFF_MATCH_2;
                    }
                    if( costArray[ destOffset ] >= futureCost ) {
                        costArray[ destOffset ]     = futureCost;
                        xArray[ destOffset ]        = i;
                        yArray[ destOffset ]        = j;
                    }
                }
                // residuary points ( if they exist )
                for( iTemp = i + 2; iTemp <= edges[ j * 2 + 3 ]; iTemp ++ )
                {
                    destOffset  = j * width + ( iTemp + width );
                    futureCost  = currCost + COEFF_OCC + distArray[ destOffset ];
                    if( costArray[ destOffset ] >= futureCost ) {
                        costArray[ destOffset ]     = futureCost;
                        xArray[ destOffset ]        = i;
                        yArray[ destOffset ]        = j;
                    }

                } // for( iTemp = i + 2; iTemp <= edges[ j * 2 + 3 ]; iTemp ++ )

            } // if( currCost - COEFF_MATCH < bestHorCost + COEFF_OCC )

            // filling the next vertical line
            if( i != width_1 )
            {
                for( jTemp = j + 2; jTemp <= edges[ i * 2 + 3 ]; jTemp ++ )
                {
                    destOffset  = jTemp * width + ( i + 1 );
                    futureCost  = currCost + COEFF_OCC + distArray[ destOffset ];

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
亚洲欧美电影院| 激情六月婷婷久久| 麻豆精品久久精品色综合| 国产精品一卡二卡| 欧美日韩免费不卡视频一区二区三区| 日韩网站在线看片你懂的| 亚洲欧美日韩中文播放| 国产一区二区三区精品欧美日韩一区二区三区 | 91亚洲永久精品| 欧美一级夜夜爽| 夜夜揉揉日日人人青青一国产精品 | 北条麻妃一区二区三区| 欧美mv日韩mv| 日韩中文字幕一区二区三区| 91丝袜美腿高跟国产极品老师| 精品久久一区二区| 日韩av高清在线观看| 欧美主播一区二区三区美女| 国产日产欧产精品推荐色| 免费成人美女在线观看.| 欧美无人高清视频在线观看| 国产精品久久久久影院亚瑟| 美脚の诱脚舐め脚责91| 欧美欧美欧美欧美| 亚洲成人黄色影院| 色婷婷综合激情| 中文字幕免费观看一区| 国内精品伊人久久久久av影院 | 91精品国产91热久久久做人人| 亚洲精品第一国产综合野| 99久久综合99久久综合网站| 久久久国产综合精品女国产盗摄| 男男视频亚洲欧美| 欧美一卡二卡三卡四卡| 日韩av在线发布| 欧美久久久久久久久| 日韩中文欧美在线| 欧美日韩色一区| 天天av天天翘天天综合网色鬼国产 | 在线观看国产91| 夜夜夜精品看看| 欧美三级乱人伦电影| 亚洲永久免费av| 欧美日韩精品一区二区三区四区 | 久久精品欧美一区二区三区不卡| 狠狠色综合色综合网络| 国产丝袜在线精品| av爱爱亚洲一区| 亚洲成人激情自拍| 精品99一区二区三区| 国产高清在线精品| 亚洲柠檬福利资源导航| 欧美日韩视频在线观看一区二区三区 | 国产91精品露脸国语对白| 国产人久久人人人人爽| 99久久精品国产毛片| 亚洲综合色网站| 日韩三级在线观看| 丰满少妇在线播放bd日韩电影| 国产精品美女久久久久久久久 | 中文字幕一区二区在线播放 | 成人免费三级在线| 亚洲国产一区二区三区青草影视| 欧美一区二区二区| 国产成人8x视频一区二区| 亚洲男女一区二区三区| 91精品国产日韩91久久久久久| 国产乱码一区二区三区| 亚洲精品亚洲人成人网| 制服丝袜亚洲精品中文字幕| 国产成人三级在线观看| 亚洲国产毛片aaaaa无费看| 欧美tickling网站挠脚心| av亚洲产国偷v产偷v自拍| 日韩福利视频网| 日韩一区欧美小说| 精品粉嫩超白一线天av| 在线免费观看日本欧美| 国产高清不卡一区二区| 99视频一区二区三区| 亚洲一区av在线| 国产午夜精品一区二区三区四区| 欧美无砖专区一中文字| 国产一区二区在线视频| 性欧美疯狂xxxxbbbb| 国产精品无圣光一区二区| 91精品一区二区三区在线观看| 不卡的av电影在线观看| 久热成人在线视频| 亚洲不卡在线观看| 亚洲男人的天堂在线aⅴ视频| 久久综合九色综合欧美就去吻| 在线亚洲免费视频| 成人免费视频caoporn| 久久爱另类一区二区小说| 一区二区成人在线| 1024亚洲合集| 中文字幕av资源一区| 久久夜色精品一区| 日韩欧美一区二区在线视频| 色婷婷av一区二区三区gif| 粉嫩av一区二区三区在线播放 | 国产a级毛片一区| 久久99日本精品| 日韩成人一级大片| 亚洲一区二区三区三| 亚洲精品视频免费观看| 综合在线观看色| 国产精品视频yy9299一区| 国产校园另类小说区| 国产日韩欧美麻豆| 久久综合狠狠综合久久激情| 亚洲bdsm女犯bdsm网站| 一区二区三区产品免费精品久久75| 国产精品久久久久影院老司| 国产精品乱码久久久久久| 欧美国产日韩一二三区| 国产精品午夜在线观看| 日本一区二区三区四区在线视频| 久久久久久久免费视频了| 久久久蜜桃精品| 国产亚洲精品7777| 中文字幕五月欧美| 亚洲情趣在线观看| 亚洲精品国产视频| 午夜精品福利一区二区蜜股av| 亚洲国产婷婷综合在线精品| 天天影视色香欲综合网老头| 美女视频网站黄色亚洲| 久久成人久久鬼色| 成人综合婷婷国产精品久久免费| 成人黄色av电影| 一本到不卡免费一区二区| 欧美性色欧美a在线播放| 欧美福利电影网| 久久综合久久综合亚洲| 国产精品人成在线观看免费| 亚洲精品国产品国语在线app| 午夜一区二区三区视频| 久久99久久99| 91在线一区二区| 欧美日韩国产免费一区二区| 26uuu色噜噜精品一区| 中文字幕在线不卡一区二区三区| 一区二区三区免费在线观看| 欧美亚洲一区二区在线| 在线播放视频一区| 久久久无码精品亚洲日韩按摩| 最近日韩中文字幕| 日韩精品每日更新| 国产成人久久精品77777最新版本 国产成人鲁色资源国产91色综 | 国产精品免费视频网站| 亚洲一区二区综合| 国产一区二区精品久久99| 91视频国产观看| 欧美一区二区国产| 亚洲天堂免费在线观看视频| 日精品一区二区| 成人av高清在线| 日韩三级高清在线| 亚洲色图在线看| 国内精品视频一区二区三区八戒| 色综合久久中文综合久久97| 日韩一级免费一区| 玉足女爽爽91| 国产精品77777| 欧美一区二区视频在线观看2022| 国产精品乱码人人做人人爱 | 久久精品99国产精品| 一本大道久久a久久精二百| 欧美mv和日韩mv国产网站| 亚洲在线观看免费| 99精品视频免费在线观看| 精品乱人伦小说| 亚洲成人在线免费| 91麻豆精品秘密| 欧美经典一区二区| 九九国产精品视频| 欧美日本韩国一区二区三区视频| 国产精品成人免费 | 日韩成人精品在线| 在线一区二区三区四区五区| 久久久精品综合| 蜜桃av噜噜一区| 欧美日本高清视频在线观看| 一区二区三区视频在线看| 成人国产视频在线观看| 久久亚洲私人国产精品va媚药| 日本不卡在线视频| 欧美日韩国产美| 亚洲午夜视频在线观看| 在线观看国产一区二区| 亚洲欧美日韩久久| 99国产精品久久久| 国产精品福利影院| 91视频一区二区| 一区二区成人在线| 欧美日韩国产成人在线免费| 一区二区在线观看av| 欧洲精品一区二区三区在线观看|