A few changes to comply with upstream requirements for merge.

-Change input/output order from (out Labeled, in Image) -> (in Image, Out Labeled) and convert
to Input/OutputArrays in the process.

-Adopt OutputArray for statistics export so that the algorithm is "wrapper friendly" and not requiring a new struct in
language bindings at the expense of using doubles for everything and slowing statistics computation down..
This commit is contained in:
Jason Newton
2012-11-27 02:25:52 -08:00
parent d5aa679d3f
commit 00bdca7684
4 changed files with 59 additions and 66 deletions

View File

@@ -12,7 +12,7 @@ static void on_trackbar(int, void*)
{
Mat bw = threshval < 128 ? (img < threshval) : (img > threshval);
Mat labelImage(img.size(), CV_32S);
uint64_t nLabels = connectedComponents(labelImage, bw, 8);
int nLabels = connectedComponents(bw, labelImage, 8);
Vec3b colors[nLabels];
colors[0] = Vec3b(0, 0, 0);//background
for(int label = 1; label < nLabels; ++label){