多个相机取图后都进行判断,直到判断成功为止

泸州-视觉+扫码-昆船
LAPTOP-S9HJSOEB\昊天 10 months ago
parent bd61393371
commit 7608cc675f

@ -148,11 +148,16 @@ public class IndustrialCameraController {
boolean re = false;
//sick识别
String code = SickSocket.readOCR(configProperties.getCameraConfig().getSickIp(), configProperties.getCameraConfig().getSickPort());
String pa = "";
//2d识别
if (listResult.getData().size()!=0){
for(String path:listResult.getData()){
re = FeatureMatchingExample.matchTemplate(
InventoryService.readImagesInFolder(configProperties.getSavePath().getMediaPath() + "template/" + industrialCameraVo.getTypeMacth()),
configProperties.getSavePath().getMediaPath() +listResult.getData().get(0));
configProperties.getSavePath().getMediaPath() +path);
if (re){
pa = path;
break;
}
}
//3d pcd保存
LocalDate currentDate = LocalDate.now();
@ -176,7 +181,7 @@ public class IndustrialCameraController {
kuKou.setCode(code);
kuKou.setWmsCount(industrialCameraVo.getCount());
kuKou.setWmsCode(industrialCameraVo.getCode());
kuKou.setPath(configProperties.getSavePath().getNetPicPath()+listResult.getData().get(0)+".jpg");
kuKou.setPath(configProperties.getSavePath().getNetPicPath()+pa+".jpg");
kuKouService.save(kuKou);
serialPortExample.openLight(0);
return new Result<>(kuKou);

Loading…
Cancel
Save