Created
March 20, 2019 00:29
-
-
Save heaversm/0ac7cebe60b9e48268741716b06f0511 to your computer and use it in GitHub Desktop.
Using OpenCV Contrib White Balancing on a Mat in C++
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//install openCV contrib: https://cocoapods.org/pods/OpenCV2-contrib | |
/* | |
//in Podfile: | |
target 'MyProject' do | |
pod 'OpenCV2-contrib', '~> 3.2' | |
*/ | |
//pod install | |
#include <opencv2/core/core.hpp> | |
#include <opencv2/imgproc/imgproc.hpp> | |
#include <opencv2/xphoto/white_balance.hpp> | |
namespace myProject { | |
void myFunction(){ | |
cv::Mat gray; | |
cv::cvtColor(image, gray, CV_BGR2GRAY); | |
cv::Ptr<cv::xphoto::WhiteBalancer> wb = cv::xphoto::createSimpleWB(); | |
wb->balanceWhite(gray, gray); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment