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