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

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

?? aadaptthresh.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"
#define __AUTOMATIC__
 
//extern "C"{
//	#include "HighGUI.h"
//}


static char cTestName[] = "Image Adaptive Thresholding";
static char cTestClass[] = "Algorithm";
static char cFuncName[] = "cvAdaptThreshold";
static int	aAdaptThreshold()
{

    CvPoint *cp;
//  CvPoint cp[] ={0,0, 5,5, 5,0, 0,5};
//  CvPoint cp[] ={5,0, 10,5, 5,10, 0,5};
//	CvPoint cp[] ={0,0, 5,5, 5,0, 10,5, 10,0, 15,5, 15,0};
    int width = 128;
    int height = 128;
    int kp = 5;
    int nPoints2 = 20;

    int fi = 0;
    int a2 = 20;
    int b2 = 25,xc,yc;

    double pi = 3.1415926;

	double lower, upper;
   	unsigned seed;
    char rand;
	AtsRandState state;

	long diff_binary, diff_binary_inv, diff_to_zero, diff_to_zero_inv;
    
    int l,i,j;

    IplImage *imBinary, *imBinary_inv, *imTo_zero, *imTo_zero_inv, *imInput, *imOutput;
    CvSize size;

    int code = TRS_OK;

//  read tests params 
    if(!trsiRead( &width, "128", "image width" ))
        return TRS_UNDEF;
    if(!trsiRead( &height, "128", "image height" ))
        return TRS_UNDEF;

//  initialized image
    l = width*height*sizeof(uchar);

    cp = (CvPoint*) trsmAlloc(nPoints2*sizeof(CvPoint));

    xc = (int)( width/2.);
    yc = (int)( height/2.);

    kp = nPoints2;

    size.width = width;
    size.height = height;

    int xmin = width;
    int ymin = height;
    int xmax = 0;
    int ymax = 0;
	
	
    for(i=0;i<nPoints2;i++)
    {
        cp[i].x = (int)(a2*cos(2*pi*i/nPoints2)*cos(2*pi*fi/360.))-
        (int)(b2*sin(2*pi*i/nPoints2)*sin(2*pi*fi/360.))+xc;
        if(xmin> cp[i].x) xmin = cp[i].x;
        if(xmax< cp[i].x) xmax = cp[i].x;
        cp[i].y = (int)(a2*cos(2*pi*i/nPoints2)*sin(2*pi*fi/360.))+
                    (int)(b2*sin(2*pi*i/nPoints2)*cos(2*pi*fi/360.))+yc;
        if(ymin> cp[i].y) ymin = cp[i].y;
        if(ymax< cp[i].y) ymax = cp[i].y;
    }

    if(xmax>width||xmin<0||ymax>height||ymin<0) return TRS_FAIL;
    
//  IPL image moment calculation  
//  create image  
	imBinary = atsCreateImage( size.width,  size.height,   IPL_DEPTH_8U, 1, 0 );
	imBinary_inv = atsCreateImage( size.width,  size.height,   IPL_DEPTH_8U, 1, 0 );
	imTo_zero = atsCreateImage( size.width,  size.height,   IPL_DEPTH_8U, 1, 0 );
	imTo_zero_inv = atsCreateImage( size.width,  size.height,   IPL_DEPTH_8U, 1, 0 );
	imOutput = atsCreateImage( size.width,  size.height,   IPL_DEPTH_8U, 1, 0 );

    imInput = atsCreateImage( size.width,  size.height,   IPL_DEPTH_8U, 1, 0 );

	int bgrn = 50;
	int signal = 150;
	
    memset(imInput->imageData,bgrn,l);

//    CVL_CHECK(ippiFillPoly8uC1R((uchar*)Iplimage->imageData, Iplimage->widthStep, size, cp, kp, color1));

    cvFillPoly(imInput, &cp, &kp, 1, signal);

//  do noise   
    upper = 22;
    lower = -upper;
    seed = 345753;
    atsRandInit( &state, lower, upper, seed );

	
//	named_window("input image", 1);
//	named_window("binary image", 1);

	uchar *input = (uchar*)imInput->imageData;
	uchar *binary = (uchar*)imBinary->imageData;
	uchar *binary_inv = (uchar*)imBinary_inv->imageData;
	uchar *to_zero = (uchar*)imTo_zero->imageData;
	uchar *to_zero_inv = (uchar*)imTo_zero_inv->imageData;
	double *parameter = (double*)trsmAlloc(2*sizeof(double));

	int step = imInput->widthStep;

    for(i = 0; i<size.height; i++, input+=step, binary+=step, binary_inv+=step, to_zero+=step,to_zero_inv+=step)
    {
		 for(j = 0; j<size.width; j++)
         {
			    atsbRand8s( &state, &rand, 1);   
//				rand = 0;   
				if(input[j] == bgrn) 
				{
					binary[j] = to_zero[j] = (uchar)0;
					binary_inv[j] = (uchar)255;
					to_zero_inv[j] = input [j] = (uchar)(bgrn + rand);
				}
				else 
				{
					binary[j] = (uchar)255;
					binary_inv[j] = to_zero_inv[j] = (uchar)0;
					to_zero[j] = input[j] = (uchar)(signal + rand);
				}
		
         }
    }



//				CV_THRESH_BINARY       - val = (val > Thresh ? MAX    : 0)
//	minDisp = (double)45;
	parameter[0] = (double)2;  
	parameter[1] = (double)50; 
	
	cvAdaptiveThreshold( imInput, imOutput, (double)255, CV_STDDEV_ADAPTIVE_THRESH, CV_THRESH_BINARY, parameter); 
	diff_binary = atsCompare1Db( (uchar*)imOutput->imageData, (uchar*)imBinary->imageData, l, 5);

//	show_iplimage("input image", imInput);
//	show_iplimage("binary image", imOutput);
//	wait_key(0);


//                  CV_THRESH_BINARY_INV   - val = (val > Thresh ? 0      : MAX)
	cvAdaptiveThreshold( imInput, imOutput, (double)255, CV_STDDEV_ADAPTIVE_THRESH, CV_THRESH_BINARY_INV, parameter); 
	diff_binary_inv = atsCompare1Db( (uchar*)imOutput->imageData, (uchar*)imBinary_inv->imageData, l, 5);

//                  CV_THRESH_TOZERO       - val = (val > Thresh ? val    : 0)
	cvAdaptiveThreshold( imInput, imOutput, (double)255, CV_STDDEV_ADAPTIVE_THRESH, CV_THRESH_TOZERO, parameter); 
	diff_to_zero = atsCompare1Db( (uchar*)imOutput->imageData, (uchar*)imTo_zero->imageData, l, 5);

//                  CV_THRESH_TOZERO_INV   - val = (val > Thresh ? 0      : val)
	cvAdaptiveThreshold( imInput, imOutput, (double)255, CV_STDDEV_ADAPTIVE_THRESH, CV_THRESH_TOZERO_INV, parameter); 
	diff_to_zero_inv = atsCompare1Db( (uchar*)imOutput->imageData, (uchar*)imTo_zero_inv->imageData, l, 5);

    if(diff_binary > 5 || diff_binary_inv > 5 || diff_to_zero > 5 || diff_to_zero_inv > 5) code = TRS_FAIL;  

	
	atsReleaseImage(imInput);
	atsReleaseImage(imOutput);
	atsReleaseImage(imBinary);
	atsReleaseImage(imBinary_inv);
	atsReleaseImage(imTo_zero);
	atsReleaseImage(imTo_zero_inv);


//	destroy_window("input image");
//	destroy_window("binary image");


    trsWrite( ATS_CON | ATS_LST | ATS_SUM, "diff_binary =%ld \n", diff_binary); 
	trsWrite( ATS_CON | ATS_LST | ATS_SUM, "diff_binary_inv =%ld \n", diff_binary_inv); 
	trsWrite( ATS_CON | ATS_LST | ATS_SUM, "diff_to_zero =%ld \n", diff_to_zero); 
	trsWrite( ATS_CON | ATS_LST | ATS_SUM, "diff_to_zero_inv =%ld \n", diff_to_zero_inv); 

    trsFree(parameter);
    trsFree(cp);
//    _getch();    
    return code;
}


