Skip to content

Instantly share code, notes, and snippets.

View handsomeboy's full-sized avatar
💭
Looking for a job about CV & NLP

Ding HAN handsomeboy

💭
Looking for a job about CV & NLP
View GitHub Profile

Connected Component Labeling using OpenCV

一般使用計算連通物件的方法分別為Two-Pass及Seed-Filling這兩種,可以選擇使用4連通(4-connected)或者8連通(8-connected)去串連物件。

在OpenCV還沒有提供connectedComponentsAPI之前大家會使用findcontours去計算連通物件,有興趣可以參考這篇Find Contours using OpenCV

Two-Pass Algorithm with 4-connected

第一次檢查條件