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/PurchaseReturn/purchaseReturn.vue | 62 +++++++++---------------------
1 files changed, 19 insertions(+), 43 deletions(-)
diff --git a/UI-Project/src/views/PurchaseReturn/purchaseReturn.vue b/UI-Project/src/views/PurchaseReturn/purchaseReturn.vue
index 60ec592..1b332f2 100644
--- a/UI-Project/src/views/PurchaseReturn/purchaseReturn.vue
+++ b/UI-Project/src/views/PurchaseReturn/purchaseReturn.vue
@@ -27,7 +27,7 @@
// 杩涚倝涓�
if(data.intoGlass!=null){
adjustedRects1.value = data.intoGlass[0].map(rect => {
- console.log( adjustedRects1.value);
+ const scaleFactor = 794.67/5087;
let adjustedWidth, adjustedHeight, adjustedWidtha, adjustedHeighta,widtha,heighta;;
let newX = rect.yCoordinate;
if (rect.width < rect.height) {
@@ -38,34 +38,21 @@
heighta = rect.height;
}
if (rect.angle === 0) {
- adjustedWidth = widtha * 0.12;
+ adjustedWidth = widtha * scaleFactor;
adjustedHeight = heighta * 0.1;
// adjustedWidtha = widtha;
// adjustedHeighta = heighta;
newX = 5087 - (rect.yCoordinate + widtha);
} else {
- adjustedWidth = heighta * 0.12;
+ adjustedWidth = heighta * scaleFactor;
adjustedHeight = widtha * 0.1;
// adjustedWidtha = widtha;
// adjustedHeighta = heighta;
newX = 5087 - (rect.yCoordinate + heighta);
- }
- // if (rect.angle === 0) {
- // adjustedWidth = heighta * 0.12;
- // adjustedHeight = widtha * 0.1;
- // adjustedWidtha = heighta;
- // adjustedHeighta = widtha;
- // newX = 5087 - (rect.xCoordinate + heighta);
- // } else {
- // adjustedWidth = widtha * 0.12;
- // adjustedHeight = heighta * 0.1;
- // adjustedWidtha = widtha;
- // adjustedHeighta = heighta;
- // newX = 5087 - (rect.xCoordinate + widtha);
- // }
+ }
return {
...rect,
- xcoordinate: newX * 0.12,
+ xcoordinate: newX * scaleFactor,
ycoordinate: rect.xCoordinate * 0.1,
width: adjustedWidth,
height: adjustedHeight,
@@ -78,7 +65,7 @@
}
if(data.intoGlass2!=null){
adjustedRects2.value = data.intoGlass2[0].map(rect => {
- console.log( adjustedRects2.value);
+ const scaleFactor = 794.67/5087;
let adjustedWidth, adjustedHeight, adjustedWidtha, adjustedHeighta,widtha,heighta;;
let newX = rect.yCoordinate;
if (rect.width < rect.height) {
@@ -89,34 +76,21 @@
heighta = rect.height;
}
if (rect.angle === 0) {
- adjustedWidth = widtha * 0.12;
+ adjustedWidth = widtha * scaleFactor;
adjustedHeight = heighta * 0.1;
// adjustedWidtha = widtha;
// adjustedHeighta = heighta;
newX = 5087 - (rect.yCoordinate + widtha);
} else {
- adjustedWidth = heighta * 0.12;
+ adjustedWidth = heighta * scaleFactor;
adjustedHeight = widtha * 0.1;
// adjustedWidtha = widtha;
// adjustedHeighta = heighta;
newX = 5087 - (rect.yCoordinate + heighta);
- }
- // if (rect.angle === 0) {
- // adjustedWidth = heighta * 0.12;
- // adjustedHeight = widtha * 0.1;
- // adjustedWidtha = heighta;
- // adjustedHeighta = widtha;
- // newX = 5087 - (rect.xCoordinate + heighta);
- // } else {
- // adjustedWidth = widtha * 0.12;
- // adjustedHeight = heighta * 0.1;
- // adjustedWidtha = widtha;
- // adjustedHeighta = heighta;
- // newX = 5087 - (rect.xCoordinate + widtha);
- // }
+ }
return {
...rect,
- xcoordinate: newX * 0.12,
+ xcoordinate: newX * scaleFactor,
ycoordinate: rect.xCoordinate * 0.1,
width: adjustedWidth,
height: adjustedHeight,
@@ -130,6 +104,7 @@
// 杩涚倝鍓�
if(data.waitingGlass!=null){
adjustedRectsa.value = data.waitingGlass[0].map(rect => {
+ const scaleFactor = 1621.78/5190;
let adjustedWidth, adjustedHeight, adjustedWidtha, adjustedHeighta,widtha,heighta;;
let newX = rect.yCoordinate;
if (rect.width < rect.height) {
@@ -140,13 +115,13 @@
heighta = rect.height;
}
if (rect.angle === 0) {
- adjustedWidth = widtha * 0.24;
+ adjustedWidth = widtha * scaleFactor;
adjustedHeight = heighta * 0.16;
// adjustedWidtha = widtha;
// adjustedHeighta = heighta;
newX = 5190 - (rect.yCoordinate + widtha);
} else {
- adjustedWidth = heighta * 0.24;
+ adjustedWidth = heighta * scaleFactor;
adjustedHeight = widtha * 0.16;
// adjustedWidtha = widtha;
// adjustedHeighta = heighta;
@@ -154,7 +129,7 @@
}
return {
...rect,
- x: newX * 0.24,
+ x: newX * scaleFactor,
y: rect.xCoordinate * 0.16,
width: adjustedWidth,
height: adjustedHeight,
@@ -168,7 +143,8 @@
// 宸插嚭鐐�
if(data.outGlass!=null){
adjustedRectsb.value = data.outGlass[0].map(rect => {
- let adjustedWidth, adjustedHeight, adjustedWidtha, adjustedHeighta,widtha,heighta;;
+ const scaleFactor = 1621.78/5190;
+ let adjustedWidth, adjustedHeight, adjustedWidtha, adjustedHeighta,widtha,heighta;;
let newX = rect.yCoordinate;
if (rect.width < rect.height) {
widtha = rect.height;
@@ -178,13 +154,13 @@
heighta = rect.height;
}
if (rect.angle === 0) {
- adjustedWidth = widtha * 0.24;
+ adjustedWidth = widtha * scaleFactor;
adjustedHeight = heighta * 0.16;
// adjustedWidtha = widtha;
// adjustedHeighta = heighta;
// newX = 5190 - (rect.yCoordinate + widtha);
} else {
- adjustedWidth = heighta * 0.24;
+ adjustedWidth = heighta * scaleFactor;
adjustedHeight = widtha * 0.16;
// adjustedWidtha = heighta;
// adjustedHeighta = widtha;
@@ -192,7 +168,7 @@
}
return {
...rect, // 澶嶅埗鍘熷瀵硅薄鐨勫叾浠栧睘鎬�
- x: newX * 0.24,
+ x: newX * scaleFactor,
y: rect.xCoordinate * 0.16,
width: adjustedWidth,
height: adjustedHeight,
--
Gitblit v1.8.0