From c8d991a8d6431ae32ce8545042bf6b6913234fe8 Mon Sep 17 00:00:00 2001 From: Rcmcpe Date: Fri, 13 Nov 2020 23:29:47 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BB=A3=E7=A0=81=E9=A3=8E=E6=A0=BC:=20?= =?UTF-8?q?=E5=9C=A8=E6=9B=B4=E5=A4=9A=E7=9A=84=E5=9C=B0=E6=96=B9=E4=BD=BF?= =?UTF-8?q?=E7=94=A8=E7=9B=AE=E6=A0=87=E5=9E=8B=E5=8C=96=E8=A1=A8=E8=BE=BE?= =?UTF-8?q?=E5=BC=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Auto Arknights Core/CV/FeatureMatcher.cs | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/Auto Arknights Core/CV/FeatureMatcher.cs b/Auto Arknights Core/CV/FeatureMatcher.cs index 7d08e9c..befd53a 100644 --- a/Auto Arknights Core/CV/FeatureMatcher.cs +++ b/Auto Arknights Core/CV/FeatureMatcher.cs @@ -83,8 +83,7 @@ public bool Match(MatFeature mf, MatFeature of, out Rectangle rect) Point2f[] mCorners = { - new Point2f(0, 0), new Point2f(mf.OriginWidth, 0), new Point2f(mf.OriginWidth, mf.OriginHeight), - new Point2f(0, mf.OriginHeight) + new(0, 0), new(mf.OriginWidth, 0), new(mf.OriginWidth, mf.OriginHeight), new(0, mf.OriginHeight) }; Point2f[] mCornersFt = Cv2.PerspectiveTransform(mCorners, homography); @@ -139,10 +138,7 @@ private static int VoteForSizeAndOrientation(KeyPoint[] modelKeyPoints, KeyPoint int[] histSize = { scaleBinSize, rotationBins }; int[] channels = { 0, 1 }; - Rangef[] ranges = - { - new Rangef(scaleRanges[0], scaleRanges[1]), new Rangef(rotations.Min(), rotations.Max()) - }; + Rangef[] ranges = { new(scaleRanges[0], scaleRanges[1]), new(rotations.Min(), rotations.Max()) }; Mat[] arrs = { scalesMat, rotationsMat }; Cv2.CalcHist(arrs, channels, null, hist, 2, histSize, ranges);