반응형
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 | 29 | 30 | 31 |
Tags
- java역사
- pycharm
- 자료구조
- 재귀함수
- CES 2O21 참여
- web 용어
- CES 2O21 참가
- 대이터
- C언어
- 데이터전문기관
- postorder
- bccard
- vscode
- web
- 결합전문기관
- classification
- web 개발
- mglearn
- web 사진
- paragraph
- Keras
- discrete_scatter
- inorder
- KNeighborsClassifier
- broscoding
- cudnn
- 머신러닝
- tensorflow
- html
- 웹 용어
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