added support of 4-channels images to StereoConstantSpaceBP.

refactored transpose_gpu, made it non template function.
This commit is contained in:
Vladislav Vinogradov
2010-12-08 07:23:59 +00:00
parent c18aa438ec
commit 905e5f1739
5 changed files with 32 additions and 31 deletions

View File

@@ -272,20 +272,11 @@ void cv::gpu::divide(const GpuMat& src, const Scalar& sc, GpuMat& dst)
namespace cv { namespace gpu { namespace mathfunc
{
template <typename T>
void transpose_gpu(const DevMem2D& src, const DevMem2D& dst);
void transpose_gpu(const DevMem2Di& src, const DevMem2Di& dst);
}}}
void cv::gpu::transpose(const GpuMat& src, GpuMat& dst)
{
using namespace cv::gpu::mathfunc;
typedef void (*func_t)(const DevMem2D& src, const DevMem2D& dst);
static const func_t funcs[] =
{
transpose_gpu<uchar4>, transpose_gpu<char4>, transpose_gpu<ushort2>, transpose_gpu<short2>,
transpose_gpu<int>, transpose_gpu<float>
};
CV_Assert(src.type() == CV_8UC1 || src.type() == CV_8UC4 || src.type() == CV_8SC4
|| src.type() == CV_16UC2 || src.type() == CV_16SC2 || src.type() == CV_32SC1 || src.type() == CV_32FC1);
@@ -301,7 +292,7 @@ void cv::gpu::transpose(const GpuMat& src, GpuMat& dst)
}
else
{
funcs[src.depth()](src, dst);
mathfunc::transpose_gpu(src, dst);
}
}