Browse Source

fix: 移除默认阈值,确保从目标数据中获取梯度和锚点阈值

master
qinjian 2 months ago
parent
commit
4b54e31dcb
  1. 4
      client/src/sections/wuyuanbiaoba/components/TargetDetailModal.jsx
  2. 1
      client/src/sections/wuyuanbiaoba/components/TemplateModal.jsx
  3. 8
      client/src/sections/wuyuanbiaoba/hooks/useTargetStorage.js
  4. 1
      client/src/utils/parseProcessData.js

4
client/src/sections/wuyuanbiaoba/components/TargetDetailModal.jsx

@ -34,8 +34,8 @@ const TargetDetailModal = ({
name: targetData.name || "", name: targetData.name || "",
radius: targetData.radius || "", radius: targetData.radius || "",
isReferencePoint: targetData.isReferencePoint || false, isReferencePoint: targetData.isReferencePoint || false,
gradientThreshold: targetData.gradientThreshold || 100, gradientThreshold: targetData.gradientThreshold,
anchorThreshold: targetData.anchorThreshold || 80, anchorThreshold: targetData.anchorThreshold,
gaussianBlurThreshold: targetData.gaussianBlurThreshold || 3, gaussianBlurThreshold: targetData.gaussianBlurThreshold || 3,
}); });
// //

1
client/src/sections/wuyuanbiaoba/components/TemplateModal.jsx

@ -158,7 +158,6 @@ const TemplateModal = ({
const handleOk = async () => { const handleOk = async () => {
try { try {
debugger;
const values = await form.validateFields(); const values = await form.validateFields();
// //

8
client/src/sections/wuyuanbiaoba/hooks/useTargetStorage.js

@ -87,8 +87,8 @@ export const useTargetStorage = () => {
radius: info.radius || 40.0, radius: info.radius || 40.0,
isReferencePoint: info.base || false, isReferencePoint: info.base || false,
// 根据实际数据结构映射阈值 // 根据实际数据结构映射阈值
gradientThreshold: threshold.gradient || 100, // 梯度阈值 gradientThreshold: threshold.gradient , // 梯度阈值
anchorThreshold: threshold.anchor || 80, // 锚点阈值 anchorThreshold: threshold.anchor, // 锚点阈值
gaussianBlurThreshold: threshold.gauss || 3, gaussianBlurThreshold: threshold.gauss || 3,
binaryThreshold: threshold.binary || 120, // 保留二值化阈值 binaryThreshold: threshold.binary || 120, // 保留二值化阈值
hasAdvancedConfig: true, // 有配置数据的都认为是有高级配置 hasAdvancedConfig: true, // 有配置数据的都认为是有高级配置
@ -145,8 +145,8 @@ export const useTargetStorage = () => {
threshold: { threshold: {
binary: target.binaryThreshold || 120, binary: target.binaryThreshold || 120,
gauss: target.gaussianBlurThreshold || 1, gauss: target.gaussianBlurThreshold || 1,
gradient: target.gradientThreshold || 100, gradient: target.gradientThreshold,
anchor: target.anchorThreshold || 80, anchor: target.anchorThreshold,
}, },
radius: parseFloat(target.radius) || 40.0, radius: parseFloat(target.radius) || 40.0,
id: target.id || target.key, id: target.id || target.key,

1
client/src/utils/parseProcessData.js

@ -53,7 +53,6 @@ const dataRecursionObj = (dataObj, index, needData, lastKeyObj, nd) => {
return gotValue return gotValue
} else { } else {
if (keyObj.isGroup) { if (keyObj.isGroup) {
debugger
for (let item of dataObj[keyObj.prKey]) { for (let item of dataObj[keyObj.prKey]) {
const gotValue = dataRecursionObj(item, index + 1, needData, lastKeyObj, nd) const gotValue = dataRecursionObj(item, index + 1, needData, lastKeyObj, nd)
if (gotValue) { if (gotValue) {

Loading…
Cancel
Save