当前位置: 首页>>代码示例>>C++>>正文


C++ GpuMat::row方法代码示例

本文整理汇总了C++中GpuMat::row方法的典型用法代码示例。如果您正苦于以下问题:C++ GpuMat::row方法的具体用法?C++ GpuMat::row怎么用?C++ GpuMat::row使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在GpuMat的用法示例。


在下文中一共展示了GpuMat::row方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: ensureSizeIsEnough

void cv::gpu::ORB_GPU::mergeKeyPoints(GpuMat& keypoints)
{
    using namespace cv::gpu::device::orb;

    int nAllkeypoints = 0;

    for (int level = 0; level < nLevels_; ++level)
        nAllkeypoints += keyPointsCount_[level];

    if (nAllkeypoints == 0)
    {
        keypoints.release();
        return;
    }

    ensureSizeIsEnough(ROWS_COUNT, nAllkeypoints, CV_32FC1, keypoints);

    int offset = 0;

    for (int level = 0; level < nLevels_; ++level)
    {
        if (keyPointsCount_[level] == 0)
            continue;

        float sf = getScale(scaleFactor_, firstLevel_, level);

        GpuMat keyPointsRange = keypoints.colRange(offset, offset + keyPointsCount_[level]);

        float locScale = level != firstLevel_ ? sf : 1.0f;

        mergeLocation_gpu(keyPointsPyr_[level].ptr<short2>(0), keyPointsRange.ptr<float>(0), keyPointsRange.ptr<float>(1), keyPointsCount_[level], locScale, 0);

        GpuMat range = keyPointsRange.rowRange(2, 4);
        keyPointsPyr_[level](Range(1, 3), Range(0, keyPointsCount_[level])).copyTo(range);

        keyPointsRange.row(4).setTo(Scalar::all(level));
        keyPointsRange.row(5).setTo(Scalar::all(patchSize_ * sf));

        offset += keyPointsCount_[level];
    }
}
开发者ID:4auka,项目名称:opencv,代码行数:41,代码来源:orb.cpp

示例2: nonmaxSupression_gpu

int cv::gpu::FAST_GPU::getKeyPoints(GpuMat& keypoints)
{
    using namespace cv::gpu::cudev::fast;

    if (count_ == 0)
        return 0;

    ensureSizeIsEnough(ROWS_COUNT, count_, CV_32FC1, keypoints);

    if (nonmaxSupression)
        return nonmaxSupression_gpu(kpLoc_.ptr<short2>(), count_, score_, keypoints.ptr<short2>(LOCATION_ROW), keypoints.ptr<float>(RESPONSE_ROW));

    GpuMat locRow(1, count_, kpLoc_.type(), keypoints.ptr(0));
    kpLoc_.colRange(0, count_).copyTo(locRow);
    keypoints.row(1).setTo(Scalar::all(0));

    return count_;
}
开发者ID:406089450,项目名称:opencv,代码行数:18,代码来源:fast.cpp

示例3: nonmaxSupression_gpu

int cv::gpu::FAST_GPU::getKeyPoints(GpuMat& keypoints)
{
    using namespace cv::gpu::device::fast;

    if (!TargetArchs::builtWith(GLOBAL_ATOMICS) || !DeviceInfo().supports(GLOBAL_ATOMICS))
        CV_Error(CV_StsNotImplemented, "The device doesn't support global atomics");

    if (count_ == 0)
        return 0;

    ensureSizeIsEnough(ROWS_COUNT, count_, CV_32FC1, keypoints);

    if (nonmaxSupression)
        return nonmaxSupression_gpu(kpLoc_.ptr<short2>(), count_, score_, keypoints.ptr<short2>(LOCATION_ROW), keypoints.ptr<float>(RESPONSE_ROW));

    GpuMat locRow(1, count_, kpLoc_.type(), keypoints.ptr(0));
    kpLoc_.colRange(0, count_).copyTo(locRow);
    keypoints.row(1).setTo(Scalar::all(0));

    return count_;
}
开发者ID:KeisukeNoda,项目名称:opencv,代码行数:21,代码来源:fast.cpp

示例4: d_votes

void cv::gpu::GeneralizedHough_GPU::download(const GpuMat& d_positions, OutputArray h_positions_, OutputArray h_votes_)
{
    if (d_positions.empty())
    {
        h_positions_.release();
        if (h_votes_.needed())
            h_votes_.release();
        return;
    }

    CV_Assert(d_positions.rows == 2 && d_positions.type() == CV_32FC4);

    h_positions_.create(1, d_positions.cols, CV_32FC4);
    Mat h_positions = h_positions_.getMat();
    d_positions.row(0).download(h_positions);

    if (h_votes_.needed())
    {
        h_votes_.create(1, d_positions.cols, CV_32SC3);
        Mat h_votes = h_votes_.getMat();
        GpuMat d_votes(1, d_positions.cols, CV_32SC3, const_cast<int3*>(d_positions.ptr<int3>(1)));
        d_votes.download(h_votes);
    }
}
开发者ID:bigjun,项目名称:opencv-2.4.8,代码行数:24,代码来源:generalized_hough.cpp


注:本文中的GpuMat::row方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。