コード例 #1
0
ファイル: warpers.cpp プロジェクト: bowenqiang/Research
Point CylindricalWarperGpu::warp(const gpu::GpuMat &src, const Mat &K, const Mat &R, int interp_mode, int border_mode,
                                 gpu::GpuMat &dst)
{
    Rect dst_roi = buildMaps(src.size(), K, R, d_xmap_, d_ymap_);
    dst.create(dst_roi.height + 1, dst_roi.width + 1, src.type());
    gpu::remap(src, dst, d_xmap_, d_ymap_, interp_mode, border_mode);
    return dst_roi.tl();
}
コード例 #2
0
ファイル: blender.cpp プロジェクト: HuaJianNi/gtc-2015-lab
void MultiBandBlenderGpu::blend(gpu::GpuMat &d_dst)
{
    for (int i = 0; i <= num_bands_; ++i)
    {
        // d_dst_pyr_laplace_[i] /= d_dst_band_weights_[i];

        gpu::divide(d_dst_pyr_laplace_[i], d_dst_band_weights_[i], d_dst_pyr_laplace_[i], -1, stream_);
    }

    restoreImageFromLaplacePyrGpu(d_dst_pyr_laplace_);

    gpu::GpuMat d_dst_band_weights_roi = d_dst_band_weights_[0](Range(0, dst_roi_final_.height), Range(0, dst_roi_final_.width));
    gpu::GpuMat d_dst_empty_mask;
    gpu::compare(d_dst_band_weights_roi, WEIGHT_EPS, d_dst_empty_mask, cv::CMP_LE, stream_);

    gpu::GpuMat d_dst_pyr_laplace_roi = d_dst_pyr_laplace_[0](Range(0, dst_roi_final_.height), Range(0, dst_roi_final_.width));
    d_dst.create(d_dst_pyr_laplace_roi.size(), CV_16SC3);
    gpu::GpuMat d_dst_pyr_laplace_roi_16u(d_dst_pyr_laplace_roi.size(), CV_16UC4, d_dst_pyr_laplace_roi.data, d_dst_pyr_laplace_roi.step);
    gpu::GpuMat d_dst_16u(d_dst.size(), CV_16UC3, d_dst.data, d_dst.step);
    gpu::cvtColor(d_dst_pyr_laplace_roi_16u, d_dst_16u, cv::COLOR_BGRA2BGR, 0, stream_);
    stream_.enqueueMemSet(d_dst, Scalar::all(0), d_dst_empty_mask);

    stream_.waitForCompletion();
}