Find the maximum connected component

89 Views Asked by At

I have a binary image (image1). Now I want to detection where is the figure ( may be include big text) in original image. I use haar wavelet transform and detec a image B include some position may be the figure of A. (image 2). If I use image A - image B = image C (image 3) it may be not good be cause we have some boundary. Now I want remove the boundary or detect exactly the figure in image A? how to do that ?.

I tried to use connected component, but it run over time.

There is my image: ( I can't upload directly image here)

Image A- imageB =Image C ( that mean if A(i,j)==1 and B(i,j)==1 then C(i,j)=0;)

1

There are 1 best solutions below

0
On

Standard connected component algorithms will work fine and execute in linear time.

I would recommend doing it by BFS (Breadth-First-Search) rather than a recursive DFS (Depth-First-Search), to avoid possible stack overflows.