|
@ -287,24 +287,23 @@ const CameraView = ({ |
|
|
if (videoRect && rectangles.length < maxRectangles) { |
|
|
if (videoRect && rectangles.length < maxRectangles) { |
|
|
const nextIndex = Number(rectangles[rectangles.length - 1]?.id) ? Number(rectangles[rectangles.length - 1]?.id)-100+1 : 1; |
|
|
const nextIndex = Number(rectangles[rectangles.length - 1]?.id) ? Number(rectangles[rectangles.length - 1]?.id)-100+1 : 1; |
|
|
const fixedId = `10${nextIndex}`; |
|
|
const fixedId = `10${nextIndex}`; |
|
|
|
|
|
|
|
|
// 根据选中的模板预设参数 |
|
|
// 根据选中的模板预设参数 |
|
|
const templateParams = selectedTemplate |
|
|
const templateParams = selectedTemplate |
|
|
? { |
|
|
? { |
|
|
// 从模板中获取参数 |
|
|
// 从模板中获取参数 |
|
|
name: `target${nextIndex}` || selectedTemplate.name, |
|
|
name: `T_${nextIndex}` || selectedTemplate.name, |
|
|
radius: selectedTemplate.physicalRadius || 40.0, |
|
|
radius: selectedTemplate.physicalRadius || 40.0, |
|
|
isReferencePoint: selectedTemplate.isBaseline || false, |
|
|
isReferencePoint: selectedTemplate.isBaseline || false, |
|
|
gradientThreshold: |
|
|
gradientThreshold: |
|
|
selectedTemplate.gradientThresholdValue || 100, |
|
|
selectedTemplate.gradientThresholdValue, |
|
|
anchorThreshold: selectedTemplate.anchorThresholdValue || 80, |
|
|
anchorThreshold: selectedTemplate.anchorThresholdValue, |
|
|
gaussianBlurThreshold: selectedTemplate.gaussianBlur || 3, |
|
|
gaussianBlurThreshold: selectedTemplate.gaussianBlur || 3, |
|
|
binaryThreshold: selectedTemplate.binaryThreshold || 120, |
|
|
binaryThreshold: selectedTemplate.binaryThreshold || 120, |
|
|
hasAdvancedConfig: false, |
|
|
hasAdvancedConfig: false, |
|
|
} |
|
|
} |
|
|
: { |
|
|
: { |
|
|
// 默认参数 |
|
|
// 默认参数 |
|
|
name: `target${nextIndex}`, |
|
|
name: `T_${nextIndex}`, |
|
|
radius: 40.0, |
|
|
radius: 40.0, |
|
|
isReferencePoint: false, |
|
|
isReferencePoint: false, |
|
|
gradientThreshold: 100, |
|
|
gradientThreshold: 100, |
|
@ -758,8 +757,8 @@ const CameraView = ({ |
|
|
threshold: { |
|
|
threshold: { |
|
|
binary: rect.binaryThreshold || 120, |
|
|
binary: rect.binaryThreshold || 120, |
|
|
gauss: rect.gaussianBlurThreshold || 1, |
|
|
gauss: rect.gaussianBlurThreshold || 1, |
|
|
gradient: rect.gradientThreshold || 100, |
|
|
gradient: rect.gradientThreshold, |
|
|
anchor: rect.anchorThreshold || 80, |
|
|
anchor: rect.anchorThreshold, |
|
|
}, |
|
|
}, |
|
|
radius: rect.radius || 40.0, |
|
|
radius: rect.radius || 40.0, |
|
|
id: rect.id || targetKey, // 使用原始ID |
|
|
id: rect.id || targetKey, // 使用原始ID |
|
|