In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-19 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >
Share
Shulou(Shulou.com)06/01 Report--
This article introduces the relevant knowledge of "how to realize face recognition embedded in Qt". In the operation of actual cases, many people will encounter such a dilemma, so let the editor lead you to learn how to deal with these situations. I hope you can read it carefully and be able to achieve something!
I. Preface
About a few years ago, I made a set of face recognition program on embedded linux. Of course, the core algorithm of face recognition is not developed by myself. On the part of face recognition algorithm, although there are many open source libraries that can be used, and even opencv can be used to train algorithms for deep learning and so on, I think that it can never meet the requirements of accuracy, especially the accuracy of face comparison, which requires a professional face training model. At present, most of the face recognition libraries on the market provide X86 or Android ios libraries, but there is no embedded linux library. It is estimated that on the one hand, because the board performance of embedded linux is relatively low, and another is dependent on specific compilers, many versions are difficult to provide, and the market is small, so most manufacturers do not provide embedded linux development kits. So many terminal manufacturers eventually abandon linux and choose Android as the carrier system, so that they can use high-end face recognition libraries, such as firefly development board, RK3288 RK3399 and so on.
I remember that at that time, we specially developed a set of very detailed communication protocols, and the products were also initially formed, and the approximate equipment included face recognition terminals, binocular access control, artificial visitors, self-service visitors, face comparison servers, etc., and also tried out some residential areas, and the results were good, but the effect was not very good in the case of anti-backlight and night. Of course, this is a common problem of all face recognition devices. Must rely on supplementary light or adjust the installation position to increase the anti-reflective camera to deal with, so that the construction requirements have increased complexity, equipment costs have also gone up, for small terminal manufacturers, this has to choose a balance point, only users are willing to pay the corresponding cost to provide the corresponding version.
Communication mode and port:
Devices such as client and server provide web access to modify the configuration, port 6660.
The communication between the client of the manual visitor and the server of the manual visitor adopts TCP short connection and the communication port is 6661.
The communication between the client of the self-service guest plane and the server of the self-service guest plane adopts TCP long-term connection and the communication port is 6661.
The database server of face recognition comparison adopts TCP long connection and communication port 6662.
The server communicates with the database server using TCP long-term connection and communication port 6666.
The face pass data issued by the database server adopts TCP short connection and communication port 6667.
The computer PC terminal sends the configuration to the binocular access control uses the TCP short connection, the communication port 6668.
The communication between binocular access control and database server adopts TCP long connection and communication port 6669.
Binocular access control computer client upgrade communication uses TCP short connection, communication port 6670.
Test and mobile phone app or other client communication using TCP long-term connection, communication port 6671.
II. Functional features
The supported functions include face recognition, face comparison, face search, live detection and so on.
The online version also supports ID card, driver's license, driving license, bank card and other identification.
The online version of the protocol supports Baidu, absenteeism, and the offline version supports Baidu, which can be customized.
In addition to supporting X86 architecture, it also supports embedded linux such as contex-A9, raspberry pie and so on.
The execution of each function returns not only the result but also the execution time.
Multithreading, which controls the current processing type through type.
Support a single image to retrieve the most similar images.
Support to specify directory images to generate facial feature value files.
You can set the number of pictures waiting to be processed in the queue.
A success or failure signal is returned for each execution.
The return results of face search include the original image + maximum similarity map + similarity and so on.
Face comparison supports two pictures and two eigenvalues at the same time.
Related functions customize a set of protocols for client and server, which can interact through TCP communication.
The custom face recognition protocol is very suitable for the scene where several devices are requested by a server in the center.
Each module is a separate class with neat code and perfect comments.
Third, effect picture
4. The core code void FaceLocalArm::imgToBgr (const QImage & img, quint8 * bgr, int w, int h) {for (int I = 0; I < h; + + I) {const quint8 * scanline = img.scanLine (I); for (int j = 0; j < w; + j) {* bgr++ = scanline [j * 3 + 0]; * bgr++ = scanline [j * 3 + 1] * bgr++ = scanline [j * 3 + 2];} void FaceLocalArm::bgrToYuv (quint8 * yuv, const quint8 * bgr, int w, int h) {int b, g, r; for (int I = 0; I < w * h; + I) {b = bgr [3 * I + 0]; g = bgr [3 * I + 1]; r = bgr [3 * I + 2] Yuv [I] = (quint8) ((r * 30 + g * 59 + b * 11 + 50) / 100);}} void FaceLocalArm::init () {/ / if it is normal, there is no need to initialize if (isOk) {return;} # ifdef _ arm__ int res = CRface::FaceDetect_Init_ColorReco (sdkPath.toStdString ()); if (res! = 1) {qDebug ()
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.