he2802 1 yıl önce
ebeveyn
işleme
64bce90e79

+ 10 - 2
zhongzheng-system/src/main/java/com/zhongzheng/modules/tencentcloud/service/impl/FaceOcrServiceImpl.java

@@ -115,16 +115,24 @@ public class FaceOcrServiceImpl implements IFaceOcrService {
             faceRequest.setImage(bo.getImageA()); //学习拍照
             DetectFaceResponse response = iaiClient.DetectFace(faceRequest);
             FaceInfo[] face = response.getFaceInfos();
-            if(face[0].getFaceQualityInfo().getBrightness().intValue()<30){
+            if(face[0].getFaceQualityInfo().getBrightness().intValue()<25){
+                log.info("照片光照不达标"+face[0].getFaceQualityInfo().getBrightness().intValue());
                 throw new CustomException("照片光照不达标"+face[0].getFaceQualityInfo().getBrightness().intValue());
             }
-            if(face[0].getFaceQualityInfo().getScore().intValue()<40){
+            if(face[0].getFaceQualityInfo().getBrightness().intValue()>95){
+                log.info("照片光照不达标"+face[0].getFaceQualityInfo().getBrightness().intValue());
+                throw new CustomException("照片光照曝光"+face[0].getFaceQualityInfo().getBrightness().intValue());
+            }
+            if(face[0].getFaceQualityInfo().getScore().intValue()<30){
+                log.info("照片质量不达标"+face[0].getFaceQualityInfo().getScore().intValue());
                 throw new CustomException("照片质量不达标"+face[0].getFaceQualityInfo().getScore().intValue());
             }
             if(Validator.isEmpty(face[0].getFaceQualityInfo().getCompleteness())){
+                log.info("照片五官不达标");
                 throw new CustomException("照片五官不达标");
             }
         }catch (TencentCloudSDKException e){
+            log.info("人脸检测错误"+e.getMessage());
             throw new CustomException("人脸检测错误"+e.getMessage());
         }
         return true;