scan operations are moved in separate header
This commit is contained in:
@@ -80,51 +80,9 @@ namespace cv { namespace gpu { namespace device
|
||||
template <typename T>
|
||||
void resize_gpu(DevMem2Db src, DevMem2Db srcWhole, int xoff, int yoff, float fx, float fy,
|
||||
DevMem2Db dst, int interpolation, cudaStream_t stream);
|
||||
|
||||
template <typename T>
|
||||
void resize_area_gpu(const DevMem2Db src, DevMem2Db dst,float fx, float fy,
|
||||
int interpolation, DevMem2Df buffer, cudaStream_t stream);
|
||||
}
|
||||
}}}
|
||||
|
||||
void cv::gpu::resize(const GpuMat& src, GpuMat& dst, GpuMat& buffer, Size dsize, double fx, double fy,
|
||||
int interpolation, Stream& s)
|
||||
{
|
||||
CV_Assert(src.depth() <= CV_32F && src.channels() <= 4);
|
||||
CV_Assert(interpolation == INTER_AREA);
|
||||
CV_Assert( (fx < 1.0) && (fy < 1.0));
|
||||
CV_Assert(!(dsize == Size()) || (fx > 0 && fy > 0));
|
||||
CV_Assert(src.cols >= 128 && src.rows >= 128);
|
||||
CV_Assert((fx - 128.0) <= 0 && (fy - 128.0) <= 0);
|
||||
|
||||
if (dsize == Size())
|
||||
dsize = Size(saturate_cast<int>(src.cols * fx), saturate_cast<int>(src.rows * fy));
|
||||
else
|
||||
{
|
||||
fx = static_cast<double>(dsize.width) / src.cols;
|
||||
fy = static_cast<double>(dsize.height) / src.rows;
|
||||
}
|
||||
|
||||
fx = static_cast<float>(1.0 / fx);
|
||||
fy = static_cast<float>(1.0 / fy);
|
||||
|
||||
dst.create(dsize, src.type());
|
||||
buffer.create(cv::Size(dsize.width, src.rows), CV_32FC1);
|
||||
|
||||
if (dsize == src.size())
|
||||
{
|
||||
if (s)
|
||||
s.enqueueCopy(src, dst);
|
||||
else
|
||||
src.copyTo(dst);
|
||||
return;
|
||||
}
|
||||
|
||||
cudaStream_t stream = StreamAccessor::getStream(s);
|
||||
|
||||
cv::gpu::device::imgproc::resize_area_gpu<uchar>(src, dst, fx, fy, interpolation, buffer, stream);
|
||||
}
|
||||
|
||||
void cv::gpu::resize(const GpuMat& src, GpuMat& dst, Size dsize, double fx, double fy, int interpolation, Stream& s)
|
||||
{
|
||||
CV_Assert(src.depth() <= CV_32F && src.channels() <= 4);
|
||||
|
||||
Reference in New Issue
Block a user