{
 "原理:相機如何成像,顏色如何被分出來#2": {
  "type": "bar",
  "labels": [
   "寬 40 px",
   "寬 20 px"
  ],
  "values": [
   45,
   90
  ],
  "unit": "cm",
  "reveal": [
   0,
   0,
   0,
   0,
   1,
   2
  ],
  "highlight": 1
 },
 "原理:相機如何成像,顏色如何被分出來#3": {
  "type": "table",
  "head": [
   "方法",
   "算式",
   "結果"
  ],
  "rows": [
   [
    "精確",
    "arctan(0.5 × tan 30°)",
    "約 16.1°"
   ],
   [
    "線性近似",
    "0.5 × 30°",
    "15°"
   ]
  ],
  "reveal": [
   0,
   1,
   2
  ]
 },
 "原理:相機如何成像,顏色如何被分出來#4": {
  "type": "flow",
  "layout": "row",
  "reveal": [
   0,
   0,
   4
  ],
  "nodes": [
   {
    "label": "影像寬",
    "sub": "320 像素",
    "color": 1
   },
   {
    "label": "取一半",
    "sub": "320 ÷ 2 = 160",
    "color": 0
   },
   {
    "label": "除以 tan 30°",
    "sub": "160 ÷ 0.5774",
    "color": 3
   },
   {
    "label": "焦距 f",
    "sub": "約 277 像素",
    "color": 2,
    "kind": "end"
   }
  ]
 },
 "原理:相機如何成像,顏色如何被分出來#5": {
  "type": "table",
  "head": [
   "量",
   "算式",
   "結果"
  ],
  "rows": [
   [
    "距離 d",
    "277 × 6.5 ÷ 40",
    "約 45 cm"
   ],
   [
    "方向角",
    "arctan(0.5 × tan 30°) = arctan 0.2887",
    "約 16.1°"
   ]
  ],
  "reveal": [
   0,
   1,
   2
  ],
  "widths": [
   1,
   3,
   1.3
  ]
 },
 "原理:相機如何成像,顏色如何被分出來#7": {
  "type": "cards",
  "reveal": [
   0,
   1,
   2,
   3
  ],
  "cards": [
   {
    "title": "BGR",
    "points": [
     "亮度一變",
     "三個值都跟著變",
     "不適合判斷紅色"
    ]
   },
   {
    "title": "HSV",
    "points": [
     "H 色相、S 飽和度",
     "V 明度",
     "OpenCV 的 H:0~179"
    ]
   },
   {
    "title": "inRange 遮罩",
    "points": [
     "符合的變白、其他變黑",
     "找最大白色區塊",
     "得到球的位置和大小"
    ]
   }
  ]
 },
 "相機入門:取得影像與認識色彩空間#5": {
  "type": "bar",
  "labels": [
   "640×480",
   "320×240"
  ],
  "values": [
   307200,
   76800
  ],
  "unit": "像素",
  "reveal": [
   0,
   0,
   0,
   1,
   2
  ],
  "highlight": 1
 },
 "相機入門:取得影像與認識色彩空間#6": {
  "type": "table",
  "head": [
   "項目",
   "範圍 / 說明"
  ],
  "rows": [
   [
    "H 色相",
    "0 ~ 179"
   ],
   [
    "S 飽和度",
    "0 ~ 255"
   ],
   [
    "V 明度",
    "0 ~ 255"
   ],
   [
    "綠色 H",
    "約 40 ~ 80"
   ],
   [
    "藍色 H",
    "約 100 ~ 130"
   ],
   [
    "紅色 H",
    "近 0 與 179,兩段合併"
   ]
  ],
  "reveal": [
   0,
   0,
   1,
   2,
   3,
   3,
   6
  ]
 },
 "顏色追蹤:從像素到馬達#2": {
  "type": "flow",
  "layout": "snake",
  "reveal": [
   2,
   8
  ],
  "nodes": [
   {
    "label": "擷取影像",
    "color": 0
   },
   {
    "label": "縮小",
    "color": 1
   },
   {
    "label": "轉成 HSV",
    "color": 2
   },
   {
    "label": "inRange",
    "sub": "顏色遮罩",
    "color": 3
   },
   {
    "label": "形態學",
    "sub": "去掉雜點",
    "color": 4
   },
   {
    "label": "最大輪廓",
    "color": 0
   },
   {
    "label": "中心與大小",
    "sub": "cx、size",
    "color": 1
   },
   {
    "label": "決策與控制",
    "color": 2,
    "kind": "end"
   }
  ]
 },
 "顏色追蹤:從像素到馬達#6": {
  "type": "table",
  "head": [
   "畫面訊號",
   "意義"
  ],
  "rows": [
   [
    "cx < 0",
    "球在左側"
   ],
   [
    "cx > 0",
    "球在右側"
   ],
   [
    "size 夠大",
    "很近,停車"
   ]
  ],
  "reveal": [
   1,
   3
  ]
 },
 "顏色追蹤:從像素到馬達#7": {
  "type": "table",
  "head": [
   "情況",
   "左輪",
   "右輪"
  ],
  "rows": [
   [
    "沒看到球",
    "−25",
    "+25"
   ],
   [
    "size > 0.25",
    "停車",
    "停車"
   ],
   [
    "其他",
    "35 + 30×cx",
    "35 − 30×cx"
   ]
  ],
  "reveal": [
   0,
   1,
   2,
   3,
   3
  ]
 },
 "物件辨識與推論延遲的取捨#1": {
  "type": "cards",
  "reveal": [
   0,
   2,
   2
  ],
  "cards": [
   {
    "title": "顏色追蹤",
    "points": [
     "看某種顏色",
     "背景同色會被誤認"
    ]
   },
   {
    "title": "物件辨識",
    "points": [
     "訓練好的神經網路",
     "標籤、外框、信心分數",
     "代價:更多運算、更長延遲"
    ]
   }
  ]
 },
 "物件辨識與推論延遲的取捨#3": {
  "type": "flow",
  "layout": "row",
  "reveal": [
   0,
   1,
   2,
   3
  ],
  "nodes": [
   {
    "label": "影像前處理",
    "sub": "縮放 320×320",
    "color": 1
   },
   {
    "label": "推論",
    "sub": "invoke / run",
    "color": 3
   },
   {
    "label": "後處理",
    "sub": "信心門檻 + NMS",
    "color": 2,
    "kind": "end"
   }
  ]
 },
 "物件辨識與推論延遲的取捨#5": {
  "type": "waterfall",
  "unit": "ms",
  "reveal": [
   0,
   5,
   5,
   5,
   5
  ],
  "items": [
   {
    "label": "擷取",
    "value": 20
   },
   {
    "label": "前處理",
    "value": 10
   },
   {
    "label": "推論",
    "value": 50
   },
   {
    "label": "後處理+控制",
    "value": 10
   },
   {
    "label": "總延遲",
    "value": 90,
    "kind": "total"
   }
  ]
 },
 "物件辨識與推論延遲的取捨#6": {
  "type": "table",
  "head": [
   "模型",
   "總延遲",
   "最高幀率",
   "期間前進"
  ],
  "rows": [
   [
    "小模型",
    "90 ms",
    "約 11 張/秒",
    "1.8 cm"
   ],
   [
    "大模型",
    "約 250 ms",
    "約 4 張/秒",
    "5 cm"
   ]
  ],
  "reveal": [
   1,
   2
  ]
 },
 "物件辨識與推論延遲的取捨#7": {
  "type": "flow",
  "layout": "row",
  "reveal": [
   0,
   0,
   1,
   2,
   3,
   4
  ],
  "nodes": [
   {
    "label": "記下開始時間",
    "color": 0
   },
   {
    "label": "呼叫偵測函式",
    "color": 1
   },
   {
    "label": "算經過毫秒",
    "color": 2
   },
   {
    "label": "印出推論時間",
    "sub": "連跑 100 張",
    "color": 3,
    "kind": "end"
   }
  ]
 }
}