I build OpenCV based on
with minor changes.
Below is my OpenCV build config:
local CMAKEFLAGS="
-D BUILD_EXAMPLES=OFF
-D BUILD_opencv_python2=ON
-D BUILD_opencv_python3=ON
-D CMAKE_BUILD_TYPE=RELEASE
-D CMAKE_INSTALL_PREFIX=${PREFIX}
-D CUDA_ARCH_BIN=5.3,6.2,7.2
-D CUDA_ARCH_PTX=
-D CUDA_FAST_MATH=ON
-D CUDNN_VERSION=‘8.0’
-D EIGEN_INCLUDE_PATH=/usr/include/eigen3
-D ENABLE_NEON=ON
-D OPENCV_DNN_CUDA=ON
-D OPENCV_ENABLE_NONFREE=ON
-D OPENCV_EXTRA_MODULES_PATH=/tmp/build_opencv/opencv_contrib/modules
-D OPENCV_GENERATE_PKGCONFIG=ON
-D WITH_CUBLAS=ON
-D WITH_CUDA=ON
-D WITH_CUDNN=ON
-D WITH_GSTREAMER=ON
-D WITH_LIBV4L=ON
-D WITH_OPENGL=ON
-D WITH_QT=ON
-D WITH_FFMPEG=ON
-D WITH_TBB=ON
-D WITH_V4L=ON"
Below is my test code with how the processing time measured.
cuda::HoughCirclesDetector test code:
cv::cuda::GpuMat gray_gpu;
gray_gpu.upload(gray_img);
int64 t0 = cv::getTickCount();
cv::Ptr<cv::cuda::HoughCirclesDetector> houghCircles = cv::cuda::createHoughCirclesDetector(1.0f, 7, 180, 40, 17, 80);
cv::cuda::GpuMat d_circles;
houghCircles->detect(gray_gpu, d_circles);
qDebug() << " Proc time: " << (cv::getTickCount() - t0) * 1000 / (int64)cv::getTickFrequency() << "ms";
The cv::HoughCircles code is as below:
int64 t0 = cv::getTickCount();
vector<cv::Vec4f> circles;
HoughCircles(gray, circles, HOUGH_GRADIENT, 1, 7,180,40,17,80);
qDebug() << " Proc time: " << (cv::getTickCount() - t0) * 1000 / (int64)cv::getTickFrequency() << "ms";
They are tested with the same video.
The processing time (average):
cuda::HoughCirclesDetector: 8 ms
cv::HoughCircles: 2 ms
I have noticed the post of
where says
Please build openCV with correct GPU architecture. sm=53 for Nano.
Would you please let me know is there any build config issue?
Where can I set GPU architecture sm = 53 for Jetson nano?
Thanks