From 65062cbdae525bd0b7e5639a5a149d942e3d1b03 Mon Sep 17 00:00:00 2001 From: wangfei <3597712270@qq.com> Date: 星期四, 15 八月 2024 16:09:21 +0800 Subject: [PATCH] 掰片/识别模块、钢化模块图片算法更改,可视化系统图片动态获取 --- UI-Project/src/views/Identify/identify.vue | 15 +++++++++------ 1 files changed, 9 insertions(+), 6 deletions(-) diff --git a/UI-Project/src/views/Identify/identify.vue b/UI-Project/src/views/Identify/identify.vue index 83eae3b..d973668 100644 --- a/UI-Project/src/views/Identify/identify.vue +++ b/UI-Project/src/views/Identify/identify.vue @@ -142,11 +142,12 @@ const rawRects = response.data[0]; rawData.value = response.data; totalPages.value = rawData.value.length; + const scaleFactor = 1621.78/6000; adjustedRects.value = rawRects.map(rect => ({ ...rect, - x_axis: (6000 -(rect.x_axis + rect.width)) * 0.2085, + x_axis: (6000 -(rect.x_axis + rect.width)) * scaleFactor, y_axis: rect.y_axis * 0.17, - width: rect.width * 0.2 , + width: rect.width * scaleFactor , widtha: rect.width , heighta: rect.height , height: rect.height * 0.165 , @@ -166,12 +167,13 @@ const handleCurrentChange = (val: number) => { currentPage.value = val; const page = currentPage.value - 1 + const scaleFactor = 1621.78/6000; adjustedRects.value = rawData.value[page]?.map(rect => ({ // adjustedRects.value = rawRects.map(rect => ({ ...rect, - x_axis: (6000 -(rect.x_axis + rect.width)) * 0.2085, + x_axis: (6000 -(rect.x_axis + rect.width)) * scaleFactor, y_axis: rect.y_axis * 0.17, - width: rect.width * 0.2 , + width: rect.width * scaleFactor , widtha: rect.width , heighta: rect.height , height: rect.height * 0.165 , @@ -210,11 +212,12 @@ webSocket = new WebSocket(socketUrl); webSocket.onmessage = (event) => { const data = JSON.parse(event.data); + const scaleFactor = 1621.78/6000; adjustedRects.value = data.currentCutTerritory[0].map(rect => ({ ...rect, - x_axis: (6000 -(rect.x_axis + rect.width)) * 0.2085, + x_axis: (6000 -(rect.x_axis + rect.width)) * scaleFactor, y_axis: rect.y_axis * 0.17, - width: rect.width * 0.2 , + width: rect.width * scaleFactor , widtha: rect.width , heighta: rect.height , height: rect.height * 0.165 , -- Gitblit v1.8.0