本文整理匯總了C#中System.Drawing.PointF.Zip方法的典型用法代碼示例。如果您正苦於以下問題:C# PointF.Zip方法的具體用法?C# PointF.Zip怎麽用?C# PointF.Zip使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類System.Drawing.PointF
的用法示例。
在下文中一共展示了PointF.Zip方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C#代碼示例。
示例1: FindHomography
public static Func<PointF[], PointF[]> FindHomography(PointF[] ccs, PointF[] pcs)
{
var hg = Emgu.CV.CameraCalibration.FindHomography(ccs, pcs, HOMOGRAPHY_METHOD.DEFAULT, 2);
var t = ccs.Select(c => new PointF(c.X, c.Y)).ToArray();
hg.ProjectPoints(t);
var tes = pcs.Zip(t, (a, b) => (b.X - a.X) * (b.X - a.X) + (b.Y - a.Y) * (b.Y - a.Y)).ToArray();
var sum = tes.Sum();
return (ps) =>
{
var psc = ps.Select(p => new PointF(p.X, p.Y)).ToArray();
hg.ProjectPoints(psc);
return psc;
};
}
示例2: Different
public static bool Different(PointF[] a, PointF[] b, float thresh = 400)
{
if (b == null || a == null)
return true;
var diff = a.Zip(b, (ap, bp) => Math.Abs(ap.X - bp.X) + Math.Abs(ap.Y - bp.Y)).Sum();
return diff > thresh;
}