/moth-graphcut

An interactive application with OpenCV for moth segmentation

Primary LanguagePythonMIT LicenseMIT

moth-graphcut

協助使用 ThermalCAM 軟體取得生物溫度之後, 想要取得各部位溫度的需求

original gray-scale
0 0

最終結果

left-top right-top left-bottom right-bottom body
lt rt lb rb body

Requirement

.SEQ to .txt

透過 ThermalCAM API 可以將他們自己的 .SEQ 檔案轉檔變成 .txt 格式會是一個透過逗號分隔的溫度矩陣, 每個 cell 都是一個攝氏溫度值

.txt to image

為了後面要透過 OpenCV 演算法將兩種圖片做 alignment, 必須要再將文字檔轉成圖片 這邊可以參考 ThermalCAM-converter

Workflow

0

Step 1: Graphcut

  • 可批次處理
  • 分為瀏覽模式與編輯模式
  • 可選擇是否透過 Floodfill 演算法去背
  • 可選擇是否透過調整 gamma 調整對比
  • 可選擇 threshold 來調整 output
  • 可透過 'h' 來檢視詳細命令
  • 存檔會以原始檔名新增資料夾, 儲存各部位切割檔與 metadata
  • 相容於 dearlep 資料

0

0

Step 2: alignment and mapping

  • 載入原始圖片與灰階溫度圖
  • 預載自動修正的結果
  • 可選擇手動標記

0

Step 3: component mapping

  • 給予溫度檔資料夾
  • 給予部位原圖資料夾
  • 給予轉換矩陣
  • 給予輪廓資訊
  • 可選擇是否要輸出圖片當作檢查
  • 可選擇每個部位的輸出檔案類型為 .npy .dat .txt

Metadata format

{
  "image": {
    "symmetry": [],
    "timestamp": "",
    "l_track": [],
    "r_track": [],
    "size": [],
    "path": "",
    "body_width": int
  },
  "fl": {
    "rect": [],
    "threshold_option": "",
    "threshold": int,
    "cnts": []
  },
  "fr": {
    "rect": [],
    "threshold_option": "",
    "threshold": int,
    "cnts": []
  },
  "bl": {
    "rect": [],
    "threshold_option": "",
    "threshold": int,
    "cnts": []
  },
  "br": {
    "rect": [],
    "threshold_option": "",
    "threshold": int,
    "cnts": []
  },
  "body": {
    "rect": [],
    "threshold_option": "",
    "threshold": int,
    "cnts": []
  }
}

Cited By