반응형
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
- java역사
- 재귀함수
- web 용어
- 결합전문기관
- inorder
- vscode
- bccard
- 자료구조
- tensorflow
- web 사진
- mglearn
- 머신러닝
- 웹 용어
- Keras
- pycharm
- web 개발
- 데이터전문기관
- html
- discrete_scatter
- paragraph
- 대이터
- cudnn
- C언어
- classification
- broscoding
- web
- CES 2O21 참가
- KNeighborsClassifier
- CES 2O21 참여
- postorder
Archives
- Today
- Total
bro's coding
detect workers in C++ 본문
반응형
#include"opencv2/opencv.hpp"
#include<iostream>
#include<String.h>
using namespace cv;
using namespace std;
int main() {
VideoCapture cap("C:/opencv/opencv-4.0.0/samples/data/vtest.avi");
if (!cap.isOpened()) {
cerr << "Video open failed!" << endl;
return -1;
}
HOGDescriptor hog;
hog.setSVMDetector(HOGDescriptor::getDefaultPeopleDetector());
Mat frame;
while (true) {
cap >> frame;
if (frame.empty()) {
break;
}
vector<Rect> detected;
hog.detectMultiScale(frame, detected);
String text = format("count : %d", detected.size());
putText(frame, text, Point(20, 50), FONT_HERSHEY_SIMPLEX, 1, Scalar(0, 0, 255));
for (Rect r : detected) {
Scalar c = Scalar(rand() % 256, rand() % 256, rand() % 256);
rectangle(frame, r, c, 3);
}
imshow("frame", frame);
if (waitKey(10) == 27)
break;
}
return 0;
}
반응형
'[AI] > openCV' 카테고리의 다른 글
손가락 인식 키보드 in python (0) | 2020.06.30 |
---|---|
명함 인식 in python (0) | 2020.06.25 |
이미지 변형 in python (0) | 2020.06.24 |
opencv install in python (0) | 2020.06.23 |
QRcode read in C++ (0) | 2020.06.23 |
adaptiveThreshold (0) | 2020.06.23 |
binarization (0) | 2020.06.23 |
Canny_edge (0) | 2020.06.23 |
Comments