opencv_contrib icon indicating copy to clipboard operation
opencv_contrib copied to clipboard

How do I get the center of connectedComponents with cuda ?

Open THEBAHWALT opened this issue 2 years ago • 2 comments

System information (version)
  • OpenCV => 4.7.0.72
  • Operating System / Platform => Windows 10
  • Compiler => Visual Studio Code
  • OpenCV extra module => cuda
Detailed description

I'm working on connected component analysis using OpenCV-CUDA, and I want to use the API 'cv2.cuda.labelComponents'. According to the official documentation of OpenCV 4.7.0, this API should exist. However, when I try to use it in Python, I get an attribute error. Is there anyone who has experience using OpenCV-CUDA in Python and can offer an alternative method to obtain the center points of connected components?

THEBAHWALT avatar Apr 18 '23 13:04 THEBAHWALT

According to the official documentation of OpenCV 4.7.0, this API should exist. However, when I try to use it in Python, I get an attribute error.

It exists without python bindings but it is disabled for CUDA >= 8.0. You should cv::cuda::connectedComponents.

Is there anyone who has experience using OpenCV-CUDA in Python and can offer an alternative method to obtain the center points of connected components?

See the link above.

cudawarped avatar Apr 18 '23 15:04 cudawarped