This paper presents a two-pass clustering technique for orientation-invariant text line clustering in a language-independent text localization problem based on the connected component analysis (CCA) approach. Instead of doing a single-pass cluster in the conventional way, the proposed technique firstly explores nearby objects around the candidate components. By setting up the global constraints with the affinity metrics, the system can obtain the component samples in the area corresponding to each candidate component. Then, the system gathers information in order to tune the constraint parameters, which are compatible to each component environment. The second clustering is performed again to retrieve the refine neighbors group based on tuned local constraints. Finally, text lines are constructed based on graph hypothesis. The experiment demonstrated that our proposed clustering technique improve the recall rate comparing to existing text clustering method.