Final Project
挖仔尾溼地報告
Goal
• 如何在不干擾螃蟹的情況下,去統計一定 面積內的螃蟹數量。
Approach
• 利用螃蟹 ( 以清白招潮為例 ) 和泥灘地顏色 的反差。
• 用程式去統計螃蟹的數量。
Naïve Thought
• 1. 找出哪些區域可能是螃蟹 ( 白色 )
• 2. 將相連在一起的部分視為同一隻 (Connec ted Component) 並紀錄數量
• 3. 過濾較不可能的部分 ( 顏色、大小 )
Algorithm
• 1. Detect pixels by linear scan
• 2. if(this pixel is positive)
• 3. check the area of connected component
• 4. draw the area as RED
• 5. if(this RED area is CRAB)
• 6. CRAB NUMBER + 1
• 7. else
• 8. draw the area as BLUE
• 9. end
Linear Scan
Connected Component
1. If positive pixel
2. call check (here) 3. end
1. Check (place):
2. check (up)
3. check (down)
4. check (left)
5. check (right)
6. end
Connected Component
1. If positive pixel 2. draw it as RED 3. call check (here) 4. end
1. Check (place):
2. check (up) 3. check (down) 4. check (left) 5. check (right) 6. end
Connected Component (Cont’d)
1. If positive pixel 2. draw it as RED 3. call check (here) 4. end
1. Check (place):
2. check (up) 3. check (down) 4. check (left) 5. check (right) 6. end
Decheck
1. If this area is NOT crab 2. draw it as BLUE 3. call decheck (here) 4. end
1. decheck (place):
2. decheck (up) 3. decheck (down) 4. decheck (left) 5. decheck (right) 6. end
Criterion
• 只要是靠近白色 (R,G,B >= 170) 就當它可能 是螃蟹
• 我們假設拍照距離螃蟹約 3~5 公尺,這樣 螃蟹的大小約在 10~150 pixels
• 如果顏色偏綠色 (abs(G,R) >= 60 & || abs(G, B) >= 60 ) ,那它應該就是葉子
Show the Result
Results Summary
PIC # Number Area
1 475 25
2 685 20
3 1063 31.25
4 946 31.25
… … …
10 173 5
密度 = 35.07 隻 / 平方公尺 sample 標準差 = 4.36