- 新增碗尺寸识别主应用界面,支持图片拖拽、选择和摄像头实时检测 - 界面显示碗的尺寸类别、直径、置信度及算法方法 - 支持计算食物重量,依据秤示数和碗重差值计算 - 实现核心检测模块,采用霍夫圆变换和轮廓法两种检测方法融合 - 检测结果包含尺寸分类和置信度估计,支持绘制调试信息 - 提供交互式标定工具,支持批量加载样本图片并自动检测直径 - 标定工具计算阈值和碗重量,生成并保存配置文件config.json - 界面友好,提供当前状态提示和结果预览功能
110 lines
1.9 KiB
JSON
110 lines
1.9 KiB
JSON
{
|
|
"_comment": "碗尺寸识别配置文件 - 通过 calibrate.py 标定后自动生成/更新",
|
|
"calibrated": true,
|
|
"scale_id": "default",
|
|
"thresholds": {
|
|
"small_max_diameter": 1167.0,
|
|
"medium_max_diameter": 1330.0,
|
|
"description": "像素直径阈值:<=small_max为小碗,<=medium_max为中碗,其余为大碗"
|
|
},
|
|
"calibration_samples": {
|
|
"small": [
|
|
1133.1,
|
|
1106.0,
|
|
1020.0,
|
|
1148.0,
|
|
1078.3,
|
|
1108.7,
|
|
1251.4,
|
|
1102.0,
|
|
1116.0,
|
|
1028.0,
|
|
1242.0,
|
|
1236.0,
|
|
1071.7,
|
|
1024.5,
|
|
1093.8,
|
|
1034.0,
|
|
1108.0,
|
|
1128.1,
|
|
1020.0,
|
|
1138.0,
|
|
1098.0,
|
|
1140.0,
|
|
1076.0,
|
|
1030.0,
|
|
1140.0,
|
|
1062.0
|
|
],
|
|
"medium": [
|
|
1258.5,
|
|
1314.6,
|
|
1174.0,
|
|
1172.1,
|
|
1180.0,
|
|
1331.9,
|
|
1251.5,
|
|
1255.9,
|
|
1237.8,
|
|
1182.0,
|
|
1250.0,
|
|
1220.9,
|
|
1271.2,
|
|
1250.3,
|
|
1213.4,
|
|
1213.3,
|
|
1185.8,
|
|
1223.7,
|
|
1192.5,
|
|
1194.0,
|
|
1182.0,
|
|
1255.4,
|
|
1252.0
|
|
],
|
|
"large": [
|
|
1358.7,
|
|
1496.2,
|
|
1344.0,
|
|
1494.0,
|
|
1464.0,
|
|
1497.7,
|
|
1494.0,
|
|
1480.4,
|
|
1503.7,
|
|
1490.0,
|
|
1403.1,
|
|
1348.5,
|
|
1434.1,
|
|
1334.6,
|
|
1442.0,
|
|
1350.3,
|
|
1490.0,
|
|
1354.7,
|
|
1412.1
|
|
]
|
|
},
|
|
"detection": {
|
|
"min_circularity": 0.5,
|
|
"min_area_ratio": 0.03,
|
|
"max_area_ratio": 0.95,
|
|
"blur_kernel_size": 11,
|
|
"canny_threshold1": 20,
|
|
"canny_threshold2": 60,
|
|
"hough_dp": 1.2,
|
|
"hough_min_dist_ratio": 0.3,
|
|
"hough_param1": 60,
|
|
"hough_param2": 25,
|
|
"hough_min_radius_ratio": 0.05,
|
|
"hough_max_radius_ratio": 0.5
|
|
},
|
|
"bowl_weights_grams": {
|
|
"small": 10.0,
|
|
"medium": 20.0,
|
|
"large": 30.0
|
|
},
|
|
"calibration_averages": {
|
|
"small": 1105.1,
|
|
"medium": 1228.8,
|
|
"large": 1431.2
|
|
}
|
|
} |