refactored gpu::convolve function:

* converted it to Algorithm
* old API still can be used for source compatibility (marked as deprecated)
This commit is contained in:
Vladislav Vinogradov
2013-04-26 12:40:03 +04:00
parent 26a4be89b1
commit 8461cb3f4b
5 changed files with 175 additions and 141 deletions
+5 -4
View File
@@ -172,15 +172,16 @@ namespace
return;
}
gpu::ConvolveBuf convolve_buf;
convolve_buf.user_block_size = buf.user_block_size;
Ptr<gpu::Convolution> conv = gpu::createConvolution(buf.user_block_size);
if (image.channels() == 1)
gpu::convolve(image.reshape(1), templ.reshape(1), result, true, convolve_buf, stream);
{
conv->convolve(image.reshape(1), templ.reshape(1), result, true, stream);
}
else
{
GpuMat result_;
gpu::convolve(image.reshape(1), templ.reshape(1), result_, true, convolve_buf, stream);
conv->convolve(image.reshape(1), templ.reshape(1), result_, true, stream);
extractFirstChannel_32F(result_, result, image.channels(), StreamAccessor::getStream(stream));
}
}