Created
December 5, 2013 11:53
-
-
Save hargup/7804103 to your computer and use it in GitHub Desktop.
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
#include "opencv2/core/core.hpp" | |
#include "opencv2/imgproc/imgproc.hpp" | |
#include "opencv2/highgui/highgui.hpp" | |
#include <iostream> | |
using namespace cv; | |
using namespace std; | |
int main(int argc, char ** argv) | |
{ | |
Mat img, res; | |
img = imread(argv[1], 0); | |
threshold(img, res, 0, 255, CV_THRESH_BINARY | CV_THRESH_OTSU); | |
imwrite("img_bin.png",res); | |
return 0; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment