diff --git a/README.md b/README.md index 81214ac..1b32298 100644 --- a/README.md +++ b/README.md @@ -18,20 +18,14 @@ Identify the types and quantities of smoke boxes -SmokeBoxIdentification.cpp中根æ�®STOCK_CHECK_HEAD等关键è¯�,选择哪个相机进行æ‹�照。 +周三下å�ˆ -所以需è¦�跟通讯对一下,什么信å�·å�¯ä»¥è¯´æ˜Žæ˜¯å“ªä¸ªæ–¹å�‘的相机进行æ‹�摄。 +2D相机模å�—修改:由于之å‰�是多个相机æ‹�一个库,若å‰�一个相机的图åƒ�为OK,则ä¸�è¿�行下一个;故而vecImageInfo中的值都是多个相机æ‹�的一堆烟。 -之å‰�是captureSideå’ŒcaptureTop,顶部和侧é�¢æ‹�摄。 +但是石家庄方案å�ªéœ€è¦�一å�°ç›¸æœºæ‹�æ‘„å�³å�¯å“�规。一个软件接入的多å�°ç›¸æœºæ˜¯åˆ†åˆ«è¦�执行的结果。 -相机载入的时候,读入矫正文件: ++结果绘制:调色+文字+大模æ�¿ç»“果需è¦�放大2å€� -m_calib->Load(strFileName.toStdString().c_str()); - - - -图片矫正: - -m_calib->FixImage(m_imgOrigin, m_imgFixed); +3D模å�—,先接入相机 diff --git a/runner17/Release/config/module.json b/runner17/Release/config/module.json index 6d82758..5e42bfd 100644 --- a/runner17/Release/config/module.json +++ b/runner17/Release/config/module.json @@ -3,6 +3,7 @@ "CodeScan": 0, "Sensor": 0, "Camera2D": 4, - "Camera3D": 1 + "Camera3D": 1, + "COMMRules": 1 } } diff --git a/runner17/Release/log/log-2024-01-09.log b/runner17/Release/log/log-2024-01-09.log index 206f998..e208820 100644 --- a/runner17/Release/log/log-2024-01-09.log +++ b/runner17/Release/log/log-2024-01-09.log @@ -1,44 +1,192 @@ -Info | 2024-01-09 18:47:06 Öܶþ | initCamera -Debug | 2024-01-09 18:47:06 Öܶþ | Decode smokeInfo from "D:/Code/Logistics/smokeboxidentification/runner17/Release\\user\\smokeInfo.xlsx" successed -Debug | 2024-01-09 18:47:06 Öܶþ | "D:/Code/Logistics/smokeboxidentification/runner17/Release\\templateNum" has not folder -Debug | 2024-01-09 18:47:06 Öܶþ | Find device: "00787720450" -Debug | 2024-01-09 18:47:06 Öܶþ | m_vecPCamera size: 1 -Warning | 2024-01-09 18:47:06 Öܶþ | QObject::moveToThread: Cannot move objects with a parent -Debug | 2024-01-09 18:47:06 Öܶþ | init CategoryMatcher successed -Debug | 2024-01-09 18:47:06 Öܶþ | NetControl::onConnected +Info | 2024-01-09 20:10:17 Öܶþ | initCamera +Debug | 2024-01-09 20:10:17 Öܶþ | Decode smokeInfo from "D:/Code/Logistics/smokeboxidentification/runner17/Release\\user\\smokeInfo.xlsx" successed +Debug | 2024-01-09 20:10:17 Öܶþ | "D:/Code/Logistics/smokeboxidentification/runner17/Release\\templateNum" has not folder +Debug | 2024-01-09 20:10:17 Öܶþ | Find device: "00787720450" +Debug | 2024-01-09 20:10:17 Öܶþ | m_vecPCamera size: 1 +Warning | 2024-01-09 20:10:17 Öܶþ | QObject::moveToThread: Cannot move objects with a parent +Debug | 2024-01-09 20:10:17 Öܶþ | init CategoryMatcher successed +Debug | 2024-01-09 20:10:18 Öܶþ | NetControl::onConnected TPTcpClient::slotConnected -Debug | 2024-01-09 18:47:06 Öܶþ | ÍøÂçÁ¬½Ó³É¹¦£¡£¡£¡ -Debug | 2024-01-09 18:47:08 Öܶþ | Open camera: "00787720450" successed -Debug | 2024-01-09 18:47:08 Öܶþ | Start camera: "00787720450" successed -Debug | 2024-01-09 18:47:08 Öܶþ | Set device successed -Debug | 2024-01-09 18:47:08 Öܶþ | Set camera: "00787720450" software trigger successed -Warning | 2024-01-09 18:47:10 Öܶþ | i receive data from server: "GP&6&111&2121&1&310102&25>" -Debug | 2024-01-09 18:47:10 Öܶþ | msg: "GP&6&111&2121&1&310102&25>" content: "GP&6&111&2121&1&310102&25" -Debug | 2024-01-09 18:47:10 Öܶþ | strlist length: 7 head: "GP" -Info | 2024-01-09 18:47:10 Öܶþ | [captureSide]: Enter -Info | 2024-01-09 18:47:10 Öܶþ | [onCapture]: Enter -Info | 2024-01-09 18:47:10 Öܶþ | [onCapture]: cameraLocation = 0 -Info | 2024-01-09 18:47:10 Öܶþ | [onCapture]: Out -Debug | 2024-01-09 18:47:10 Öܶþ | start capture, length: 1 -Debug | 2024-01-09 18:47:10 Öܶþ | convert Mat successed! -Debug | 2024-01-09 18:47:10 Öܶþ | ²»Ðýת -Info | 2024-01-09 18:47:10 Öܶþ | imgInfo.image.cols = 1920 -Info | 2024-01-09 18:47:10 Öܶþ | imgInfo.image.rows = 1200 -Info | 2024-01-09 18:47:10 Öܶþ | imgInfo.image.step = 1920 -Info | 2024-01-09 18:47:10 Öܶþ | imgInfo.imageOrigin == nullptr -Debug | 2024-01-09 18:47:10 Öܶþ | [Camera]: Side Camera Captured. -Debug | 2024-01-09 18:47:10 Öܶþ | Save image: ".\\fileData\\\\1.BMP" -Debug | 2024-01-09 18:47:10 Öܶþ | "Camera 00787720450 Match Start ..." -Info | 2024-01-09 18:47:10 Öܶþ | "Camera 00787720450 SetImageData OK!" -Critical | 2024-01-09 18:47:10 Öܶþ | strList.last() = "11" -Critical | 2024-01-09 18:47:10 Öܶþ | jieduan = "1" -Critical | 2024-01-09 18:47:10 Öܶþ | level = 1 -Debug | 2024-01-09 18:47:10 Öܶþ | Get TemplateImg OK! -Debug | 2024-01-09 18:47:10 Öܶþ | templateLevel = 1 -Info | 2024-01-09 18:47:10 Öܶþ | level = 1 -Info | 2024-01-09 18:47:10 Öܶþ | templateImgPath = "./templateImg/310102/310102-11.bmp" -Debug | 2024-01-09 18:47:10 Öܶþ | Level == 1 -Debug | 2024-01-09 18:47:11 Öܶþ | "Level: 1 match failed!" -Debug | 2024-01-09 18:47:44 Öܶþ | delete netControl -Debug | 2024-01-09 18:47:44 Öܶþ | NetControl::onDisconnected +Debug | 2024-01-09 20:10:18 Öܶþ | ÍøÂçÁ¬½Ó³É¹¦£¡£¡£¡ +Debug | 2024-01-09 20:10:19 Öܶþ | Open camera: "00787720450" successed +Debug | 2024-01-09 20:10:19 Öܶþ | Start camera: "00787720450" successed +Debug | 2024-01-09 20:10:19 Öܶþ | Set device successed +Debug | 2024-01-09 20:10:19 Öܶþ | Set camera: "00787720450" software trigger successed +Warning | 2024-01-09 20:10:23 Öܶþ | i receive data from server: "ST&6&111&2121&1>" +Debug | 2024-01-09 20:10:23 Öܶþ | msg: "ST&6&111&2121&1>" content: "ST&6&111&2121&1" +Debug | 2024-01-09 20:10:23 Öܶþ | strlist length: 5 head: "ST" +Debug | 2024-01-09 20:10:23 Öܶþ | ¿ªÊ¼Å̵ã +Warning | 2024-01-09 20:10:30 Öܶþ | i receive data from server: "GP&6&111&2121&1&310102&25>" +Debug | 2024-01-09 20:10:30 Öܶþ | msg: "GP&6&111&2121&1&310102&25>" content: "GP&6&111&2121&1&310102&25" +Debug | 2024-01-09 20:10:30 Öܶþ | strlist length: 7 head: "GP" +Debug | 2024-01-09 20:10:30 Öܶþ | µ½Î»È¡Í¼ +Info | 2024-01-09 20:10:30 Öܶþ | [captureSide]: Enter +Info | 2024-01-09 20:10:30 Öܶþ | [onCapture]: Enter +Info | 2024-01-09 20:10:30 Öܶþ | [onCapture]: cameraLocation = 0 +Info | 2024-01-09 20:10:30 Öܶþ | [onCapture]: Out +Debug | 2024-01-09 20:10:30 Öܶþ | start capture, length: 1 +Debug | 2024-01-09 20:10:31 Öܶþ | convert Mat successed! +Debug | 2024-01-09 20:10:31 Öܶþ | ²»Ðýת +Debug | 2024-01-09 20:10:31 Öܶþ | [Camera]: Side Camera Captured. +Info | 2024-01-09 20:10:31 Öܶþ | workMode = 2 +Debug | 2024-01-09 20:10:31 Öܶþ | Save image: ".\\fileData\\2121\\1.BMP" +Debug | 2024-01-09 20:10:31 Öܶþ | "Camera 00787720450 Match Start ..." +Debug | 2024-01-09 20:10:31 Öܶþ | Get TemplateImg OK! +Debug | 2024-01-09 20:10:31 Öܶþ | templateLevel = 2 +Info | 2024-01-09 20:10:31 Öܶþ | level = 1 +Info | 2024-01-09 20:10:31 Öܶþ | templateImgPath = "./templateImg/310102/310102-11.bmp" +Debug | 2024-01-09 20:10:31 Öܶþ | Level == 1 +Info | 2024-01-09 20:10:31 Öܶþ | level = 2 +Info | 2024-01-09 20:10:31 Öܶþ | templateImgPath = "./templateImg/310102/310102-21.bmp" +Debug | 2024-01-09 20:10:32 Öܶþ | "Camera 00787720450 Match successful!" +Info | 2024-01-09 20:10:32 Öܶþ | fileName "1_310102_rlt.BMP" +Info | 2024-01-09 20:10:32 Öܶþ | filePath ".\\fileData\\2121\\1_310102_rlt.BMP" +Debug | 2024-01-09 20:10:32 Öܶþ | send msg: "RT&6&111&2121&1&&&0>" +Warning | 2024-01-09 20:16:35 Öܶþ | i receive data from server: "ST&6&111&2121&1>" +Debug | 2024-01-09 20:16:35 Öܶþ | msg: "ST&6&111&2121&1>" content: "ST&6&111&2121&1" +Debug | 2024-01-09 20:16:35 Öܶþ | strlist length: 5 head: "ST" +Debug | 2024-01-09 20:16:35 Öܶþ | ¿ªÊ¼Å̵ã +Warning | 2024-01-09 20:16:40 Öܶþ | i receive data from server: "GP&6&111&2121&1&310102&25>" +Debug | 2024-01-09 20:16:40 Öܶþ | msg: "GP&6&111&2121&1&310102&25>" content: "GP&6&111&2121&1&310102&25" +Debug | 2024-01-09 20:16:40 Öܶþ | strlist length: 7 head: "GP" +Debug | 2024-01-09 20:16:40 Öܶþ | µ½Î»È¡Í¼ +Info | 2024-01-09 20:16:40 Öܶþ | [captureSide]: Enter +Info | 2024-01-09 20:16:40 Öܶþ | [onCapture]: Enter +Info | 2024-01-09 20:16:40 Öܶþ | [onCapture]: cameraLocation = 0 +Info | 2024-01-09 20:16:40 Öܶþ | [onCapture]: Out +Debug | 2024-01-09 20:16:40 Öܶþ | start capture, Debug | 2024-01-09 20:16:45 Öܶþ | delete netControl +Debug | 2024-01-09 20:16:45 Öܶþ | NetControl::onDisconnected TPTcpClient::slotDisconnected +þ | [Camera]: Side Camera Captured. +Info | 2024-01-09 20:16:40 Öܶþ | workMode = 2 +Debug | 2024-01-09 20:16:40 Öܶþ | Save image: ".\\fileData\\2121\\1.BMP" +Debug | 2024-01-09 20:16:40 Öܶþ | "Camera 00787720450 Match Start ..." +Debug | 2024-01-09 20:16:40 Öܶþ | Get TemplateImg OK! +Debug | 2024-01-09 20:16:40 Öܶþ | templateLevel = 2 +Info | 2024-01-09 20:16:40 Öܶþ | level = 1 +Info | 2024-01-09 20:16:40 Öܶþ | templateImgPath = "./templateImg/310102/310102-11.bmp" +Debug | 2024-01-09 20:16:40 Öܶþ | Level == 1 +Info | 2024-01-09 20:16:40 Öܶþ | level = 2 +Info | 2024-01-09 20:16:40 Öܶþ | templateImgPath = "./templateImg/310102/310102-21.bmp" +Debug | 2024-01-09 20:16:41 Öܶþ | "Camera 00787720450 Match successful!" +Info | 2024-01-09 20:16:41 Öܶþ | fileName "1_310102_rlt.BMP" +Info | 2024-01-09 20:16:41 Öܶþ | filePath ".\\fileData\\2121\\1_310102_rlt.BMP" +Debug | 2024-01-09 20:16:41 Öܶþ | send msg: "RT&6&111&2121&1&&&0>" +Debug | 2024-01-09 20:17:09 Öܶþ | delete netControl +Debug | 2024-01-09 20:17:09 Öܶþ | NetControl::onDisconnected +TPTcpClient::slotDisconnected +Info | 2024-01-09 20:18:42 Öܶþ | initCamera +Debug | 2024-01-09 20:18:42 Öܶþ | Decode smokeInfo from "D:/Code/Logistics/smokeboxidentification/runner17/Release\\user\\smokeInfo.xlsx" successed +Debug | 2024-01-09 20:18:42 Öܶþ | "D:/Code/Logistics/smokeboxidentification/runner17/Release\\templateNum" has not folder +Debug | 2024-01-09 20:18:42 Öܶþ | Find device: "00787720450" +Debug | 2024-01-09 20:18:43 Öܶþ | m_vecPCamera size: 1 +Warning | 2024-01-09 20:18:43 Öܶþ | QObject::moveToThread: Cannot move objects with a parent +Debug | 2024-01-09 20:18:43 Öܶþ | init CategoryMatcher successed +Debug | 2024-01-09 20:18:43 Öܶþ | NetControl::onConnected +TPTcpClient::slotConnected +Debug | 2024-01-09 20:18:43 Öܶþ | ÍøÂçÁ¬½Ó³É¹¦£¡£¡£¡ +Debug | 2024-01-09 20:18:44 Öܶþ | Open camera: "00787720450" successed +Debug | 2024-01-09 20:18:44 Öܶþ | Start camera: "00787720450" successed +Debug | 2024-01-09 20:18:44 Öܶþ | Set device successed +Debug | 2024-01-09 20:18:44 Öܶþ | Set camera: "00787720450" software trigger successed +Warning | 2024-01-09 20:18:53 Öܶþ | i receive data from server: "ST&6&111&2121&1>" +Debug | 2024-01-09 20:18:53 Öܶþ | msg: "ST&6&111&2121&1>" content: "ST&6&111&2121&1" +Debug | 2024-01-09 20:18:53 Öܶþ | strlist length: 5 head: "ST" +Debug | 2024-01-09 20:18:53 Öܶþ | ¿ªÊ¼Å̵ã +Warning | 2024-01-09 20:18:58 Öܶþ | i receive data from server: "GP&6&111&2121&1&310102&25>" +Debug | 2024-01-09 20:18:58 Öܶþ | msg: "GP&6&111&2121&1&310102&25>" content: "GP&6&111&2121&1&310102&25" +Debug | 2024-01-09 20:18:58 Öܶþ | strlist length: 7 head: "GP" +Debug | 2024-01-09 20:18:58 Öܶþ | µ½Î»È¡Í¼ +Info | 2024-01-09 20:18:58 Öܶþ | [captureSide]: Enter +Info | 2024-01-09 20:18:58 Öܶþ | [onCapture]: Enter +Info | 2024-01-09 20:18:58 Öܶþ | [onCapture]: cameraLocation = 0 +Info | 2024-01-09 20:18:58 Öܶþ | [onCapture]: Out +Debug | 2024-01-09 20:18:58 Öܶþ | start capture, length: 1 +Debug | 2024-01-09 20:18:58 Öܶþ | convert Mat successed! +Debug | 2024-01-09 20:18:58 Öܶþ | ²»Ðýת +Debug | 2024-01-09 20:18:58 Öܶþ | [Camera]: Side Camera Captured. +Info | 2024-01-09 20:18:58 Öܶþ | workMode = 2 +Debug | 2024-01-09 20:18:58 Öܶþ | Save image: ".\\fileData\\2121\\1.BMP" +Debug | 2024-01-09 20:18:58 Öܶþ | "Camera 00787720450 Match Start ..." +Debug | 2024-01-09 20:18:58 Öܶþ | Get TemplateImg OK! +Debug | 2024-01-09 20:18:58 Öܶþ | templateLevel = 2 +Info | 2024-01-09 20:18:58 Öܶþ | level = 1 +Info | 2024-01-09 20:18:58 Öܶþ | templateImgPath = "./templateImg/310102/310102-11.bmp" +Debug | 2024-01-09 20:18:58 Öܶþ | Level == 1 +Info | 2024-01-09 20:18:58 Öܶþ | level = 2 +Info | 2024-01-09 20:18:58 Öܶþ | templateImgPath = "./templateImg/310102/310102-21.bmp" +Debug | 2024-01-09 20:18:59 Öܶþ | "Camera 00787720450 Match successful!" +Info | 2024-01-09 20:18:59 Öܶþ | fileName "1_310102_rlt.BMP" +Info | 2024-01-09 20:18:59 Öܶþ | filePath ".\\fileData\\2121\\1_310102_rlt.BMP" +Debug | 2024-01-09 20:18:59 Öܶþ | send msg: "RT&6&111&2121&1&&&0>" +Debug | 2024-01-09 20:20:07 Öܶþ | delete netControl +Debug | 2024-01-09 20:20:07 Öܶþ | NetControl::onDisconnected +TPTcpClient::slotDisconnected +Info | 2024-01-09 20:20:26 Öܶþ | initCamera +Debug | 2024-01-09 20:20:26 Öܶþ | Decode smokeInfo from "D:/Code/Logistics/smokeboxidentification/runner17/Release\\user\\smokeInfo.xlsx" successed +Debug | 2024-01-09 20:20:26 Öܶþ | "D:/Code/Logistics/smokeboxidentification/runner17/Release\\templateNum" has not folder +Debug | 2024-01-09 20:20:26 Öܶþ | Find device: "00787720450" +Debug | 2024-01-09 20:20:26 Öܶþ | m_vecPCamera size: 1 +Warning | 2024-01-09 20:20:26 Öܶþ | QObject::moveToThread: Cannot move objects with a parent +Debug | 2024-01-09 20:20:26 Öܶþ | init CategoryMatcher successed +Debug | 2024-01-09 20:20:26 Öܶþ | NetControl::onConnected +TPTcpClient::slotConnected +Debug | 2024-01-09 20:20:26 Öܶþ | ÍøÂçÁ¬½Ó³É¹¦£¡£¡£¡ +Debug | 2024-01-09 20:20:28 Öܶþ | Open camera: "00787720450" successed +Debug | 2024-01-09 20:20:28 Öܶþ | Start camera: "00787720450" successed +Debug | 2024-01-09 20:20:28 Öܶþ | Set device successed +Debug | 2024-01-09 20:20:28 Öܶþ | Set camera: "00787720450" software trigger successed +Warning | 2024-01-09 20:20:35 Öܶþ | i receive data from server: "ST&6&111&2121&1>" +Debug | 2024-01-09 20:20:35 Öܶþ | msg: "ST&6&111&2121&1>" content: "ST&6&111&2121&1" +Debug | 2024-01-09 20:20:35 Öܶþ | strlist length: 5 head: "ST" +Debug | 2024-01-09 20:20:35 Öܶþ | ¿ªÊ¼Å̵ã +Warning | 2024-01-09 20:20:40 Öܶþ | i receive data from server: "GP&6&111&2121&1&310102&25>" +Debug | 2024-01-09 20:20:40 Öܶþ | msg: "GP&6&111&2121&1&310102&25>" content: "GP&6&111&2121&1&310102&25" +Debug | 2024-01-09 20:20:40 Öܶþ | strlist length: 7 head: "GP" +Debug | 2024-01-09 20:20:40 Öܶþ | µ½Î»È¡Í¼ +Info | 2024-01-09 20:20:40 Öܶþ | [captureSide]: Enter +Info | 2024-01-09 20:20:40 Öܶþ | [onCapture]: Enter +Info | 2024-01-09 20:20:40 Öܶþ | [onCapture]: cameraLocation = 0 +Info | 2024-01-09 20:20:40 Öܶþ | [onCapture]: Out +Debug | 2024-01-09 20:20:40 Öܶþ | start capture, length: 1 +Debug | 2024-01-09 20:20:40 Öܶþ | convert Mat successed! +Debug | 2024-01-09 20:20:40 Öܶþ | ²»Ðýת +Debug | 2024-01-09 20:20:40 Öܶþ | [Camera]: Side Camera Captured. +Info | 2024-01-09 20:20:40 Öܶþ | workMode = 2 +Debug | 2024-01-09 20:20:40 Öܶþ | Save image: ".\\fileData\\2121\\1.BMP" +Debug | 2024-01-09 20:20:40 Öܶþ | "Camera 00787720450 Match Start ..." +Debug | 2024-01-09 20:20:40 Öܶþ | Get TemplateImg OK! +Debug | 2024-01-09 20:20:40 Öܶþ | templateLevel = 2 +Info | 2024-01-09 20:20:40 Öܶþ | level = 1 +Info | 2024-01-09 20:20:40 Öܶþ | templateImgPath = "./templateImg/310102/310102-11.bmp" +Debug | 2024-01-09 20:20:40 Öܶþ | Level == 1 +Info | 2024-01-09 20:20:41 Öܶþ | level = 2 +Info | 2024-01-09 20:20:41 Öܶþ | templateImgPath = "./templateImg/310102/310102-21.bmp" +Debug | 2024-01-09 20:20:41 Öܶþ | "Camera 00787720450 Match successful!" +Info | 2024-01-09 20:20:41 Öܶþ | fileName "1_310102_rlt.BMP" +Info | 2024-01-09 20:20:41 Öܶþ | filePath ".\\fileData\\2121\\1_310102_rlt.BMP" +Warning | 2024-01-09 20:20:48 Öܶþ | i receive data from server: "GP&6&111&2121&1&310102&25>" +Debug | 2024-01-09 20:20:48 Öܶþ | msg: "GP&6&111&2121&1&310102&25>" content: "GP&6&111&2121&1&310102&25" +Debug | 2024-01-09 20:20:48 Öܶþ | strlist length: 7 head: "GP" +Debug | 2024-01-09 20:20:48 Öܶþ | µ½Î»È¡Í¼ +Info | 2024-01-09 20:20:48 Öܶþ | [captureSide]: Enter +Info | 2024-01-09 20:20:48 Öܶþ | [onCapture]: Enter +Info | 2024-01-09 20:20:48 Öܶþ | [onCapture]: cameraLocation = 0 +Info | 2024-01-09 20:20:48 Öܶþ | [onCapture]: Out +Debug | 2024-01-09 20:20:48 Öܶþ | start capture, length: 1 +Debug | 2024-01-09 20:20:48 Öܶþ | convert Mat successed! +Debug | 2024-01-09 20:20:48 Öܶþ | ²»Ðýת +Debug | 2024-01-09 20:20:48 Öܶþ | [Camera]: Side Camera Captured. +Info | 2024-01-09 20:20:48 Öܶþ | workMode = 2 +Debug | 2024-01-09 20:20:48 Öܶþ | Save image: ".\\fileData\\2121\\1.BMP" +Debug | 2024-01-09 20:20:48 Öܶþ | "Camera 00787720450 Match Start ..." +Debug | 2024-01-09 20:20:48 Öܶþ | Get TemplateImg OK! +Debug | 2024-01-09 20:20:48 Öܶþ | templateLevel = 2 +Info | 2024-01-09 20:20:48 Öܶþ | level = 1 +Info | 2024-01-09 20:20:48 Öܶþ | templateImgPath = "./templateImg/310102/310102-11.bmp" +Debug | 2024-01-09 20:20:48 Öܶþ | Level == 1 +Info | 2024-01-09 20:20:48 Öܶþ | level = 2 +Info | 2024-01-09 20:20:48 Öܶþ | templateImgPath = "./templateImg/310102/310102-21.bmp" +Debug | 2024-01-09 20:20:49 Öܶþ | "Camera 00787720450 Match successful!" +Info | 2024-01-09 20:20:49 Öܶþ | fileName "1_310102_rlt.BMP" +Info | 2024-01-09 20:20:49 Öܶþ | filePath ".\\fileData\\2121\\1_310102_rlt.BMP" diff --git a/runner17/Release/smokeBox.exe b/runner17/Release/smokeBox.exe index 5445633..1d48976 100644 Binary files a/runner17/Release/smokeBox.exe and b/runner17/Release/smokeBox.exe differ diff --git a/runner17/Release/templateImg/310102/310102-21.bmp b/runner17/Release/templateImg/310102/310102-21.bmp new file mode 100644 index 0000000..1724e2b Binary files /dev/null and b/runner17/Release/templateImg/310102/310102-21.bmp differ diff --git a/runner17/Release/templateImg/320111/320111-21.bmp b/runner17/Release/templateImg/320111/320111-21.bmp new file mode 100644 index 0000000..a827134 Binary files /dev/null and b/runner17/Release/templateImg/320111/320111-21.bmp differ diff --git a/src/CameraControl.cpp b/src/CameraControl.cpp index 9096c74..3c8212b 100644 --- a/src/CameraControl.cpp +++ b/src/CameraControl.cpp @@ -495,7 +495,8 @@ void CameraControl::capture(const QStringList& serialNumberList) imgInfo.imageOrigin = ILImagePtr(__uuidof(LImage)); imgInfo.imageFixed = ILImagePtr(__uuidof(LImage)); } - imgInfo.imageOrigin->SetImageData(imgInfo.image.cols, imgInfo.image.rows, (void*)imgInfo.image.data, imgInfo.image.step, 0); + //imgInfo.imageOrigin->SetImageData(imgInfo.image.cols, imgInfo.image.rows, (void*)imgInfo.image.data, imgInfo.image.step, 0); + imgInfo.imageOrigin->Load("C:/Users/LENOVO/Downloads/0108/310102.bmp"); if (m_calib->IsCalibrated()) { m_calib->FixImage(imgInfo.imageOrigin, imgInfo.imageFixed); diff --git a/src/CategoryMatcher.cpp b/src/CategoryMatcher.cpp index 499f8ff..84aa2f2 100644 --- a/src/CategoryMatcher.cpp +++ b/src/CategoryMatcher.cpp @@ -73,6 +73,7 @@ void CategoryMatcher::setILMatch(const MatchParam& matchParam) } + bool CategoryMatcher::smokeMatch(const QString& typeNo, ILImagePtr image) { std::pair> templateLevelAndvecMatchRltPtr; @@ -133,8 +134,6 @@ bool CategoryMatcher::smokeMatch(const QString& typeNo, const ILImagePtr ilImgPt QMap strScoreMap = templateObj.value(level); for (QMap::iterator it = strScoreMap.begin(); it != strScoreMap.end(); ++it) { - //ÐèÒªÑé֤ûÓÃ1ÀàÄ£°å£¬µ«ÓÐ2ÀàÄ£°åµÄͼ - QString templateImgPath = it.key(); qInfo() << "templateImgPath = "<< templateImgPath; ILImagePtr ilTemplatePtr(__uuidof(LImage)); @@ -262,9 +261,6 @@ bool CategoryMatcher::getTemplateImgFileInfo(const QString& folderPath, Template QString templateImgPath = imgFileInfo.filePath(); //Ïà¶Ô·¾¶£¬±ÜÃâ·¾¶´æÔÚÖÐÎÄʱ¶Áȡʧ°Ü int level = strList.last().mid(0, 1).toInt(); - qCritical() << "strList.last() = " << strList.last(); - qCritical() << "jieduan = " << strList.last().mid(0, 1); - qCritical() << "level = " << level; templateObject[level].insert(templateImgPath, 70); diff --git a/src/SmokeBoxIdentification.cpp b/src/SmokeBoxIdentification.cpp index 40a790b..411fee5 100644 --- a/src/SmokeBoxIdentification.cpp +++ b/src/SmokeBoxIdentification.cpp @@ -153,11 +153,11 @@ void SmokeBoxIdentification::saveImage(const cv::Mat& imgMat, const QString& fil void SmokeBoxIdentification::saveImage(const QVector& vecImageInfo, int workMode) { QString dataSaveFolderPath; + qInfo() << "workMode = " << workMode; switch (workMode) { case WorkMode::StockCheck: - dataSaveFolderPath = QString("%1\\%2\\%3").arg(FILE_STORAGE_PATH).arg(m_currtStockCheckInfo.stockNum) - .arg(m_currtStockCheckInfo.taskNum); + dataSaveFolderPath = QString("%1\\%2").arg(FILE_STORAGE_PATH).arg(m_currtStockCheckInfo.taskNum); break; case WorkMode::IntoStock: dataSaveFolderPath =QString("%1\\%2\\%3\\%4").arg(FILE_STORAGE_PATH).arg(INTOSTOCK_IMAGE_FOLDER) @@ -165,7 +165,6 @@ void SmokeBoxIdentification::saveImage(const QVector& vecImageInfo, i break; default: dataSaveFolderPath = QString("%1\\%2").arg(FILE_STORAGE_PATH).arg(m_currtIntoStockInfo.taskNum); - //qDebug() << "Mode: " << workMode << "do not save Image"; //return; } QDir folder(dataSaveFolderPath); @@ -209,7 +208,7 @@ Q_SLOT void SmokeBoxIdentification::onCapturedImage(const QVector& ve { sendResults(MsgType::DataCollectionEndSC); } - else if (m_workMode = WorkMode::IntoStock) + else if (m_workMode == WorkMode::IntoStock) { sendResults(MsgType::IntoStockResult); } @@ -234,6 +233,7 @@ Q_SLOT void SmokeBoxIdentification::onCapturedImage(const QVector& ve QString dataSaveFolder = QString("%1\\%2").arg(FILE_STORAGE_PATH) .arg(m_currtStockCheckInfo.taskNum); + // ÓÉÓÚ֮ǰÊǶà¸öÏà»úÅÄÒ»¸ö¿â£¬Èôǰһ¸öÏà»úµÄͼÏñΪOK£¬Ôò²»ÔËÐÐÏÂÒ»¸ö for each (const ImageInfo& imgInfo in vecImageInfo) { QString str = QString("Camera %1 Match Start ...").arg(imgInfo.cameraSn); @@ -255,12 +255,33 @@ Q_SLOT void SmokeBoxIdentification::onCapturedImage(const QVector& ve m_pCategoryMatcher->saveResultsImage(filePath); break; } + else + { + str = QString("Camera %1 Match Failed!").arg(imgInfo.cameraSn); + qWarning() << str; + } + } else { qDebug() << "imgInfo.image is Empty!"; } } + if (!bRlt) + { + QString filePath = dataSaveFolder + QString("\\%1_error.PNG") + .arg(m_currtStockCheckInfo.smokeTypeNum); + m_pCategoryMatcher->saveResultsImage(filePath); + //saveImage(imgRltMat, filePath); + } + QString typeNumRlt = bRlt ? typeNum : "0"; + m_currtStockCheckInfo.smokeTypeNumRlt = typeNumRlt; + qDebug() << "typeNumRlt: " << typeNumRlt; + + //µÈ½ÓÈë3Dºó£¬ÐèÒªµÈ3D½á¹û¼ÆËã³öÀ´ºóÔÙ·¢ËÍÕýÈ·ÐÅÏ¢ + m_currtStockCheckInfo.smokeQuantityRlt = typeNumRlt; + sendResults(MsgType::StockCheckResult); + //emit sgCategoryMatchFinished(typeNumRlt); }); #elif IMAGEDRAWING==OPENCV @@ -405,16 +426,26 @@ Q_SLOT void SmokeBoxIdentification::onDecodeMsg(const QString& msg) } } } + else if (strList.at(0) == START_TAKE) + { + qDebug() << "¿ªÊ¼Å̵ã"; + //m_workMode = WorkMode::IntoStock; + m_currtIntoStockInfo.streetName = strList.at(1); + m_currtIntoStockInfo.id = strList.at(2); + m_currtIntoStockInfo.taskNum = strList.at(3); + m_currtIntoStockInfo.stockLocation = strList.at(4); + + } else if (strList.at(0) == START_CAPTURE) { - StockCheckInfo stockCheckInfo; - stockCheckInfo.streetName = strList.at(1); - stockCheckInfo.id = strList.at(2); - stockCheckInfo.taskNum = strList.at(3); - stockCheckInfo.stockLocation = strList.at(4); - stockCheckInfo.smokeTypeNum = strList.at(5); - stockCheckInfo.smokeQuantity = strList.at(6); - m_currtStockCheckInfo = stockCheckInfo; + qDebug() << "µ½Î»È¡Í¼"; + //m_workMode = WorkMode::StockCheck; + m_currtStockCheckInfo.streetName = strList.at(1); + m_currtStockCheckInfo.id = strList.at(2); + m_currtStockCheckInfo.taskNum = strList.at(3); + m_currtStockCheckInfo.stockLocation = strList.at(4); + m_currtStockCheckInfo.smokeTypeNum = strList.at(5); + m_currtStockCheckInfo.smokeQuantity = strList.at(6); captureSide(); } } @@ -496,31 +527,49 @@ void SmokeBoxIdentification::sendResults(int mode) .append(SPLIT_RULE).append(m_currtStockCheckInfo.taskNum).append(END_SYMBOL); break; case StockCheckResult: - if (QString::compare(m_currtStockCheckInfo.smokeTypeNum, m_currtStockCheckInfo.smokeTypeNumRlt)<0 - && QString::compare("0", m_currtStockCheckInfo.smokeTypeNumRlt) < 0) - { - resultInfoMsg.append(STOCK_CHECK_HEAD).append(SPLIT_RULE) - .append(m_currtStockCheckInfo.streetName).append(SPLIT_RULE) - .append(m_currtStockCheckInfo.stockNum).append(SPLIT_RULE) - .append(m_currtStockCheckInfo.taskNum).append(SPLIT_RULE) - .append(m_currtStockCheckInfo.smokeTypeNumRlt).append(SPLIT_RULE) - .append(QString::number(0)).append(SPLIT_RULE) - .append(m_currtStockCheckInfo.smokeTypeNumRlt).append(SPLIT_RULE) - .append(QString::number(0)).append(SPLIT_RULE) - .append(QString::number(0)).append(END_SYMBOL); - } - else + switch (m_moduleParam.COMMRules) { - resultInfoMsg.append(STOCK_CHECK_HEAD).append(SPLIT_RULE) + case eCommunicationRules::emNJ: + if (QString::compare(m_currtStockCheckInfo.smokeTypeNum, m_currtStockCheckInfo.smokeTypeNumRlt) < 0 + && QString::compare("0", m_currtStockCheckInfo.smokeTypeNumRlt) < 0) + { + resultInfoMsg.append(STOCK_CHECK_HEAD).append(SPLIT_RULE) + .append(m_currtStockCheckInfo.streetName).append(SPLIT_RULE) + .append(m_currtStockCheckInfo.stockNum).append(SPLIT_RULE) + .append(m_currtStockCheckInfo.taskNum).append(SPLIT_RULE) + .append(m_currtStockCheckInfo.smokeTypeNumRlt).append(SPLIT_RULE) + .append(QString::number(0)).append(SPLIT_RULE) + .append(m_currtStockCheckInfo.smokeTypeNumRlt).append(SPLIT_RULE) + .append(QString::number(0)).append(SPLIT_RULE) + .append(QString::number(0)).append(END_SYMBOL); + } + else + { + resultInfoMsg.append(STOCK_CHECK_HEAD).append(SPLIT_RULE) + .append(m_currtStockCheckInfo.streetName).append(SPLIT_RULE) + .append(m_currtStockCheckInfo.stockNum).append(SPLIT_RULE) + .append(m_currtStockCheckInfo.taskNum).append(SPLIT_RULE) + .append(m_currtStockCheckInfo.smokeTypeNum).append(SPLIT_RULE) + .append(m_currtStockCheckInfo.smokeQuantity).append(SPLIT_RULE) + .append(m_currtStockCheckInfo.smokeTypeNumRlt).append(SPLIT_RULE) + .append(m_currtStockCheckInfo.smokeQuantityRlt).append(SPLIT_RULE) + .append(QString::number(m_currtStockCheckInfo.correctness)).append(END_SYMBOL); + } + break; + case eCommunicationRules::emSJZ: + resultInfoMsg.append(RETURN_MES).append(SPLIT_RULE) .append(m_currtStockCheckInfo.streetName).append(SPLIT_RULE) - .append(m_currtStockCheckInfo.stockNum).append(SPLIT_RULE) + .append(m_currtStockCheckInfo.id).append(SPLIT_RULE) .append(m_currtStockCheckInfo.taskNum).append(SPLIT_RULE) - .append(m_currtStockCheckInfo.smokeTypeNum).append(SPLIT_RULE) - .append(m_currtStockCheckInfo.smokeQuantity).append(SPLIT_RULE) + .append(m_currtStockCheckInfo.stockLocation).append(SPLIT_RULE) .append(m_currtStockCheckInfo.smokeTypeNumRlt).append(SPLIT_RULE) .append(m_currtStockCheckInfo.smokeQuantityRlt).append(SPLIT_RULE) .append(QString::number(m_currtStockCheckInfo.correctness)).append(END_SYMBOL); + break; + default: + break; } + break; case IntoStockResult: { @@ -785,6 +834,7 @@ void SmokeBoxIdentification::moduleLoading() m_moduleParam.Sensor = ModuleParamObj.value("Sensor").toInt(); m_moduleParam.Camera2D = ModuleParamObj.value("Camera2D").toInt(); m_moduleParam.Camera3D = ModuleParamObj.value("Camera3D").toInt(); + m_moduleParam.COMMRules = (eCommunicationRules)ModuleParamObj.value("COMMRules").toInt(); } //// ´ò¿ªÎı¾ÎļþÒÔ¶Áȡģʽ diff --git a/src/SmokeBoxIdentification.h b/src/SmokeBoxIdentification.h index 5ac64f5..e23be84 100644 --- a/src/SmokeBoxIdentification.h +++ b/src/SmokeBoxIdentification.h @@ -22,9 +22,6 @@ #include "ui_SmokeBoxIdentification.h" -//#define IMAGEDRAWING OPENCV -#define IMAGEDRAWING LPV - enum MsgType { @@ -52,9 +49,11 @@ enum StockCheckMode struct IntoStockInfo { - QString streetName; - QString taskNum; - QString stockNum; + QString streetName; // ÏïµÀºÅ + QString taskNum; // ÈÎÎñºÅ-¹¤µ¥ºÅ + QString stockNum; //»õ¼ÜλÖÃUL062015020111 6ºÅ¶Ñ¶â»ú£¬2£ºÓұߣ» + QString id = 0; + QString stockLocation = 0; // ·½Ïò£º1×ó£¬2ÓÒ£»0±£ÁôΪ֮ǰ¹æÔò QStringList imagesPathList; }; @@ -121,12 +120,14 @@ struct ModuleParam int Sensor; // ´«¸ÐÆ÷ÊýÁ¿£¬0Ϊ²»°²×°´«¸ÐÆ÷ int Camera2D; // 2DÏà»úÊýÁ¿ int Camera3D; // 3DÏà»úÊýÁ¿ + eCommunicationRules COMMRules; // ͨѶ¹æÔò ModuleParam() { CodeScan = 1; Sensor = 1; Camera2D = 2; Camera3D = 2; + COMMRules = eCommunicationRules::emNJ; } }; diff --git a/src/common/commonDefine.h b/src/common/commonDefine.h index b898a4a..c566934 100644 --- a/src/common/commonDefine.h +++ b/src/common/commonDefine.h @@ -23,6 +23,9 @@ #define DELETE_POINTER(p) if (p) {delete p; p = NULL;} +//#define IMAGEDRAWING OPENCV +#define IMAGEDRAWING LPV + #define MODULE_CONFIG "\\config\\module.json" #define CAMERA_CONFIG "\\config\\camera.json" #define NET_CONFIG "\\config\\netSetting.json" @@ -48,7 +51,9 @@ #define CODE_CONTENT_SPLIT "," #define CONTENT_SPLIT ";" #define END_SYMBOL ">" -#define START_CAPTURE "GP" +#define START_CAPTURE "GP" // µ½Î»È¡Í¼ +#define START_TAKE "ST" // ¿ªÊ¼Å̵ã +#define RETURN_MES "RT" // ½á¹û·µ»Ø #define LP_COLOR_CONTROL 0x88 #define LP_D1TOD80 0x86 @@ -127,6 +132,12 @@ struct debugMsg QString msAD_2; }; +enum eCommunicationRules +{ + emNJ = 0, // ÄϾ© + emSJZ // ʯ¼Òׯ +}; + enum eCameraLocation { emSide=0, // ´ú±íÕæÕýÓÐЧ²É¼¯µÄÏà»ú diff --git a/tpvs17/SmokeBoxIdentification/fileData/intoStock/1.BMP b/tpvs17/SmokeBoxIdentification/fileData/intoStock/1.BMP deleted file mode 100644 index 65e4449..0000000 Binary files a/tpvs17/SmokeBoxIdentification/fileData/intoStock/1.BMP and /dev/null differ