Quantcast
Channel: OpenCV Q&A Forum - RSS feed
Viewing all articles
Browse latest Browse all 41027

Finding Connected Components in Natural Color Images

$
0
0
I've been working on an application that extracts characters from natural images, i.e. color images with a lot of structure. Up to now I've been using Canny Edge Detector and the Stroke Width Transform to extract components from the image. For comparison I also want to use a different method based on segmentation by color. Basically, what I want is to split my image into different components consisting of neighboring pixels with similar color values. Based on popular approaches for connected component labeling I've iterated through the image and used Union-Find in order to merge similar regions. However, since I have natural images with a lot of structure, there are literally hundreds and hundreds of (mostly very small) components within one image. Note for example the structure of the trees: ![image description](http://blog.uprinting.com/wp-content/uploads/2013/08/Poltical-Yard-Signs.jpg) This makes that approach very slow (the first pass doing the raw labeling is very fast, but identifying which regions to merge for up to thousands of regions takes too much time). The problem persists even after filtering and using a coarser quantifization. I also tried to incorporate flood fill of OpenCV which brings the great functionality of utilizing a mask. I started flood fill from each pixel that was not yet assigned, which was quite fast. However, the mask uses uchar and therefore can't be used to store labels that are bigger than 255 so I had to use multiple masks which feels quite hacky. Also, flood fill is not very flexible regarding its similarity measure. The connected components functionality of OpenCV can of course not be used, since I don't work on binary images. Does anybody know of a good approach that can be used for my problem? Maybe I just haven't found the right functions in OpenCV yet?

Viewing all articles
Browse latest Browse all 41027

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>