opencv / opencv_contrib

Repository for OpenCV's extra modules
Apache License 2.0
9.42k stars 5.76k forks source link

cv::cuda::resize support for two-channel images is missing #2881

Open makkarpov opened 3 years ago

makkarpov commented 3 years ago
System information (version)

OpenCV: 4.5.0 git hash 37315babf9984a5b6aa981644a20dd8df1a5ff02

Detailed description

Currently OpenCV intentionally does not support cv::cuda::resize for CV_8UC2 images. However, this is required when handling NV12 bi-planar images, where chroma plane is exactly of that type.

Steps to reproduce

Just try to resize image, it'll fail.

Issue submission checklist
makkarpov commented 3 years ago

Well, I "fixed" that by enabling several template/macros instantiations. Should I make a PR?

alalek commented 3 years ago

This is done intentionally to reduce size of OpenCV binaries.

I believe we can enable that for CV_8UC2 case. Other cases are under the question of their value.

makkarpov commented 3 years ago

I don't see any use cases for other data types too. I think that enabling just 8UC2 will be sufficient.

alalek commented 3 years ago

Feel free to prepare PR for that (with corresponding simple test case)