I researched a bit about connected components. In either MATLAB or the OpenCV library, they always indicate that the kernel can be a 3x3 array and it can be either 4-connected or 8-connected. I did quite a bit of research but am unable to find an answer.
I know that a kernel can be in any shape. But in the connected components case, say, we have a 5x5 kernel, it can detect 1s even if they are in another label. (Due to size, 5x5 kernel can see 2 pixel area from anchor). And, say, we have 4x4 kernel (even sized kernel), in this case we don't even have an anchor. So my question is how can I apply connected component labeling with 4x4 and 5x5 kernels?
ceil([m/2, n/2])
(using 1-based indexing). – beaker