Skip to content

Commit

Permalink
v0.5.1
Browse files Browse the repository at this point in the history
  • Loading branch information
zyddnys committed Jul 22, 2020
1 parent a2a0dc2 commit b97edf3
Showing 1 changed file with 12 additions and 7 deletions.
19 changes: 12 additions & 7 deletions src/main.cc
Original file line number Diff line number Diff line change
Expand Up @@ -244,14 +244,19 @@ std::vector<BBox> MergeBBoxes(std::vector<BBox> const& detects)
unite(i, j);
}

// final path compression
for (std::uint32_t i(0); i < num_detects; ++i)
bool compression(true);
while (compression)
{
auto root(i);
while (parents[root] != parents[parents[root]])
compression = false;
for (std::uint32_t i(0); i < num_detects; ++i)
{
parents[root] = parents[parents[root]];
root = parents[root];
auto root(i);
while (parents[root] != parents[parents[root]])
{
parents[root] = parents[parents[root]];
root = parents[root];
compression = true;
}
}
}

Expand Down Expand Up @@ -1548,7 +1553,7 @@ int main(int argc, char** argv) try {
{
// calculate L1 dist
auto diff(ImageL1Distance(last_frame, current_frame));
if (diff > 1e-3f)
if (diff > 2e-4f)
frame_changed = true;
//std::cout << "diff=" << diff << "\n";
}
Expand Down

0 comments on commit b97edf3

Please sign in to comment.