This the code fragment for blur and the headers I included.
#include <opencv2/core.hpp>
#include <opencv2/core/cuda.hpp>
#include <opencv2/highgui.hpp>
#include <opencv2/opencv.hpp>
#include <opencv2/cudaimgproc.hpp>
#include <opencv2/cudaarithm.hpp>
#include <opencv2/cudafeatures2d.hpp>
cv::cuda::GpuMat inputImageGPU(inputImage);
cv::cuda::GpuMat sqImageGPU(sqImage);
cv::cuda::GpuMat blurredSqImageGPU(blurredSqImage);
cv::cuda::GpuMat blurredImageGPU(blurredImage);
cv::cuda::blur(inputImageGPU, blurredImageGPU, _objectFindingWindowSize, defaultPoint, cv::BorderTypes::BORDER_DEFAULT);
cv::cuda::blur(sqImageGPU, blurredSqImageGPU, _objectFindingWindowSize, defaultPoint, cv::BorderTypes::BORDER_DEFAULT);
then later in the code I do this and it tells be the + is not valid. All are GpuMat. Similar issue with - and *.
cv::cuda::GpuMat threshAndBlurredImage = threshImage + blurredImageGPU;