void InitAAdaptThreshold( void )
{
/* Test Registartion */
    trsReg(cFuncName,cTestName,cTestClass,aAdaptThreshold); 
} /* InitAAdaptThreshold */

/* End of file. */

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
奇米色一区二区| 国产三级一区二区三区| 亚洲国产精品久久久久婷婷884| 91美女福利视频| 自拍偷拍国产精品| 在线观看av不卡| 麻豆传媒一区二区三区| 久久婷婷国产综合精品青草| 懂色中文一区二区在线播放| 亚洲日本丝袜连裤袜办公室| 欧美亚洲日本一区| 久久成人综合网| 国产欧美精品一区二区三区四区 | 国产99久久久久久免费看农村| 国产欧美一区二区精品性色超碰 | 色一情一伦一子一伦一区| 亚洲成人一区二区在线观看| 5858s免费视频成人| 国产一级精品在线| 亚洲精品国产a| 日韩你懂的在线观看| 成人av资源网站| 日本不卡1234视频| 欧美国产日韩在线观看| 欧美性感一类影片在线播放| 免费看欧美女人艹b| 国产精品理论片| 91精品国产一区二区三区蜜臀| 精品无人码麻豆乱码1区2区| 综合婷婷亚洲小说| 精品免费国产二区三区 | 精品视频在线看| 国产成人啪午夜精品网站男同| 一区二区三区视频在线观看| 久久影院电视剧免费观看| 欧美影院一区二区三区| 国产成人福利片| 图片区小说区国产精品视频| 日本一二三不卡| 日韩欧美综合一区| 色妞www精品视频| 国产精品一级在线| 日本不卡中文字幕| 一区二区三区四区乱视频| 日韩免费成人网| 91国在线观看| 成人动漫一区二区| 国产一区免费电影| 天天操天天综合网| 亚洲人123区| 国产三级精品在线| 日韩精品一区二区三区老鸭窝| 色94色欧美sute亚洲线路一久| 国产一区二区0| 久久99精品一区二区三区三区| 亚洲精品综合在线| 中文字幕在线一区免费| 精品国产1区二区| 日韩一区二区三区电影在线观看 | 555夜色666亚洲国产免| 欧美三级一区二区| 欧美在线视频全部完| 色综合一个色综合亚洲| 99国内精品久久| 国产精品综合在线视频| 九九九久久久精品| 老司机一区二区| 日韩av中文字幕一区二区| 午夜精品123| 日韩精品成人一区二区三区| 亚洲国产精品久久人人爱| 一区二区三区中文在线| 亚洲精品乱码久久久久久日本蜜臀| 日本一区二区高清| 一区二区中文视频| 亚洲色图都市小说| 亚洲蜜桃精久久久久久久| 亚洲欧美色综合| 一区二区三区免费| 亚洲自拍另类综合| 午夜日韩在线观看| 日本成人在线不卡视频| 激情综合色综合久久| 国产电影一区在线| 成人伦理片在线| 在线亚洲高清视频| 7777精品伊人久久久大香线蕉的 | 国产精品福利一区二区| 亚洲美女在线国产| 亚洲国产成人精品视频| 日本免费在线视频不卡一不卡二| 蜜桃久久av一区| 九九国产精品视频| 成人中文字幕电影| 91网上在线视频| 欧美高清一级片在线| 正在播放亚洲一区| 久久男人中文字幕资源站| 欧美激情在线一区二区三区| 亚洲欧美日韩电影| 婷婷六月综合网| 狠狠狠色丁香婷婷综合久久五月| 国产盗摄一区二区三区| 日本电影欧美片| 日韩女优视频免费观看| 国产清纯在线一区二区www| 亚洲精品一卡二卡| 免费精品视频在线| 成人深夜在线观看| 欧美三级电影一区| 国产欧美一区视频| 亚洲sss视频在线视频| 国产精品影音先锋| 欧美午夜不卡视频| 国产天堂亚洲国产碰碰| 亚洲一区在线视频观看| 国产一区二区三区免费| 日本韩国欧美一区| 久久久99久久| 污片在线观看一区二区| 成人白浆超碰人人人人| 日韩欧美一区电影| 亚洲午夜影视影院在线观看| 国产专区欧美精品| 在线观看av一区| 国产精品色哟哟网站| 欧美aaa在线| 在线免费观看成人短视频| 久久精品欧美一区二区三区不卡 | 亚洲日本免费电影| 精品在线一区二区| 欧美日韩小视频| 国产精品美女久久久久久2018| 日韩精品成人一区二区三区| 一本色道久久加勒比精品| 久久午夜老司机| 天使萌一区二区三区免费观看| 不卡一卡二卡三乱码免费网站| 日韩精品一区二区三区中文不卡| 一区二区三区欧美视频| 国产白丝网站精品污在线入口| 欧美理论片在线| 亚洲综合久久av| 色综合天天综合色综合av| 国产午夜精品一区二区| 精品一区二区三区免费| 在线成人免费视频| 夜夜嗨av一区二区三区四季av| 国产美女在线观看一区| 欧美变态口味重另类| 日本视频中文字幕一区二区三区| 色婷婷狠狠综合| 亚洲精品久久嫩草网站秘色| av一区二区三区黑人| 中文幕一区二区三区久久蜜桃| 久久精品国产澳门| 日韩欧美中文字幕一区| 天天操天天干天天综合网| 91久久精品国产91性色tv| 亚洲视频每日更新| 日本高清不卡一区| 一区二区免费看| 欧美性感一区二区三区| 午夜精品一区在线观看| 欧美日韩国产成人在线91| 婷婷综合久久一区二区三区| 欧美蜜桃一区二区三区| 日韩在线一二三区| 欧美一区二区三区在线看| 免费在线欧美视频| 日韩一区二区三区免费观看| 理论电影国产精品| 精品国产麻豆免费人成网站| 国产高清视频一区| 国产视频一区二区在线| 国产不卡免费视频| 日韩久久一区二区| 欧洲精品在线观看| 午夜精品在线视频一区| 欧美一区二区三区免费在线看 | 亚洲午夜精品在线| 欧美精品丝袜久久久中文字幕| 奇米影视一区二区三区| 久久久精品国产免大香伊| 国产成人h网站| 一区二区三区美女| 911精品国产一区二区在线| 美脚の诱脚舐め脚责91| 2021久久国产精品不只是精品| 高清日韩电视剧大全免费| 亚洲蜜臀av乱码久久精品蜜桃| 欧美午夜精品电影| 久久成人免费网| 亚洲欧美怡红院| 在线不卡的av| 国产美女视频91| 一区二区在线观看免费| 日韩一二在线观看| heyzo一本久久综合| 五月婷婷综合网|