반응형
Notice
Recent Posts
Recent Comments
Link
일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | ||||||
2 | 3 | 4 | 5 | 6 | 7 | 8 |
9 | 10 | 11 | 12 | 13 | 14 | 15 |
16 | 17 | 18 | 19 | 20 | 21 | 22 |
23 | 24 | 25 | 26 | 27 | 28 |
Tags
- Keras
- web
- discrete_scatter
- KNeighborsClassifier
- 재귀함수
- 머신러닝
- postorder
- bccard
- 대이터
- paragraph
- 결합전문기관
- cudnn
- 자료구조
- classification
- web 개발
- 웹 용어
- C언어
- web 용어
- mglearn
- CES 2O21 참여
- 데이터전문기관
- html
- tensorflow
- inorder
- java역사
- broscoding
- CES 2O21 참가
- pycharm
- web 사진
- vscode
Archives
- Today
- Total
bro's coding
binarization 본문
반응형
이진화
#include "opencv2/opencv.hpp"
#include <iostream>
using namespace cv;
using namespace std;
void on_thredhold(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;
if (argc < 2) {
src = imread("family.jpg", IMREAD_GRAYSCALE);
}
else {
src = imread(argv[1], IMREAD_GRAYSCALE);
}
if (src.empty()) {
cerr << "Image load failed!" << endl;
return -1;
}
imshow("src", src);
namedWindow("dst");
createTrackbar("Threshold", "dst", 0, 255, on_thredhold, (void*)&src);
setTrackbarPos("Threshold", "dst", 128);
waitKey();
return 0;
}
반응형
'[AI] > openCV' 카테고리의 다른 글
opencv install in python (0) | 2020.06.23 |
---|---|
detect workers in C++ (0) | 2020.06.23 |
QRcode read in C++ (0) | 2020.06.23 |
adaptiveThreshold (0) | 2020.06.23 |
Canny_edge (0) | 2020.06.23 |
sobel_edge (0) | 2020.06.23 |
setMouseCallback (0) | 2020.06.23 |
affine_transform in C++ (0) | 2020.06.22 |
Comments