반응형
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
- broscoding
- cudnn
- paragraph
- web
- KNeighborsClassifier
- html
- 데이터전문기관
- discrete_scatter
- web 개발
- 대이터
- postorder
- tensorflow
- 결합전문기관
- bccard
- CES 2O21 참가
- web 용어
- 머신러닝
- pycharm
- mglearn
- java역사
- C언어
- CES 2O21 참여
- inorder
- 재귀함수
- 웹 용어
- 자료구조
- classification
- web 사진
- Keras
- vscode
Archives
- Today
- Total
bro's coding
QRcode read in C++ 본문
반응형
#include "opencv2/opencv.hpp"
#include<iostream>
using namespace cv;
using namespace std;
void decode_qrcode() {
VideoCapture cap(0);
if (!cap.isOpened()) {
cerr << "Camera open failed!" << endl;
return;
}
QRCodeDetector detector;
Mat frame;
while (true) {
cap >> frame;
if (frame.empty()) {
cerr << "Frame load fialed!" << endl;
break;
}
vector<Point> points;
String info = detector.detectAndDecode(frame, points);
if (!info.empty()) {
polylines(frame, points, true, Scalar(0, 0, 255), 2);
putText(frame, info, Point(10, 30), FONT_HERSHEY_SIMPLEX, 1, Scalar(0, 0, 255));
}
imshow("frame", frame);
if (waitKey(1) == 27)
break;
}
}
int main() {
decode_qrcode();
return 0;
}
반응형
'[AI] > openCV' 카테고리의 다른 글
명함 인식 in python (0) | 2020.06.25 |
---|---|
이미지 변형 in python (0) | 2020.06.24 |
opencv install in python (0) | 2020.06.23 |
detect workers in C++ (0) | 2020.06.23 |
adaptiveThreshold (0) | 2020.06.23 |
binarization (0) | 2020.06.23 |
Canny_edge (0) | 2020.06.23 |
sobel_edge (0) | 2020.06.23 |
Comments