jellespijker / VisionSoilAnalyzer

Soil analyzer using an USB microscope - for Linux PC and Beaglebone Black
4 stars 1 forks source link

LabelBlobs still not working #46

Closed jellespijker closed 9 years ago

jellespijker commented 9 years ago

screenshot from 2015-07-17 13 12 31

Presumably something goes wrong with the depth search

  // Down the rabbit hole
  for (uint32_t i = 0; i < connectedLabels.size(); i++) {
      for (uint32_t j = 0; j < connectedLabels[i].size(); j++) {
          uint16_t CurrentVal = connectedLabels[i][j];
          uint16_t PrevVal = i;
          while (CurrentVal != PrevVal) {
              PrevVal = CurrentVal;
              CurrentVal = connectedLabels[PrevVal][0];
            }
          connectedLabels[i][j] = CurrentVal;
        }
    }
jellespijker commented 9 years ago

Hi Jochem,

can you take a look and hopefully see where I'm going wrong

picture and code is old. but the problem remains

jellespijker commented 9 years ago

The bug was in the consecutive numbering function