KDTree::KDTree(vector<Drawable *> objList) { assert(objList.size() > 0); root = new KDNode; root->objects = objList; bounds = findBounds(objList); buildTree(root, bounds, 0); }
// Draw bounds around contours with hierarchy over black bounds. // void showBounds(const std::vector<std::vector<cv::Point> > &contour, const std::vector<cv::Vec4i> &hierarchy) { static const cv::Mat black = cv::Mat::zeros(bounds.size(), bounds.type()); const int size = contour.size(); std::vector<std::vector<cv::Point> > polygon(size); std::vector<cv::Rect> rect(size); std::vector<cv::Point2f> center(size); std::vector<float> radius(size); findBounds(contour, polygon, rect, center, radius); black.copyTo(bounds); drawBounds(bounds, hierarchy, polygon, rect, center, radius); }
void LcsColumnReader::buildContainsMap() { uint nVals = getBatchValCount(); filters.filteringBitmap.resize(nVals); for (uint i = 0; i < filters.filterData.size(); i++) { uint nLoVal, nHiVal; findBounds(i, nLoVal, nHiVal, filters.readerKeyData); for (uint b = nLoVal; b < nHiVal; b++) { filters.filteringBitmap.set(b); } } }