Add Grana's connected components algorithm for 8-way connectivity. (#6823)

* Add Grana's connected components algorithm for 8-way connectivity. That algorithm is faster than Wu's one (currently implemented in opencv). For more details see https://github.com/prittt/YACCLAB.

* New functions signature and distance transform compatibility

* Add tests to imgproc/test/test_connectedcomponents.cpp

* Change of test_connectedcomponents.cpp for c++98 support
This commit is contained in:
Vadim Pisarevsky
2016-08-26 16:01:00 +04:00
committed by GitHub
parent 4f0f5a24ef
commit 5ddd25313f
4 changed files with 1486 additions and 53 deletions
+1 -1
View File
@@ -827,7 +827,7 @@ void cv::distanceTransform( InputArray _src, OutputArray _dst, OutputArray _labe
if( labelType == CV_DIST_LABEL_CCOMP )
{
Mat zpix = src == 0;
connectedComponents(zpix, labels, 8, CV_32S);
connectedComponents(zpix, labels, 8, CV_32S, CCL_WU);
}
else
{