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

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

?? matching_shifting.cpp

?? 指紋識別程序 源代碼。。。。。 Vc開發
?? CPP
字號:
/*########################################################################  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__

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
亚洲国产精品一区二区www| 国产午夜精品一区二区三区嫩草| 国产精品资源网| 久久国产精品一区二区| 热久久一区二区| 蜜臀a∨国产成人精品| 免费观看在线综合色| 美女视频第一区二区三区免费观看网站| 天天免费综合色| 日韩高清在线电影| 日本aⅴ免费视频一区二区三区| 日韩精品亚洲一区| 蜜臀av在线播放一区二区三区| 日本不卡1234视频| 国产成人精品亚洲777人妖| 成人丝袜18视频在线观看| 99精品热视频| 欧美日韩不卡视频| 精品日韩一区二区三区免费视频| 2023国产精品自拍| 国产精品久久久爽爽爽麻豆色哟哟| 国产精品你懂的| 亚洲永久精品国产| 国产一区福利在线| 91热门视频在线观看| 欧美最新大片在线看| 日韩女优电影在线观看| 亚洲国产激情av| 亚洲va在线va天堂| 国产精品一区二区视频| 在线观看视频一区| 久久丝袜美腿综合| 亚洲午夜一区二区三区| 国产一区二区久久| 欧美影院一区二区三区| 久久综合一区二区| 亚洲成人高清在线| 成人精品一区二区三区四区| 欧美日韩综合在线免费观看| www国产亚洲精品久久麻豆| 亚洲一区二区在线免费看| 蜜臀av亚洲一区中文字幕| 色综合中文字幕| 日韩欧美国产wwwww| 亚洲一区二区三区国产| 成人少妇影院yyyy| 日韩欧美一区二区不卡| 夜夜嗨av一区二区三区四季av | 国产精品嫩草99a| 丝袜亚洲另类丝袜在线| 99国产一区二区三精品乱码| 日韩精品一区二区三区三区免费| 亚洲日本在线天堂| 国产suv精品一区二区883| 在线播放中文一区| 亚洲精品国产无天堂网2021| 成人精品国产一区二区4080| 日韩欧美资源站| 日日噜噜夜夜狠狠视频欧美人| 99国产精品久久久久| 国产欧美日韩麻豆91| 精品亚洲porn| 精品理论电影在线观看| 蜜桃视频一区二区| 在线成人免费视频| 丝袜美腿亚洲一区| 欧美日韩精品一区二区三区| 亚洲综合色噜噜狠狠| 91在线精品秘密一区二区| 欧美激情艳妇裸体舞| 国产米奇在线777精品观看| 日韩欧美国产一区在线观看| 日本成人超碰在线观看| 欧美精品第一页| 日日夜夜精品视频天天综合网| 在线视频一区二区免费| 一区二区三区av电影| 欧美系列在线观看| 午夜欧美2019年伦理| 91精品久久久久久久99蜜桃| 日韩黄色小视频| 日韩一区二区三区四区五区六区 | 麻豆91精品视频| 精品盗摄一区二区三区| 国产真实乱子伦精品视频| 亚洲精品一区二区三区在线观看| 久久91精品国产91久久小草| 精品日韩一区二区| 成人中文字幕合集| 国产精品国产三级国产a| 91欧美一区二区| 亚洲国产综合91精品麻豆| 欧美一区二区三区在线观看| 国产一区二区三区在线观看免费| 久久九九全国免费| av一区二区三区在线| 亚洲国产成人tv| 欧美精品一区二区蜜臀亚洲| 国产成+人+日韩+欧美+亚洲| 又紧又大又爽精品一区二区| 69久久99精品久久久久婷婷| 国产在线麻豆精品观看| 亚洲最新在线观看| 日韩女优电影在线观看| 本田岬高潮一区二区三区| 亚洲综合在线免费观看| 欧美电影免费观看完整版| 成人国产电影网| 男人的j进女人的j一区| 中文字幕av一区二区三区免费看 | 国产偷国产偷精品高清尤物| 成人app网站| 免费国产亚洲视频| 亚洲日本成人在线观看| 日韩欧美一级二级三级 | 一区二区三区鲁丝不卡| 日韩一区二区精品| 91社区在线播放| 国产九色精品成人porny| 一区二区三区欧美| 国产性天天综合网| 欧美一区二区三区视频免费| 成人开心网精品视频| 久久国产生活片100| 亚洲狠狠爱一区二区三区| 亚洲国产精品99久久久久久久久| 91麻豆精品国产91久久久资源速度 | 成人欧美一区二区三区小说| 91精品国产色综合久久久蜜香臀| av成人老司机| 国产成人高清在线| 久久国内精品自在自线400部| 亚洲成人免费av| 樱花草国产18久久久久| 亚洲欧洲日韩在线| 中文字幕精品三区| 国产亚洲一区二区三区在线观看| 日韩一级精品视频在线观看| 一本色道久久综合精品竹菊| av在线播放一区二区三区| 国产成人免费视频| 国产精品夜夜爽| 国产成人久久精品77777最新版本| 蜜臀av国产精品久久久久| 偷拍一区二区三区四区| 午夜久久电影网| 视频在线观看一区二区三区| 日韩成人午夜精品| 天堂在线亚洲视频| 天天综合日日夜夜精品| 石原莉奈一区二区三区在线观看| 亚洲国产另类av| 五月天久久比比资源色| 亚洲国产精品久久久久秋霞影院 | 国产免费久久精品| 欧美精品一区二区精品网| 久久亚洲春色中文字幕久久久| 精品不卡在线视频| 久久久精品人体av艺术| 国产欧美一区二区三区网站| 欧美激情一区二区| 一区二区三区不卡视频| 婷婷开心久久网| 蜜臀av性久久久久蜜臀aⅴ | 亚洲高清久久久| 日韩二区三区四区| 欧美a级一区二区| 国产乱对白刺激视频不卡 | 亚洲精品老司机| 丝袜美腿亚洲色图| 韩国三级中文字幕hd久久精品| 高清日韩电视剧大全免费| av中文字幕亚洲| 欧美日韩一区二区三区免费看| 这里只有精品99re| 国产日韩精品一区二区浪潮av| 国产精品久久久久久妇女6080| 亚洲日韩欧美一区二区在线| 日韩中文字幕区一区有砖一区| 久久成人免费日本黄色| 成人黄动漫网站免费app| 在线免费亚洲电影| 欧美成人一级视频| 中文字幕一区二区在线观看| 五月天久久比比资源色| 国产成人a级片| 欧美日韩精品一区二区三区 | 久久91精品久久久久久秒播| 国产成人精品一区二区三区四区 | 美日韩一区二区| 91香蕉国产在线观看软件| 日韩一区二区三区免费观看| 一区免费观看视频| 精品一区二区三区免费观看| 色诱亚洲精品久久久久久| 日韩精品一区二区三区蜜臀| 亚洲美女屁股眼交3| 国产精品亚洲视频| 91精品国产高清一区二区三区蜜臀 | 欧美午夜在线一二页|