Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update OpenCV CUDA includes to work with OpenCV 4.5.0 and CUDA 11.4 #13

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
#include <opencv2/opencv.hpp>

#ifdef HAS_CUDA
#include <opencv2/cudaarithm.hpp>
#include <npp.h>
#include <opencv2/core/cuda.hpp>
#include <opencv2/cudaimgproc.hpp>
Expand Down Expand Up @@ -66,6 +67,7 @@ class ColorCalibrationModule {

void colorCorrection(cv::Mat& image);
#ifdef HAS_CUDA
#include <opencv2/cudaarithm.hpp>
void colorCorrection(cv::cuda::GpuMat& image);
#endif

Expand All @@ -81,6 +83,7 @@ class ColorCalibrationModule {
cv::Scalar color_calibration_bias_;

#ifdef HAS_CUDA
#include <opencv2/cudaarithm.hpp>
Npp32f gpu_color_calibration_matrix_[3][4] = {{1.f, 0.f, 0.f, 0.f}, {0.f, 1.f, 0.f, 0.f}, {0.f, 0.f, 1.f, 0.f}};
#endif
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
#include <opencv2/opencv.hpp>

#ifdef HAS_CUDA
#include <opencv2/cudaarithm.hpp>
#include <opencv2/core/cuda.hpp>
#include <opencv2/cudaimgproc.hpp>
#endif
Expand Down Expand Up @@ -48,6 +49,7 @@ class ColorEnhancerModule {
private:
void enhance(cv::Mat& image);
#ifdef HAS_CUDA
#include <opencv2/cudaarithm.hpp>
void enhance(cv::cuda::GpuMat& image);
#endif

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
#include <opencv2/opencv.hpp>

#ifdef HAS_CUDA
#include <opencv2/cudaarithm.hpp>
#include <opencv2/core/cuda.hpp>
#include <opencv2/cudaimgproc.hpp>
#endif
Expand Down Expand Up @@ -56,6 +57,7 @@ class DebayerModule {
void saveDebayeredImage(cv::Mat& image);

#ifdef HAS_CUDA
#include <opencv2/cudaarithm.hpp>
void debayer(cv::cuda::GpuMat& image, std::string& encoding);
void saveDebayeredImage(cv::cuda::GpuMat& image);
#endif
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
#include <opencv2/opencv.hpp>

#ifdef HAS_CUDA
#include <opencv2/cudaarithm.hpp>
#include <opencv2/core/cuda.hpp>
#include <opencv2/cudaimgproc.hpp>
#endif
Expand Down Expand Up @@ -52,6 +53,7 @@ class FlipModule {
void saveFlippedImage(cv::Mat& image);

#ifdef HAS_CUDA
#include <opencv2/cudaarithm.hpp>
void flip(cv::cuda::GpuMat& image);
void saveFlippedImage(cv::cuda::GpuMat& image);
#endif
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
#include <opencv2/opencv.hpp>

#ifdef HAS_CUDA
#include <opencv2/cudaarithm.hpp>
#include <opencv2/core/cuda.hpp>
#include <opencv2/cudaimgproc.hpp>
#endif
Expand Down Expand Up @@ -52,6 +53,7 @@ class GammaCorrectionModule {
// Wrapper methods (GPU)
//-----------------------------------------------------------------------------
#ifdef HAS_CUDA
#include <opencv2/cudaarithm.hpp>
void gammaCorrectCustom(cv::cuda::GpuMat& image);
void gammaCorrectDefault(cv::cuda::GpuMat& image);
#endif
Expand All @@ -75,6 +77,7 @@ class GammaCorrectionModule {
cv::Mat cpu_lut_;

#ifdef HAS_CUDA
#include <opencv2/cudaarithm.hpp>
cv::Ptr<cv::cuda::LookUpTable> gpu_lut_;
#endif
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
#include <opencv2/opencv.hpp>

#ifdef HAS_CUDA
#include <opencv2/cudaarithm.hpp>
#include <opencv2/core/cuda.hpp>
#include <opencv2/cudaimgproc.hpp>
#include <opencv2/cudawarping.hpp>
Expand Down Expand Up @@ -91,6 +92,7 @@ class UndistortionModule {
void saveUndistortedImage(cv::Mat& image);

#ifdef HAS_CUDA
#include <opencv2/cudaarithm.hpp>
void undistort(cv::cuda::GpuMat& image);
void saveUndistortedImage(cv::cuda::GpuMat& image);
#endif
Expand Down Expand Up @@ -127,6 +129,7 @@ class UndistortionModule {
cv::Mat undistortion_map_y_;

#ifdef HAS_CUDA
#include <opencv2/cudaarithm.hpp>
cv::cuda::GpuMat gpu_undistortion_map_x_;
cv::cuda::GpuMat gpu_undistortion_map_y_;
#endif
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
#include <opencv2/opencv.hpp>

#ifdef HAS_CUDA
#include <opencv2/cudaarithm.hpp>
#include <opencv2/core/cuda.hpp>
#include <opencv2/cudaimgproc.hpp>
#endif
Expand Down Expand Up @@ -45,6 +46,7 @@ class VignettingCorrectionModule {
private:
void correct(cv::Mat& image);
#ifdef HAS_CUDA
#include <opencv2/cudaarithm.hpp>
void correct(cv::cuda::GpuMat& image);
#endif

Expand All @@ -60,6 +62,7 @@ class VignettingCorrectionModule {
cv::Mat vignetting_mask_f_;
cv::Mat image_f_;
#ifdef HAS_CUDA
#include <opencv2/cudaarithm.hpp>
cv::cuda::GpuMat gpu_vignetting_mask_f_;
cv::cuda::GpuMat gpu_image_f_;
#endif
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
#include <memory>

#ifdef HAS_CUDA
#include <opencv2/cudaarithm.hpp>
#include <opencv2/core/cuda.hpp>
#include <opencv2/cudaimgproc.hpp>
#include <opencv2/cudawarping.hpp>
Expand Down Expand Up @@ -98,6 +99,7 @@ class WhiteBalanceModule {
// White balance wrapper methods (GPU)
//-----------------------------------------------------------------------------
#ifdef HAS_CUDA
#include <opencv2/cudaarithm.hpp>
void balanceWhiteSimple(cv::cuda::GpuMat& image);
void balanceWhiteGreyWorld(cv::cuda::GpuMat& image);
void balanceWhiteLearned(cv::cuda::GpuMat& image);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
#include <opencv2/xphoto.hpp>

#ifdef HAS_CUDA
#include <opencv2/cudaarithm.hpp>
#include <opencv2/core/cuda.hpp>
#include <opencv2/cudaimgproc.hpp>
#include <opencv2/cudawarping.hpp>
Expand Down Expand Up @@ -177,6 +178,7 @@ class RawImagePipeline {
}

#ifdef HAS_CUDA
#include <opencv2/cudaarithm.hpp>
void saveDebugImage(const cv::cuda::GpuMat& image, const std::string& filename) const {
cv::Mat tmp;
image.download(tmp);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ inspired by Jonathan Barron's "Fast Fourier Color Constancy", CVPR, 2017
#include <opencv2/opencv.hpp>

#ifdef HAS_CUDA
#include <opencv2/cudaarithm.hpp>
#include <opencv2/core/cuda.hpp>
#include <opencv2/cudaarithm.hpp>
#endif
Expand All @@ -47,6 +48,7 @@ class ConvolutionalColorConstancyWB {

Model<cv::Mat> model_;
#ifdef HAS_CUDA
#include <opencv2/cudaarithm.hpp>
Model<cv::cuda::GpuMat> gpu_model_;
#endif

Expand Down Expand Up @@ -106,6 +108,7 @@ class ConvolutionalColorConstancyWB {

// Compute and apply RGB gains
#ifdef HAS_CUDA
#include <opencv2/cudaarithm.hpp>
int computeResponseCuda();
void applyGainsCuda(cv::cuda::GpuMat& image);
#endif
Expand All @@ -117,6 +120,7 @@ class ConvolutionalColorConstancyWB {

// Applies white balance
#ifdef HAS_CUDA
#include <opencv2/cudaarithm.hpp>
void balanceWhite(const cv::cuda::GpuMat& src, cv::cuda::GpuMat& dst);
#endif
void balanceWhite(const cv::Mat& src, cv::Mat& dst);
Expand Down