diff --git a/results_simple/01_grid_overlay.png b/results_simple/01_grid_overlay.png index 81d3168..3f56b7e 100644 Binary files a/results_simple/01_grid_overlay.png and b/results_simple/01_grid_overlay.png differ diff --git a/results_simple/02_col_projection.png b/results_simple/02_col_projection.png index ec94d4a..0465774 100644 Binary files a/results_simple/02_col_projection.png and b/results_simple/02_col_projection.png differ diff --git a/results_simple/03_row_projection.png b/results_simple/03_row_projection.png index 37a39c6..84afd77 100644 Binary files a/results_simple/03_row_projection.png and b/results_simple/03_row_projection.png differ diff --git a/results_simple/04_histogram.png b/results_simple/04_histogram.png index be052dd..0edfb14 100644 Binary files a/results_simple/04_histogram.png and b/results_simple/04_histogram.png differ diff --git a/src/cDNA_gridding_simple.py b/src/cDNA_gridding_simple.py index 0e528a5..e566e19 100644 --- a/src/cDNA_gridding_simple.py +++ b/src/cDNA_gridding_simple.py @@ -6,7 +6,7 @@ D:\ProgramData\anaconda3\envs\my_env\python.exe src/cDNA_gridding_simple.py 一、算法流程总览 - 灰度图 ──→ Otsu求像素最佳阈值 T ──→ 百分比 = T/255(自适应) + 灰度图 ──→ Otsu求像素最佳阈值 T ──→ 百分比 = T/2550(自适应,范围0~10%) │ ├─→ 投影/减阈值/过零点配对 ──→ 网格线 │ @@ -26,7 +26,7 @@ D:\ProgramData\anaconda3\envs\my_env\python.exe src/cDNA_gridding_simple.py 横轴:np.sum(每列) → 曲线,高点=斑点列,低点=空隙列 纵轴:np.sum(每行) → 曲线,高点=斑点行,低点=空隙行 - 4. 阈值 X = (max-min) × (T/255) + 4. 阈值 X = (max-min) × (T/2550) 5. 曲线减 X → 大于 0 = 斑点区域,小于 0 = 空隙 过零点 = 斑点和空隙的分界线 @@ -112,7 +112,7 @@ def draw_grid_lines(gray: np.ndarray): 返回 (纵线, 横线, T, pct, 列投影, 行投影, 减阈值后的列投影, 减阈值后的行投影) """ T = otsu_threshold_pixels(gray) # 像素级最佳阈值 - pct = T / 255.0 # 归一化为百分比 + pct = T / 2550.0 # 自适应百分比(范围 0~10%) H, W = gray.shape # ---- 1. 横轴投影 ---- diff --git a/web/app.py b/web/app.py index d6c14fc..9f2e278 100644 --- a/web/app.py +++ b/web/app.py @@ -44,7 +44,7 @@ def otsu_threshold_pixels(gray): def draw_grid_lines(gray): T = otsu_threshold_pixels(gray) - pct = T / 255.0 + pct = T / 2550.0 H, W = gray.shape col_prof = np.sum(gray, axis=0).astype(float) row_prof = np.sum(gray, axis=1).astype(float)