ALT Linux Bugzilla
– Attachment 15421 Details for
Bug 49199
[2.3] join dfpl@
New bug
|
Search
|
[?]
|
Help
Register
|
Log In
[x]
|
Forgot Password
Login:
[x]
|
EN
|
RU
Пример программы (определение кол-ва лиц в фас на фотографии)
facedetect-cv.cpp (text/x-c++src), 1.21 KB, created by
dfpl
on 2024-01-26 16:42:52 MSK
(
hide
)
Description:
Пример программы (определение кол-ва лиц в фас на фотографии)
Filename:
MIME Type:
Creator:
dfpl
Created:
2024-01-26 16:42:52 MSK
Size:
1.21 KB
patch
obsolete
>#include <stdlib.h> >#include <stdio.h> >#include <opencv2/opencv.hpp> >#include <opencv2/objdetect.hpp> > >// ÐодÑÑиÑаÑÑ ÐºÐ¾Ð»Ð¸ÑеÑÑво обÑекÑов на ÑаÑÑÑовом изобÑажении >// ÐÑедназнаÑено Ð´Ð»Ñ Ð¿Ð¾Ð´ÑÑÑÑа Ð»Ð¸Ñ "в ÑаÑ", >// но Ð¼Ð¾Ð¶ÐµÑ Ð¸ÑполÑзоваÑÑÑÑ Ð¸ Ð´Ð»Ñ Ð´ÑÑгого клаÑÑа обÑекÑов. >// License: MIT, > >void DumpCount(char *fn, char *fnc) { > > cv::Mat gray; > gray = cv::imread(fn, cv::IMREAD_GRAYSCALE); > int w = gray.cols; > int h = gray.rows; > > cv::CascadeClassifier *cs = new cv::CascadeClassifier(); > std::vector<cv::Rect> objects; > cs->load(fnc); > cs->detectMultiScale( > gray, > objects, > 1.1, > 3, > cv::CASCADE_FIND_BIGGEST_OBJECT, > cv::Size(12,12), // for Haar > cv::Size(w,h) > ); > std::cout << objects.size() << std::endl; >} > >int main (int argc, char **argv) { > if (argc < 2) { > std::cout << "No args" << std::endl; > std::cout << "Usage: facedetect-cv image-file [obj-cascade.xml]" << std::endl; > return 1; > } > char *fn = argv[1]; > char *fnc = (char *)"/usr/share/facedetect-data/haarcascade_frontalface_alt.xml"; > if (argc > 2) fnc = argv[2]; > DumpCount(fn, fnc); > return 0; >}
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Raw
Actions:
View
Attachments on
bug 49199
: 15421 |
15422
|
15423
|
15587
|
15588
|
15603
|
15606
|
15692
|
15767
|
15768
|
15781
|
15782
|
16063
|
16107
|
16108
|
16388
|
16389
|
16390
|
16393
|
16394
|
16479
|
16481
|
16483
|
16502
|
16503
|
16504
|
16505
|
16506
|
16507
|
16515
|
16524
|
16525
|
16534
|
16537
|
16552
|
16553
|
16612