[OpenCV] C++ OpenCV Image Thresholding
·
OpenCV
c++과 opencv를 이용해 이미지 각 픽셀값을 thresholding하는 방법입니다. 이번 챕터에서는 아래 이미지를 입력으로 사용합니다. 계속 사용하게 될 threshold 함수의 원형은 아래와 같습니다.threshold(입력이미지, 출력이미지, 임계값, 최대값, 방식) 1. Binary Thresholding 픽셀값이 1~255 → 흰색(255)픽셀값이 0 → 검정(0) #include #include using namespace std;using namespace cv;int main() { // Read image Mat src = imread("threshold.png", IMREAD_GRAYSCALE); Mat dst; // Set threshold and maxValue ..