11 for (
auto gi =
bounds.first; gi !=
bounds.second; ++gi) {
12 if ((
int)ret.size() <= gi) {
15 ret[gi].push_back(blob);
29 int nproj =
std::min((
int)proj.size(), gr.second);
30 for (
grid_index_t gind = gr.first; gind < nproj; ++gind) {
31 const auto& some = proj[gind];
32 uniq.insert(some.begin(), some.end());
34 return blobvec_t(uniq.begin(), uniq.end());
40 const auto& strip = blob->strips()[layer];
51 return overlap(blob, newproj, layer);
57 const size_t siz = blobs.size();
59 for (
size_t ind=0; ind<siz; ++ind) {
60 ret[ind] = blobs.begin()+ind;
67 const auto& astrips = a->strips();
68 const auto& bstrips = b->strips();
69 const int nlayers = astrips.size();
71 int ainb = 0, bina = 0;
72 for (
int ilayer=0; ilayer<nlayers; ++ilayer) {
73 const auto& astrip = astrips[ilayer];
74 const auto& bstrip = bstrips[ilayer];
75 const auto& abounds = astrip.bounds;
76 const auto& bbounds = bstrip.bounds;
77 if (abounds.first <= bbounds.first and bbounds.second <= abounds.second) {
80 if (bbounds.first <= abounds.first and abounds.second <= bbounds.second) {
84 if (ainb == nlayers or bina == nlayers) {
93 if (one.empty() or two.empty()) {
96 const size_t nlayers = two[0].strips().size();
97 const size_t ilayer = nlayers-1;
99 for (
blobref_t blob = one.begin(); blob != one.end(); ++blob) {
100 auto assoc =
overlap(blob, proj, ilayer);
std::vector< blobref_t > blobvec_t
blobvec_t select(const blobproj_t &proj, grid_range_t range)
std::vector< blobvec_t > blobproj_t
void associate(const blobs_t &one, const blobs_t &two, associator_t func)
std::function< void(blobref_t &a, blobref_t &b)> associator_t
std::pair< grid_index_t, grid_index_t > grid_range_t
blobs_t::const_iterator blobref_t
BoundingBox bounds(int x, int y, int w, int h)
const GenericPointer< typename T::ValueType > T2 T::AllocatorType & a
std::vector< Blob > blobs_t
T min(sqlite3 *const db, std::string const &table_name, std::string const &column_name)
blobvec_t references(const blobs_t &blobs)
blobvec_t overlap(const blobref_t &blob, const blobproj_t &proj, layer_index_t layer)
blobproj_t projection(const blobvec_t &blobs, layer_index_t layer)
bool surrounding(const blobref_t &a, const blobref_t &b)
const Ray & bounds() const
Return the ray representing the bounds.
std::unordered_set< blobref_t, blobref_hash > blobset_t