コード例 #1
0
ファイル: kdtree.cpp プロジェクト: blargg/ray-based-graphics
KDTree::KDTree(vector<Drawable *> objList) {
    assert(objList.size() > 0);

    root = new KDNode;
    root->objects = objList;
    bounds = findBounds(objList);
    buildTree(root, bounds, 0);
}
コード例 #2
0
ファイル: bound.cpp プロジェクト: tbl3rd/opencv-tutorials
 // 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);
 }
コード例 #3
0
ファイル: LcsColumnReader.cpp プロジェクト: Jach/luciddb
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);
        }
    }
}