Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <opencv2/imgproc/imgproc.hpp>
- #include <opencv2/highgui/highgui.hpp>
- using namespace cv;
- int main ( int argc, char **argv )
- {
- Mat im_gray = imread("img3.jpg",CV_LOAD_IMAGE_GRAYSCALE);
- Mat im_rgb = imread("img3.jpg");
- cvtColor(im_rgb,im_gray,CV_RGB2GRAY);
- Mat img_bw = im_gray > 115;
- imwrite("img_bw3.jpg", img_bw);
- return 0;
- }
- cvThreshold(scr, dst, 128, 255, CV_THRESH_BINARY | CV_THRESH_OTSU);
- cv::threshold(im_gray, img_bw, 0, 255, CV_THRESH_BINARY | CV_THRESH_OTSU);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement