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

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關(guān)于我們
? 蟲蟲下載站

?? matching_shifting.cpp

?? 指紋識(shí)別的程序
?? CPP
字號(hào):
/*########################################################################  The contents of this file are subject to the Mozilla Public License  Version 1.0(the "License");   You  may  NOT  use this file except in  compliance with the License. You may obtain a copy of the License at                http:// www.mozilla.org/MPL/  Software distributed under the License is distributed on an "AS IS"  basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See  the License for the specific language governing rights and limitations  under the License.  The Initial Developer of the Original Code is Shivang Patel.  Copyright(C) 2002. All Rights Reserved.  Authors: Shivang Patel           Jaap de Haan(jdh)  ########################################################################*/#ifndef __MATCHING_SHIFTING_CPP__#define __MATCHING_SHIFTING_CPP__#include "fvsimage.h"#include "fvstypes.h"#include "vector.h"#include "matching_shifting.h"typedef struct Shift_t{	uint32_t count;	int32_t shiftval;} Shift_t;template <class itemType>int AddShift(int32_t shiftval, Vector<Shift_t> & shiftstr, uint32_t & lastindex, itemType junk);template <class itemType>uint32_t CountMatching(FvsImage<itemType> & TemplateImg, FvsImage<itemType> & VerifyingImg, int32_t shiftx, int32_t shifty);template <class itemType>void ShiftImage(FvsImage<itemType> & img, int32_t shiftx, int32_t shifty);// Matching using Shifting// This matching algorithm shifts the verifying image left\right and// up\down to find where the most line pixels line up (no pun intended).// This algorithm works only when both images are the same scale and there// is no rotation in either image.// Think of the two images on a transpaceny, moving one on top of the other// most, if not all, of the lines will match up. If they are not the same// fingerprint they do not line up.// // This function will return the percentage of the number of line pixels// that line up over the total number of line pixels there are in the // template image. The calling function should then check this percentage// if it is high enough then it is a correct match. If it is the same image // there should be no shift and 100% should be returned. //// --SPtemplate <class itemType>float_t Match_Shifting(FvsImage<itemType> & TemplateImg, FvsImage<itemType> & VerifyingImg){	uint32_t linecount = 0;			// holds total number of line pixels in template image	uint32_t linecount2 = 0;	int32_t x, y;					// loop variables	int32_t lastx, lasty;				Vector<Shift_t> shiftx, shifty; // vector/array of shift structs, holds the shift values	uint32_t lastxshiftindex = 0;	// holds last index for vector above	uint32_t lastyshiftindex = 0;	// same as above except for y axis vector	int32_t finalxshift = 0;		// the final value we shift on the x-axis	int32_t finalyshift = 0;		// same as above except for y-axis	uint32_t lastcount = 0;	uint32_t finalmatchcount = 0;	// how many line pixels line up after all shift is complet	uint32_t temp;	// first thing is make sure that both images are the same size otherwise return with 0	if ((TemplateImg.width() != VerifyingImg.width()) ||		(TemplateImg.height() != VerifyingImg.height()))	{ 		// Error message\output here		return 0;	}	// find the total number of line pixels in template image, store in linecount variable	for (x = 0; x < (int32_t)TemplateImg.width(); x++)	{		for (y = 0; y < (int32_t)TemplateImg.height(); y++)		{			if (TemplateImg[x][y])				linecount++;		} // for y	} // for x	for (x = 0; x < (int32_t)VerifyingImg.width(); x++)	{		for (y = 0; y < (int32_t)VerifyingImg.height(); y++)		{			if (VerifyingImg[x][y])				linecount2++;		}	}	if (lincount < linecount2) linecount = linecount2;	// allocate enought memory for vectors	shiftx.resize(2 * linecount);	shifty.resize(2 * linecount);	// If they are the exact same image, or they match really well without any shifting	// don't bother with the extra work	if (CountMatching(TemplateImg, VerifyingImg, 0, 0) == linecount)		return 100.0;	// now loop through image and find the shifts, first on the x-axis	for (y = 0; y < (int32_t)TemplateImg.height(); y++)	{		for (x = 0; x < (int32_t)TemplateImg.width(); x++)		{			// see if the current pixel is a line pixel, otherwise continue on			if (TemplateImg[x][y])			{				lastx = x;				// move to the left and find first line pixel in verifying image				while ((lastx >= 0) && (VerifyingImg[lastx][y] != COLOR_LINE))					// we have not yet found a line pixel continue to look					lastx--;				// either we have found a line pixel or we have reached the end				if (lastx >= 0)					// we have found a line pixel add the difference between					// the Temlate Image pixel and the Verifying Image pixel, 					// this is the shift value					AddShift(-(x - lastx), shiftx, lastxshiftindex, 0);				// Now find the first line pixel going to the right				lastx = x + 1;				while ((lastx < (int32_t)VerifyingImg.width()) && (VerifyingImg[lastx][y] != COLOR_LINE))					// we have not yet found a line pixel continue to look					lastx++;				// either we have found a line pixel or we have reached the end 				if (lastx < (int32_t)VerifyingImg.width())					// we have found a line pixel add the difference between 					// the template image pixel and the verifying image pixel					// this is the shift value					AddShift((lastx - x), shiftx, lastxshiftindex, 0);			} // if current pixel is line pixel		} // for x	} //for y	// now find the shift on the y-axis	for (x = 0; x < (int32_t)TemplateImg.width(); x++)	{		for (y = 0; y < (int32_t)TemplateImg.height(); y++)		{			// make sure the current pixel is a line piel			if (TemplateImg[x][y])			{				lasty = y;								// find the shift foing up				while ((lasty >= 0) && (VerifyingImg[x][lasty] != COLOR_LINE))					// we have not yet found a line pixel continue to look					lasty--;				// either we have found a line pixel or we have reached the end				if (lasty >= 0)					// we have found a line pixel add the difference between 					// the template image pixel and the verifying image pixel					// this is the shift value					AddShift(-(y - lasty), shifty, lastyshiftindex, 0);				// now find the shift going down				lasty = y + 1;				while ((lasty < (int32_t)VerifyingImg.height()) && (VerifyingImg[x][lasty] != COLOR_LINE))					// we have not yet found a line pixel continue to look					lasty++;				// either we have found a line pixel or we have reached the end				if (lasty < (int32_t)VerifyingImg.height())					// we have found a line pixel add the difference between					// the template image pixel and the verifying image pixel					// this is the shift value					AddShift((lasty - y), shifty, lastyshiftindex, 0);			} // current pixel a line pixel ?		} // for y	} // for x	// find best shift values	for (x = 0; x < (int32_t)lastxshiftindex; x++)	{		if ((shiftx[x].shiftval != 0) && (shiftx[x].count > 20) &&			((temp = CountMatching(TemplateImg, VerifyingImg, shiftx[x].shiftval, 0)) > lastcount))		{			finalxshift = shiftx[x].shiftval;			lastcount = temp;		}	}		// now find best shift on y-axis	//lastcount = 0;	for (y = 0; y < (int32_t)lastyshiftindex; y++)	{		if ((shifty[y].shiftval != 0) && (shifty[y].count > 20) && 			((temp = CountMatching(TemplateImg, VerifyingImg, finalxshift, shifty[y].shiftval)) > lastcount))		{			finalyshift = shifty[y].shiftval;			lastcount = temp;		}	}			// now shift image according to the shift values we found above	ShiftImage(VerifyingImg, finalxshift, finalyshift);	// calculate how many line pixels match up	finalmatchcount = CountMatching(TemplateImg, VerifyingImg, 0, 0);			// print exact values, this is more for testing purposes	printf("Shift Matching: Exact values: number matching: %d out of: %d\n", finalmatchcount, linecount);	// return the % of line pixels that match up over the total number of line pixels in the template image	return finalmatchcount * 100.0/linecount;}// this adds a shift value to the vector, but first makes sure that the value does// not already exist. If the value does exist it increments the count value // of the shift value instead of adding the shift value//// Side note: the junk variable is there because I have to make the function a template function// the reason is because Match_Shifting needs to be template class because it uses FvsImage class,// and since I want to keep similar functions together in the same file, this function must be a// template function. The same problems occurs for the BitmapWriteHeader() function in fmt_bitmap.cpp// If anyone knows how to fix this please let me know // --SPtemplate <class itemType>int AddShift(int32_t shiftval, Vector<Shift_t> & shiftstr, uint32_t & lastindex, itemType junk){	for (uint32_t i = 0; i < lastindex; i++)	{		// see if the value already exists		if (shiftstr[i].shiftval == shiftval)		{			shiftstr[i].count++;			return 0; // 0 means nothing was added to the vector		}	} // for i	// we have not yet exited so the value must not already exist in the vector	// so add it. First make sure we don't go beyond the size of vector 	if (lastindex >= shiftstr.size())		// Add 10 slots to the vector so we don't take up too much memory		shiftstr.resize(shiftstr.size() + 10);	shiftstr[lastindex].shiftval = shiftval;	shiftstr[lastindex].count = 0;	lastindex++;	return 1; // one item added to the vector	}// This function loops through the two images and finds how many line pixels match up // with the new shift valuestemplate <class itemType>uint32_t CountMatching(FvsImage<itemType> & TemplateImg, FvsImage<itemType> & VerifyingImg, int32_t shiftx, int32_t shifty){	int32_t MatchesFound = 0;	uint32_t x, y, startx, starty, endx, endy;	startx = ((shiftx < 0)?0:shiftx);	starty = ((shifty < 0)?0:shifty);	endx = TemplateImg.width() + ((shiftx < 0)?shiftx:0);	endy = TemplateImg.height() + ((shifty < 0)?shifty:0);	for (x = startx; x < endx; x++)	{		for (y = starty; y < endy; y++)		{			// don't do anything unless it is a line pixel			if (((x + shiftx) >= 0) && ((x + shiftx) < VerifyingImg.width()) &&				((y + shifty) >= 0) && ((y + shifty) < VerifyingImg.height()) &&				(TemplateImg[x][y]) && (VerifyingImg[x + shiftx][y + shifty]))				MatchesFound++;		} // for y	} // for x	return MatchesFound;}// Works better with a seperate function then in the code especially since // we are going to make a copy of the image, once the function exits the// variables destory itself, freeing up memory. template <class itemType>void ShiftImage(FvsImage<itemType> & img, int32_t shiftx, int32_t shifty){	uint32_t x, y;	FvsImage<itemType> imgcopy = img;	for (x = 0; x < imgcopy.width(); x++)	{		for (y = 0; y < imgcopy.height(); y++)		{			// don't do anything unless it is a line pixel			if (((x + shiftx) >= 0) && ((x + shiftx) < imgcopy.width()) &&				((y + shifty) >= 0) && ((y + shifty) < imgcopy.height()))				img[x][y] = imgcopy[x + shiftx][y + shifty];			else				img[x][y] = COLOR_BACKGROUND;		} // for y	} // for x}#endif // __MATCHING_SHIFTING_CPP__

?? 快捷鍵說明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號(hào) Ctrl + =
減小字號(hào) Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
亚洲一区二区三区不卡国产欧美| 韩国一区二区三区| 亚洲男同1069视频| 国产凹凸在线观看一区二区| 蜜桃视频一区二区三区在线观看| 亚洲成a人v欧美综合天堂 | 亚洲成人精品一区| 亚洲自拍偷拍麻豆| 亚洲chinese男男1069| 亚洲6080在线| 日本sm残虐另类| 国产美女精品在线| 成人在线综合网| 91亚洲永久精品| 欧洲一区二区三区免费视频| 欧美日韩国产片| 日韩区在线观看| 久久色视频免费观看| 日本一区二区三区在线不卡| 亚洲欧美综合另类在线卡通| 一区二区欧美在线观看| 日韩av网站免费在线| 国内精品在线播放| 成人激情黄色小说| 欧美综合在线视频| 日韩欧美久久久| 欧美激情综合网| 亚洲一二三区不卡| 美女国产一区二区三区| 成人免费视频播放| 欧美一a一片一级一片| 91精品国产色综合久久| 国产色综合久久| 亚洲精品国产a久久久久久| 日韩精品视频网| 国产精品66部| 在线精品视频免费播放| 日韩欧美一级在线播放| 国产精品色在线| 亚洲不卡av一区二区三区| 久久国产精品99精品国产| 波多野结衣中文字幕一区二区三区 | 99这里只有精品| 欧美高清精品3d| 亚洲国产精品二十页| 亚洲国产色一区| 国产精品亚洲成人| 欧美探花视频资源| 久久九九久精品国产免费直播| 亚洲激情男女视频| 国产真实乱子伦精品视频| 欧美性xxxxx极品少妇| 久久久久久久久99精品| 亚洲国产日韩a在线播放| 国产九色sp调教91| 欧美欧美欧美欧美| 中文字幕在线不卡国产视频| 蜜桃在线一区二区三区| 91女厕偷拍女厕偷拍高清| 精品免费视频.| 亚洲成人动漫精品| 99久久综合99久久综合网站| 日韩欧美亚洲一区二区| 一区二区理论电影在线观看| 国产盗摄精品一区二区三区在线 | 欧美日韩色一区| 久久久久久99久久久精品网站| 亚洲国产精品综合小说图片区| 成人永久aaa| 欧美mv日韩mv国产网站app| 亚洲综合成人在线视频| av资源站一区| 久久嫩草精品久久久精品| 日一区二区三区| 色老综合老女人久久久| 国产精品网友自拍| 国模套图日韩精品一区二区| 欧美久久久影院| 夜夜揉揉日日人人青青一国产精品| 国产精品123区| www成人在线观看| 喷白浆一区二区| 欧美高清视频一二三区| 亚洲在线视频免费观看| 97se亚洲国产综合自在线观| 国产日韩欧美不卡| 国产激情一区二区三区| 2021中文字幕一区亚洲| 麻豆精品一区二区av白丝在线 | 亚洲免费观看在线视频| 成人av中文字幕| 欧美激情中文不卡| 粉嫩久久99精品久久久久久夜 | 丝袜诱惑制服诱惑色一区在线观看| 99久久国产综合精品色伊| 国产精品久久久久一区| www.亚洲激情.com| 亚洲国产精品精华液2区45| 国产精品18久久久久久久久久久久 | 制服丝袜在线91| 天天av天天翘天天综合网 | 国产婷婷色一区二区三区| 国产在线播放一区三区四| 欧美sm极限捆绑bd| 国产精品一区在线观看乱码| 久久久亚洲精品石原莉奈| 国产精品综合久久| 欧美激情综合在线| 91香蕉国产在线观看软件| 中文字幕在线不卡一区二区三区| 99re视频这里只有精品| 亚洲精品写真福利| 91成人网在线| 视频一区二区中文字幕| 欧美电影免费观看高清完整版在| 精品一区二区三区欧美| 国产三级欧美三级日产三级99| 国产成都精品91一区二区三| 国产精品美女久久久久aⅴ国产馆| 成人精品gif动图一区| 亚洲视频资源在线| 精品视频在线免费看| 日韩精品成人一区二区三区| 欧美成人欧美edvon| 成人性视频网站| 亚洲综合激情另类小说区| 日韩午夜精品视频| 国产成人av影院| 亚洲综合一区二区| 欧美精品免费视频| 国产九九视频一区二区三区| 国产精品国产三级国产普通话99| 日本韩国欧美国产| 青青草原综合久久大伊人精品| 久久久久久久久久久久久夜| 色哟哟欧美精品| 麻豆精品国产91久久久久久| 国产香蕉久久精品综合网| 91蜜桃网址入口| 日本系列欧美系列| 中文字幕国产一区| 欧美日韩在线播放| 国产精品白丝jk白祙喷水网站 | 成人精品小蝌蚪| 亚洲一区日韩精品中文字幕| 日韩欧美国产综合在线一区二区三区| 丁香啪啪综合成人亚洲小说| 亚洲一区二区三区精品在线| 337p日本欧洲亚洲大胆精品| 色综合天天综合网天天看片 | 91精品在线免费观看| 国产成人夜色高潮福利影视| 一级女性全黄久久生活片免费| 欧美电视剧在线看免费| 色综合久久久久综合体| 久久成人羞羞网站| 亚洲女同ⅹxx女同tv| 26uuu精品一区二区| 91国偷自产一区二区开放时间 | 国产盗摄女厕一区二区三区| 亚洲第一电影网| 国产精品女同互慰在线看| 911国产精品| 99re在线视频这里只有精品| 国产一区二区三区在线观看免费视频| 亚洲另类中文字| 国产欧美日韩综合| 欧美一级久久久久久久大片| 91尤物视频在线观看| 国产一区二区三区电影在线观看| 亚洲综合一区二区三区| 国产精品无码永久免费888| 日韩三级伦理片妻子的秘密按摩| 91国模大尺度私拍在线视频| 成人精品视频一区| 国产一区二区三区不卡在线观看| 午夜精品视频一区| 一区二区三区在线高清| 中文字幕一区免费在线观看| 久久日韩精品一区二区五区| 欧美一级黄色大片| 欧美三日本三级三级在线播放| 9色porny自拍视频一区二区| 国产成人av福利| 精品一区二区成人精品| 蜜桃一区二区三区在线| 日韩专区在线视频| 亚洲自拍欧美精品| 亚洲综合激情小说| 一区二区三区精密机械公司| 中文字幕中文在线不卡住| 国产欧美一区二区三区沐欲| 精品国产污污免费网站入口| 欧美一区二区日韩| 欧美男女性生活在线直播观看| 色94色欧美sute亚洲线路二| 一本一道波多野结衣一区二区| 成人18精品视频| 91视频在线观看免费| 99久精品国产|