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