Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- void pyTest(){
- PyAdapter ka_;
- String inp_vid = "m.mp4";
- int* vs;
- int w, h, f_n;
- uint64_t ts;
- VideoSourceCreate(&vs, inp_vid.c_str(), video_source::FFMPEG);
- VideoSourceGetWidth(vs, &w);
- VideoSourceGetHeight(vs, &h);
- Mat3b frame(h, w), frame_s;
- while (VideoSourceReadFrameBGR(vs, frame.data) == 0) {
- resize(frame, frame_s, Size(), 0.5, 0.5);
- if (ka_.Detect(frame_s) < 0)
- break;
- vector<pair<char, Rect>> &lbls = ka_.GetLabels();
- for (int i = 0; i < lbls.size(); i++) {
- rectangle(frame_s, lbls.at(i).second, CV_RGB(10, 20, 30));
- }
- imshow("out", frame_s);
- cvWaitKey(10);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement