어제보다 나은 내가 되자
이진화, threshold 본문
#include <opencv2/opencv.hpp>
using namespace std;
using namespace cv;
void on_threshold(int pos, void* userdata) {
Mat src = *(Mat*)userdata;
Mat dst;
threshold(src, dst, pos, 255, THRESH_BINARY);
imshow("dst", dst);
}
int main(int argc, char* argv[]) {
Mat src;
src = imread("neutrophils.png", IMREAD_GRAYSCALE);
imshow("src", src);
namedWindow("dst");
createTrackbar("Threshold", "dst", 0, 255, on_threshold, (void*)&src);
waitKey();
return 0;
}
'영상처리' 카테고리의 다른 글
레이블링, connectedComponents와 connectedComponentsWithStats (0) | 2020.05.13 |
---|---|
적응형 이진화, adaptivethreshold (0) | 2020.05.13 |
히스토그램 역투영을 통한 피부색 영역 검출, calcBackProject (0) | 2020.05.13 |
특정 색상 영역 분할, inRange (0) | 2020.05.13 |
컬러 영상 히스토그램 평활화 (0) | 2020.05.13 |
Comments