本文整理汇总了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;
}
示例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();
}
示例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();
}
示例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();
}