#include<opencv2/opencv.hpp>
#include<iostream>

using namespace cv;
using namespace std;

void setup() {
  // put your setup code here, to run once:
  Mat lena = imread("./1.bmp", 1);
  if (!lena.data) 
  {
      cout << "Input image reading error!" << endl;
      return;
  }

  Mat lena_gray, lena_threshold;
  cvtColor(lena, lena_gray, COLOR_BGR2GRAY);
  imwrite("./lena_gray.jpg", lena_gray);

  threshold(lena_gray, lena_threshold, 170, 255, THRESH_BINARY);
  imwrite("./lena_threshold.jpg", lena_threshold);
}

void loop() {
  // put your main code here, to run repeatedly:

}
