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

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

?? asm.cpp

?? 這是個人臉識別程序
?? CPP
字號:
// $masm\asm.cpp 1.5 milbo$ utilities for active contour models// Warning: this is raw research code -- expect it to be quite messy.// milbo durban dec05//-----------------------------------------------------------------------------// This program is free software; you can redistribute it and/or modify// it under the terms of the GNU General Public License as published by// the Free Software Foundation; either version 2 of the License, or// (at your option) any later version.//// This program is distributed in the hope that it will be useful,// but WITHOUT ANY WARRANTY; without even the implied warranty of// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the// GNU General Public License for more details.//// A copy of the GNU General Public License is available at// http://www.r-project.org/Licenses///-----------------------------------------------------------------------------#include "all.hpp"//-----------------------------------------------------------------------------bool fPointUsed (const SHAPE &Shape, int iPoint){return Shape(iPoint, VX) != 0 || Shape(iPoint, VY) != 0;}//-----------------------------------------------------------------------------int nGetNbrUsedPoints (const SHAPE &Shape, int nPoints){int nUsed = 0;for (int iPoint = 0; iPoint < nPoints; iPoint++)	if (fPointUsed(Shape, iPoint))		nUsed++;return nUsed;}//-----------------------------------------------------------------------------// This allocates *pfUnused, and the caller must free itstatic void SaveUnusedPoints (bool **ppfUnused,						// out								const SHAPE &Shape, int nrows)		// in{bool *pfUnused = (bool *)malloc(nrows * sizeof(bool *));*ppfUnused = pfUnused;for (int iRow = 0; iRow < nrows; iRow++)	*pfUnused++ = !fPointUsed(Shape, iRow);}//-----------------------------------------------------------------------------static void RestoreUnusedPoints (SHAPE &Shape, 							// out									const bool afUnused[], int nrows)	// in{for (int iRow = 0; iRow < nrows; iRow++)	if (afUnused[iRow])		{		Shape(iRow, VX) = 0;		Shape(iRow, VY) = 0;		}}//-----------------------------------------------------------------------------// This returns the Euclidean distance between the same point in two different shapesdouble PointDist (const SHAPE &Shape1, const SHAPE &Shape2, const int iPoint){return sqrt(SQR(Shape1(iTranslatedPoint(iPoint), VX) - Shape2(iTranslatedPoint(iPoint), VX)) +            SQR(Shape1(iTranslatedPoint(iPoint), VY) - Shape2(iTranslatedPoint(iPoint), VY)));}//-----------------------------------------------------------------------------// This returns the Euclidean distance between two points in a shapedouble PointDist (const SHAPE &Shape, const int iPoint1, const int iPoint2){return sqrt(SQR(Shape(iTranslatedPoint(iPoint1), VX) - Shape(iTranslatedPoint(iPoint2), VX)) +            SQR(Shape(iTranslatedPoint(iPoint1), VY) - Shape(iTranslatedPoint(iPoint2), VY)));}//-----------------------------------------------------------------------------// This returns a vector of the distances between corresponding points in Shape1 and Shape2SHAPE ShapeDist (const SHAPE &Shape1, const SHAPE &Shape2){CheckSameDim(Shape1, Shape2, "ShapeDist");Vec OutShape(Shape1.nrows());for (int iRow = 0; iRow < Shape1.nrows(); iRow++)	OutShape(iRow) = PointDist(Shape1, Shape2, iRow);return OutShape;}//-----------------------------------------------------------------------------// Multiply a Nx2 matrix (the InShape) by a 3x3 homogenous TransformMat// This knows about unused landmarks, and leaves them untouched// Returned result is the transformed InShape.SHAPE TransformShape (const SHAPE &InShape, const Mat &TransformMat){DASSERT(InShape.ncols() == 2);DASSERT(TransformMat.ncols() == 3 && TransformMat.nrows() == 3);static SHAPE OutShape; OutShape.assign(InShape);	// static for efficiencyint iRow = InShape.nrows();while (iRow--)	if (fPointUsed(InShape, iRow))		{		MatView Row(OutShape.row(iRow));		Row = TransformMat.mat33TimesVec2(Row);		}return OutShape;}//-----------------------------------------------------------------------------// Align Shape to to AnchorShape, overwrite Shape// This knows about unused landmarks in AnchorShape and Shape, and leaves them untouched// See also algorithm C.3 in Appendix C of CootesTaylor 2004 www.isbe.man.ac.uk/~bim/Models/app_models.pdf//// Returns the transformation matrix i.e. the pose, but also updates Shape//// This is a similarity transform so the transform matrix has the form//		a -b  Tx//		b  a  Ty//		0  0  1//// Make pWeights equal to NULL if you don't want to weight the landmarks.  NULL is the default.Mat AlignShape (SHAPE &Shape, 									// io  				const SHAPE &AnchorShape, const Vec *pWeights)	// in{CheckSameNbrRows(Shape, AnchorShape, "AlignShape");if (pWeights)	ASSERT(Shape.nrows() == pWeights->nelems());double X1 = 0, Y1 = 0, X2 = 0, Y2 = 0, W = 0, Z = 0, C1 = 0, C2 = 0;int iRow = Shape.nrows();while (iRow--)	{	double x1 = AnchorShape(iRow, VX);	double y1 = AnchorShape(iRow, VY);	double x2 = Shape(iRow, VX);	double y2 = Shape(iRow, VY);	if (x1 == 0 && y1 == 0)			// is anchor landmark unused?		;							// get here if AnchorShape is BioId/AR but Shape is not, used when aligning AvShape to BioId/Ar	else if (x2 == 0 && y2 == 0)	// is landmark unused?		;							// get here if AnchorShape is not BioId/AR but Shape is BioId	else		{		double w = (pWeights? (*pWeights)(iRow): 1.0);		W  += w;		Z  += w * (x2 * x2 + y2 * y2);		X1 += w * x1;		Y1 += w * y1;		X2 += w * x2;		Y2 += w * y2;		C1 += w * (x1 * x2 + y1 * y2);		C2 += w * (y1 * x2 - x1 * y2);		}	}double SolnData[] = { X2, -Y2,   W,   0,				      Y2,  X2,   0,   W,				 	   Z,	0,	X2,  Y2,				 	   0,	Z, -Y2,  X2 };MatView Mat4(SolnData, 4, 4, 0);			// 4x4, tda=0double  VecData[] = { X1, Y1, C1, C2 };VecView Vec4(VecData, 4);Vec	Soln(SolveWithLU(Mat4, Vec4));double TransformData[] = { Soln(0), -Soln(1), Soln(2),					 	   Soln(1),  Soln(0), Soln(3),    				       0, 	     0,       1 };Mat Transform(TransformData, 3, 3);Shape = TransformShape(Shape, Transform);return Transform;}//-----------------------------------------------------------------------------// Align Shape to to AnchorShape, overwrite Shape.// Based on algorithm C.4 in Appendix C of CootesTaylor 2004 www.isbe.man.ac.uk/~bim/Models/app_models.pdf//// Returns the transformation matrix i.e. the pose, but also updates Shape//// This is a similarity transform so the transform matrix has the form//		a  c  Tx//		b  d  Ty//		0  0  1//// Weighted alignment not yet supported// Unused point code is buggyMat AlignShape_Affine (SHAPE &Shape, 					// io			  				const SHAPE &AnchorShape)	// in{CheckSameNbrRows(Shape, AnchorShape, "AlignShape_Affine");double Sx = 0, Sy = 0, Sxx = 0, Syy = 0, Sxy = 0;double SAx = 0, SAy = 0, SAxx = 0, SAyy = 0, SAxy = 0, SAyx = 0;for (int i = 0; i < Shape.nrows(); i++)	{	double x1 = AnchorShape(i, VX);	double y1 = AnchorShape(i, VY);	double x2 = Shape(i, VX);	double y2 = Shape(i, VY);	if (x1 == 0 && y1 == 0)			// is anchor landmark unused?		;							// get here if AnchorShape is BioId/AR but Shape is not, used when aligning AvShape to BioId/Ar	else if (x2 == 0 && y2 == 0)	// is landmark unused?		;							// get here if AnchorShape is not BioId/AR but Shape is BioId	else		{		Sx += x2;		Sy += y2;		Sxx += x2 * x2;		Syy += y2 * y2;		Sxy += x2 * y2;		SAx += x1;		SAy += y1;		SAxx += x2 * x1;		SAyy += y2 * y1;		SAxy += x2 * y1;		SAyx += y2 * x1;		}	}double AData[] = { Sxx, Sxy, Sx,	   		 	   Sxy, Syy, Sy,	   		 	   Sx,  Sy,  Shape.nrows() };MatView A(AData, 3, 3, 0);	// 3x3, tda=0// equation 1double  VecData1[] = { SAxx, SAyx, SAx };VecView Vec1(VecData1, 3);Vec	Soln1(SolveWithLU(A, Vec1));		// a b tx// equation 2double  VecData2[] = { SAxy, SAyy, SAy };VecView Vec2(VecData2, 3);Vec	Soln2(SolveWithLU(A, Vec2));		// c y ty// combine the solutionsdouble TransformData[] = { Soln1(0), Soln1(1), Soln1(2),		// a b tx						   Soln2(0), Soln2(1), Soln2(2),		// c d ty    				       0, 	     0,        1 };Mat Transform(TransformData, 3, 3);Shape = TransformShape(Shape, Transform);return Transform;}//-----------------------------------------------------------------------------// Like AlignShape but stretches the shape horizontally looking for a best fit.// Also, this is much slower than AlignShape (it calls AlignShape internally)//// Returns the transformation matrix i.e. the pose, but also updates Shape//// This is a (constrained) affine transform so the transform matrix has the form//		a  b  Tx//		c  d  Ty//		0  0  1//// TODO This routine could be improved I think, this version is just a first cut// There is probably an analytical way of doing this (which would be much faster)Mat AlignShape_Iteration (SHAPE &Shape, 									// io		  					const SHAPE &AnchorShape, const Vec *pWeights)	// in{Check2Cols(Shape, "AlignShape_Iteration Shape");Check2Cols(AnchorShape, "AlignShape_Iteration AnchorShape");CheckSameNbrRows(Shape, AnchorShape, "AlignShape_Iteration");SHAPE OrgShape(Shape);double xBestStretch;// Two pass algorithm: 1st pass does a coarse grained search.  We use two passes for speed.// This is not identical to doing one big search (because there may be more than one// minima?).  But tests show that the search results using the two pass algorithm// are very close to a big one pass algorithm.double xMin = 0.50;		// empirically determined to be a big enough range for AR, BioId, XM2VTS shapesdouble xMax = 2.00;int nIters = 10;double xStretchDelta = (xMax - xMin) / (nIters - 1);double MinDist = FLT_MAX;for (int iter = 0; iter < nIters; iter++)	{	double xStretch = xMin + iter * xStretchDelta;	Shape = OrgShape;	Shape.col(VX) *= xStretch;	Mat Transform = AlignShape(Shape, AnchorShape, pWeights);	double Dist = ShapeDist(Shape, AnchorShape).sum();	if (Dist < MinDist)		{		MinDist = Dist;		xBestStretch = xStretch;		}	}// 2nd pass does a fine grained searchxMin = xBestStretch - xStretchDelta;xMax = xBestStretch + xStretchDelta;nIters *= 2;xStretchDelta = (xMax - xMin) / (nIters - 1);SHAPE BestShape;Mat BestTransform;MinDist = FLT_MAX;for (iter = 0; iter < nIters; iter++)	{	double xStretch = xMin + iter * xStretchDelta;	Shape = OrgShape;	Shape.col(VX) *= xStretch;	Mat Transform = AlignShape(Shape, AnchorShape, pWeights);	double Dist = ShapeDist(Shape, AnchorShape).sum();	if (Dist < MinDist)		{		MinDist = Dist;		BestShape = Shape;		BestTransform = Transform;		BestTransform(0, 0) *= xStretch;		xBestStretch = xStretch;		}	}if (xBestStretch == xMin || xBestStretch == xMax)	Warn("At limit in AlignShape_Iteration %g", xBestStretch);Shape = BestShape;return BestTransform;}//-----------------------------------------------------------------------------// Rotate Shape so it is horizontally/vertically aligned, then centralize it.// Don't change its size.void StraightenAndCentralizeShape (SHAPE &Shape) // io{// TODO This routine has a bug -- it gets confused if not all points are used.// So make sure we don't hit this bug by issuing a sys err if need be.if (nGetNbrUsedPoints(Shape, Shape.nrows() !=  Shape.nrows()))	SysErr("StraightenAndCentralizeShape doesn't work if not all points used");bool *afUnused;int nrows = Shape.nrows();SaveUnusedPoints(&afUnused, Shape, nrows);  		// remember which points are 0,0// rotate shapedouble Theta = 0;double xAv = Shape.col(VX).sum();double yAv = Shape.col(VY).sum();Theta = M_PI/2 + atan2(yAv, xAv);double TransformData[] = { cos(Theta), -sin(Theta), 0,						   sin(Theta), cos(Theta), 	0,						   0, 	       0,           1 };Mat Transform(TransformData, 3, 3);Shape = TransformShape(Shape, Transform);RestoreUnusedPoints(Shape, afUnused, nrows);		// restore original 0,0 points back to 0,0 TODO shouldn't be needed?// centralize shapeint nUsed = nGetNbrUsedPoints(Shape, nrows);xAv = Shape.col(VX).sum() / nUsed;yAv = Shape.col(VY).sum() / nUsed;Shape.col(VX) -= xAv;Shape.col(VY) -= yAv;RestoreUnusedPoints(Shape, afUnused, nrows);		// restore original 0,0 points back to 0,0free(afUnused);}//-----------------------------------------------------------------------------// Centralize shape so its centroid is in the middle of the imagevoid CentralizeShape (SHAPE &Shape) // io{bool *afUnused;int nrows = Shape.nrows();SaveUnusedPoints(&afUnused, Shape, nrows); 		// remember which points are 0,0int nUsed = nGetNbrUsedPoints(Shape, nrows);double xAv = Shape.col(VX).sum() / nUsed;double yAv = Shape.col(VY).sum() / nUsed;Shape.col(VX) -= xAv;Shape.col(VY) -= yAv;RestoreUnusedPoints(Shape, afUnused, nrows);	// restore original 0,0 points back to 0,0free(afUnused);}//-----------------------------------------------------------------------------// Return horizontal extent of the shape i.e. furthest distance in// x direction across the shapedouble xShapeExtent (const SHAPE &Shape){return fabs(Shape.col(VX).maxElem() - Shape.col(VX).minElem());}//-----------------------------------------------------------------------------double yShapeExtent (const SHAPE &Shape){return fabs(Shape.col(VY).maxElem() - Shape.col(VY).minElem());}//-----------------------------------------------------------------------------double GetPyrScale (int iLev, double PyrRatio){return pow(PyrRatio, iLev);}//-----------------------------------------------------------------------------double GetX (double X, int iOffset, int iOrthOffset, double DeltaX, double DeltaY){return X + (iOffset * DeltaX) + (iOrthOffset * DeltaY);}//-----------------------------------------------------------------------------double GetY (double Y, int iOffset, int iOrthOffset, double DeltaX, double DeltaY){return Y + (iOffset * DeltaY) - (iOrthOffset * DeltaX);}

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
国产在线播放一区三区四| 亚洲天堂av老司机| 91麻豆精品国产91久久久使用方法 | 卡一卡二国产精品| 日韩二区三区四区| 精品中文字幕一区二区| 国内精品不卡在线| 国产成人午夜精品影院观看视频| 国产精品自拍三区| 91丨porny丨首页| 欧美性大战久久| 91精品国产综合久久精品麻豆| 欧美精选午夜久久久乱码6080| 欧美一级久久久| 久久久亚洲精品一区二区三区 | 在线观看亚洲a| 69堂成人精品免费视频| 精品少妇一区二区三区在线播放| 久久亚洲综合色一区二区三区| 欧美激情自拍偷拍| 亚洲一区中文日韩| 捆绑调教美女网站视频一区| 国产一区二区免费看| 成人精品鲁一区一区二区| 99re视频精品| 日韩欧美一二区| 国产精品福利在线播放| 天堂久久一区二区三区| 国产精品99久久久久久似苏梦涵| 91麻豆高清视频| 精品毛片乱码1区2区3区| 1000部国产精品成人观看| 视频一区在线播放| 国产成人免费视频网站高清观看视频 | 免费成人你懂的| a在线欧美一区| 欧美一区二区三区婷婷月色| 欧美韩日一区二区三区| 日日夜夜精品视频天天综合网| 国产麻豆午夜三级精品| 欧美日韩国产成人在线91| 中文字幕免费不卡| 久久综合综合久久综合| 91激情在线视频| 国产日韩精品一区二区三区| 日韩精品免费专区| 99国产一区二区三精品乱码| 精品久久久久久久人人人人传媒 | 国产一区二区三区不卡在线观看 | bt7086福利一区国产| 欧美xxx久久| 亚洲一区二区三区四区在线观看 | 国产一区亚洲一区| 欧美日韩一区三区四区| 国产精品成人免费精品自在线观看| 裸体一区二区三区| 欧美日韩一区二区三区高清| 国产精品系列在线| 国产剧情一区二区| 91精品国产综合久久久久| 亚洲欧美韩国综合色| 成人aaaa免费全部观看| 国产精品色在线观看| 久久99精品一区二区三区三区| 欧美日韩一区二区三区在线看| 亚洲人妖av一区二区| www.日本不卡| 成人欧美一区二区三区1314| 高清不卡在线观看av| 久久久国产一区二区三区四区小说 | 国产视频在线观看一区二区三区 | www.日韩精品| 国产精品久久久久久久久图文区 | 久久成人麻豆午夜电影| 3751色影院一区二区三区| 日韩极品在线观看| 日韩一区二区精品| 久久成人久久爱| 国产欧美日韩三区| 91美女片黄在线观看| 亚洲免费观看高清完整版在线| 色欧美片视频在线观看| 亚洲最大成人网4388xx| 欧美日韩在线播放三区| 日韩精品欧美成人高清一区二区| 欧美一级在线免费| 国产麻豆成人传媒免费观看| 中文字幕免费不卡| 91福利在线播放| 美女国产一区二区三区| 国产亚洲成av人在线观看导航| 成人aaaa免费全部观看| 亚洲国产成人va在线观看天堂 | 国产成人av资源| 国产精品久久久久久福利一牛影视 | 国产精品久久久久久久裸模| 色激情天天射综合网| 日本在线播放一区二区三区| 精品久久久久av影院 | 麻豆成人91精品二区三区| 久久精品男人的天堂| 91极品美女在线| 久久66热偷产精品| 亚洲色图在线播放| 在线不卡的av| av电影在线观看一区| 丝袜亚洲另类丝袜在线| 欧美精彩视频一区二区三区| 欧美日韩精品系列| 国产精品1区2区3区在线观看| 一区二区三区不卡在线观看 | 亚洲欧美在线aaa| 51午夜精品国产| 国产乱码一区二区三区| 亚洲一区免费在线观看| 久久久五月婷婷| 51精品久久久久久久蜜臀| 成人免费视频播放| 奇米精品一区二区三区在线观看| 国产精品成人一区二区三区夜夜夜| 欧美日韩国产综合一区二区| 成人免费观看av| 懂色av一区二区夜夜嗨| 午夜精品一区在线观看| 国产精品国产精品国产专区不蜜 | 北条麻妃一区二区三区| 日本美女一区二区三区| 亚洲女与黑人做爰| 久久久国际精品| 日韩欧美精品三级| 91精品国产一区二区| 色成人在线视频| 成人福利视频网站| 久久99精品国产麻豆不卡| 天天亚洲美女在线视频| 一区二区三区在线观看网站| 国产精品视频你懂的| 久久亚洲捆绑美女| 26uuu精品一区二区三区四区在线 26uuu精品一区二区在线观看 | 蜜臀av性久久久久蜜臀av麻豆| 亚洲六月丁香色婷婷综合久久 | 国产午夜精品一区二区| 欧美成人国产一区二区| 精品少妇一区二区三区免费观看 | 成人av电影免费在线播放| 国产成人免费在线观看不卡| 国产成人在线视频播放| 成人网在线播放| 波多野结衣在线aⅴ中文字幕不卡| 高清视频一区二区| 成人av在线网| 99久久免费国产| 色哦色哦哦色天天综合| 欧美日免费三级在线| 欧美日韩国产综合一区二区| 欧美精品久久一区二区三区| 6080亚洲精品一区二区| 欧美成人一区二区| 久久精品在这里| 国产精品久久久久久久裸模 | 欧美日韩成人一区| 制服丝袜亚洲播放| 欧美不卡视频一区| 久久久久国产精品免费免费搜索| 久久久午夜精品| 亚洲色大成网站www久久九九| 亚洲男帅同性gay1069| 亚洲第一成人在线| 国内精品嫩模私拍在线| 不卡的av电影在线观看| 色噜噜狠狠成人网p站| 制服.丝袜.亚洲.另类.中文 | 亚洲天堂成人网| 亚洲va国产天堂va久久en| 久久99国产精品免费| www.在线成人| 欧美精品免费视频| 国产欧美日韩亚州综合| 一区二区三区蜜桃网| 美女一区二区在线观看| 国产成a人亚洲| 在线亚洲免费视频| 日韩欧美专区在线| 国产精品日韩精品欧美在线 | 久久综合精品国产一区二区三区 | 国产成人精品aa毛片| 99视频一区二区| 日韩欧美色综合网站| 亚洲黄色片在线观看| 韩国欧美国产1区| 欧美影片第一页| 欧美经典一区二区三区| 亚洲国产aⅴ天堂久久| 懂色av一区二区三区免费观看| 欧美日本一区二区三区四区| 国产夜色精品一区二区av| 天堂午夜影视日韩欧美一区二区| caoporen国产精品视频| 26uuu国产日韩综合| 亚洲国产精品久久艾草纯爱|