From 3354618de890bb7002d22e6e0af077b82ee9bcba Mon Sep 17 00:00:00 2001 From: "bob.pan" Date: Sat, 9 Oct 2021 11:21:09 +0800 Subject: [PATCH] =?UTF-8?q?=E7=AE=97=E6=B3=95=E8=B0=83=E6=95=B4=E5=9C=86?= =?UTF-8?q?=E5=BF=83=E5=AE=9A=E4=BD=8D=E6=96=B9=E6=B3=95=20=E6=B3=A8?= =?UTF-8?q?=E5=86=8C=E7=A0=81=E5=A2=9E=E5=8A=A0=E6=B3=A8=E5=86=8C=E4=BF=A1?= =?UTF-8?q?=E6=81=AF=E8=AE=B0=E5=BD=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/algorithm/ImageProcess.cpp | 15 +++++++++++++++ src/tpMain/cryptokey/lpCryptokey.cpp | 11 +++++++++++ 2 files changed, 26 insertions(+) diff --git a/src/algorithm/ImageProcess.cpp b/src/algorithm/ImageProcess.cpp index fb5b78e..f551549 100644 --- a/src/algorithm/ImageProcess.cpp +++ b/src/algorithm/ImageProcess.cpp @@ -70,10 +70,17 @@ cv::Mat ImageProcess::findCircle(const Mat &srcImg, Point2f& center, double &rad int nIndex = -1; float centerX = 0; float centerY = 0; + double tmpmaxR = 0; for (int i = 0; i < EDCircle.size(); i++) { int startX = EDCircle[i].center.x - EDCircle[i].r; int startY = EDCircle[i].center.y - EDCircle[i].r; + if (EDCircle[i].r > tmpmaxR) + { + centerX = EDCircle[i].center.x * REAIZE; + centerY = EDCircle[i].center.y * REAIZE; + tmpmaxR = EDCircle[i].r; + } if (startX < 0 || startY < 0) continue; if (EDCircle[i].center.x + EDCircle[i].r > bBaseX || EDCircle[i].center.y + EDCircle[i].r > bBaseY) @@ -204,10 +211,18 @@ cv::Mat ImageProcess::findCircleByBackground(const Mat &srcImg, const Mat& backg int nIndex = -1; float centerX = 0; float centerY = 0; + double tmpmaxR = 0; for (int i = 0; i < EDCircle.size(); i++) { int startX = EDCircle[i].center.x - EDCircle[i].r; int startY = EDCircle[i].center.y - EDCircle[i].r; + if (EDCircle[i].r > tmpmaxR) + { + centerX = EDCircle[i].center.x * REAIZE; + centerY = EDCircle[i].center.y * REAIZE; + tmpmaxR = EDCircle[i].r; + } + if (startX < 0 || startY < 0) continue; if (EDCircle[i].center.x + EDCircle[i].r > bBaseX || EDCircle[i].center.y + EDCircle[i].r > bBaseY) diff --git a/src/tpMain/cryptokey/lpCryptokey.cpp b/src/tpMain/cryptokey/lpCryptokey.cpp index 4f38d13..ff66ae0 100644 --- a/src/tpMain/cryptokey/lpCryptokey.cpp +++ b/src/tpMain/cryptokey/lpCryptokey.cpp @@ -87,6 +87,15 @@ bool lpCheckKey::checkLinese() } QSettings settingKey("Leaper_Register"); QString strKey = settingKey.value("key").toString(); + bool bRegister = settingKey.value("register", false).toBool(); + QString serialNo = settingKey.value("serialNo").toString(); + if (m_SerialNo != serialNo) + { + if (bRegister == true) + { + return true; + } + } QByteArray lineseData = genLinese(m_SerialNo.toLatin1()); if (lineseData == strKey) @@ -102,6 +111,8 @@ bool lpCheckKey::checkLinese(QString serialNo, QString linese) { QSettings settingKey("Leaper_Register"); settingKey.setValue("key", linese); + settingKey.setValue("register", true); + settingKey.setValue("serialNo", serialNo); return true; } else