From d36a57f14b402043f9ada53f22d2aa2e8ef73ecc Mon Sep 17 00:00:00 2001 From: liuyebo <1515783401@qq.com> Date: Thu, 8 Aug 2024 14:28:58 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96=E6=89=B9=E9=87=8F=E6=B6=82?= =?UTF-8?q?=E6=8A=B9=E6=B5=8B=E8=AF=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- photo_mask_batch_error_check.py | 19 +++++++++++++++---- 1 file changed, 15 insertions(+), 4 deletions(-) diff --git a/photo_mask_batch_error_check.py b/photo_mask_batch_error_check.py index e7ad757..04796b5 100644 --- a/photo_mask_batch_error_check.py +++ b/photo_mask_batch_error_check.py @@ -6,12 +6,23 @@ from photo_mask_error_check import check_error if __name__ == '__main__': session = MysqlSession() + # 对涂抹错误的进行测试比较 ocr_errors = (session.query(ZxIeOcrerror.pk_phrec, ZxIeOcrerror.cXm, ZxIeOcrerror.cSfzh, ZxIeOcrerror.cfjaddress) .filter(ZxIeOcrerror.checktime.is_(None)).order_by(ZxIeOcrerror.pk_phrec.desc()).limit(50).all()) + + # 对已涂抹的进行测试比较 + # ocr_errors = (session.query(ZxPhrec.pk_phrec, ZxPhhd.cXm, ZxPhhd.cSfzh, ZxPhrec.cfjaddress) + # .join(ZxPhrec, ZxPhhd.pk_phhd == ZxPhrec.pk_phhd, isouter=True) + # .filter(ZxPhhd.paint_flag >= '8') + # .order_by(ZxPhrec.pk_phrec.desc()) + # .limit(50).all()) session.close() for ocr_error in ocr_errors: - image = check_error(ocr_error) - if image is None: - continue - cv2.imwrite(f"./mask_optimization_result/{ocr_error.cfjaddress}.jpg", image) + try: + image = check_error(ocr_error) + if image is None: + continue + cv2.imwrite(f"./mask_optimization_result/{ocr_error.cfjaddress}.jpg", image) + except Exception as e: + print(e)