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


C++ FloatImage::cpuMem方法代码示例

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


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

示例1: updateImpl

TDV_NAMESPACE_BEGIN

FloatImage MedianFilterCPU::updateImpl(FloatImage input)
{
    const Dim dim = input.dim();

    CvMat *image = input.cpuMem();

    FloatImage output = FloatImage::CreateCPU(dim);
    CvMat *img_output = output.cpuMem();

    cvSmooth(image, img_output, CV_GAUSSIAN, 5);

    return output;
}
开发者ID:flair2005,项目名称:ThunderVision,代码行数:15,代码来源:medianfiltercpu.cpp

示例2: update

bool SemiglobalLabMatcher::update()
{
    WriteGuard<ReadWritePipe<FloatImage, FloatImage> > wguard(m_wpipe);
    FloatImage leftImg, rightImg;   
    if ( m_lrpipe->read(&leftImg) && m_rrpipe->read(&rightImg) )
    {
        Dim dsiDim(leftImg.dim().width(), leftImg.dim().height(), 
                   m_maxDisparity);
        
        float *leftImg_d = leftImg.devMem();
        float *rightImg_d = rightImg.devMem();   
        FloatImage dispImage = FloatImage::CreateDev(
            Dim(dsiDim.width(), dsiDim.height()));
     
        cudaPitchedPtr aggregDSI = m_aggregDSI.mem(dsiDim);
        SGPath *paths = m_sgPaths.getDescDev(dispImage.dim());
                   
        
        SemiGlobalLabDevRun(dsiDim, paths, m_sgPaths.pathCount(),
                            leftImg_d, rightImg_d,
                            aggregDSI, dispImage.devMem(), m_zeroAggregDSI);
        m_zeroAggregDSI = false;
        
        dispImage.cpuMem();
        wguard.write(dispImage);        
    }
    
    return wguard.wasWrite();
}
开发者ID:flair2005,项目名称:ThunderVision,代码行数:29,代码来源:semigloballabmatcher.cpp

示例3: update

bool FastWTAMatcher::update()
{
    WriteGuard<ReadWritePipe<FloatImage, FloatImage> > wguard(m_wpipe);
    FloatImage leftImg, rightImg;   
    if ( m_lrpipe->read(&leftImg) && m_rrpipe->read(&rightImg) )
    {
        float *leftImg_d = leftImg.devMem();
        float *rightImg_d = rightImg.devMem();   
        
        Dim dsiDim(leftImg.dim().width(), leftImg.dim().height(), 
                   m_maxDisparity);
        FloatImage image = FloatImage::CreateDev(
            Dim(dsiDim.width(), dsiDim.height()));
        FastWTADevRun(dsiDim, leftImg_d, rightImg_d, image.devMem());
        
        image.cpuMem();
        wguard.write(image);        
    }
    
    return wguard.wasWrite();
}
开发者ID:flair2005,项目名称:ThunderVision,代码行数:21,代码来源:fastwtamatcher.cpp

示例4: update

bool StereoCorrespondenceCV::update()
{
    WriteGuard<ReadWritePipe<FloatImage> > wguard(m_wpipe);
    FloatImage limg, rimg;

    if ( m_lrpipe->read(&limg) && m_rrpipe->read(&rimg) )
    {
        CvMat *limg_c = limg.cpuMem();
        CvMat *rimg_c = rimg.cpuMem();
        
        CvMat *limg8u_c = m_limg8U.getImage(cvGetSize(limg_c));
        CvMat *rimg8u_c = m_rimg8U.getImage(cvGetSize(rimg_c));

        cvConvertScale(limg_c, limg8u_c, 255.0);
        cvConvertScale(rimg_c, rimg8u_c, 255.0);

        FloatImage output = FloatImage::CreateCPU(
            Dim::minDim(limg.dim(), rimg.dim()));
        CvMat *out_c = output.cpuMem();
        
        CudaBenchmarker bMarker;
        bMarker.begin();
        
        if ( m_mode == LocalMatching )
            cvFindStereoCorrespondenceBM(limg8u_c, rimg8u_c, out_c, m_bmState);
        else
            cvFindStereoCorrespondenceGC(limg8u_c, rimg8u_c, out_c, NULL,
                                         m_gcState);
        
        bMarker.end();
        m_mark.addProbe(bMarker.elapsedTime());
        wguard.write(output);

        FloatImageSinkPol::sink(limg);
        FloatImageSinkPol::sink(rimg);
    }

    return wguard.wasWrite();
}
开发者ID:flair2005,项目名称:ThunderVision,代码行数:39,代码来源:stereocorrespondencecv.cpp


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