Movatterモバイル変換


[0]ホーム

URL:


CN109446946A - A kind of multi-cam real-time detection method based on multithreading - Google Patents

A kind of multi-cam real-time detection method based on multithreading
Download PDF

Info

Publication number
CN109446946A
CN109446946ACN201811197765.3ACN201811197765ACN109446946ACN 109446946 ACN109446946 ACN 109446946ACN 201811197765 ACN201811197765 ACN 201811197765ACN 109446946 ACN109446946 ACN 109446946A
Authority
CN
China
Prior art keywords
face
pedestrian
network
recognition
yolo3
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Granted
Application number
CN201811197765.3A
Other languages
Chinese (zh)
Other versions
CN109446946B (en
Inventor
赵云波
李灏
林建武
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Zhejiang University of Technology ZJUT
Original Assignee
Zhejiang University of Technology ZJUT
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Zhejiang University of Technology ZJUTfiledCriticalZhejiang University of Technology ZJUT
Priority to CN201811197765.3ApriorityCriticalpatent/CN109446946B/en
Publication of CN109446946ApublicationCriticalpatent/CN109446946A/en
Application grantedgrantedCritical
Publication of CN109446946BpublicationCriticalpatent/CN109446946B/en
Activelegal-statusCriticalCurrent
Anticipated expirationlegal-statusCritical

Links

Classifications

Landscapes

Abstract

Translated fromChinese

基于多线程的多摄像头实时检测方法,首先加载基于ResNet50和三重损失函数的行人重识别网络,构建检测人脸库,采用face_recognition库提取人脸库的特征向量,之后开始构建多线程系统,应用multiprocess库中的Queue构建队列,并采用daemon守护进程,之后通过Yolo3将人物定位并用Opencv裁剪出来,之后使用face_recognition库中的识别模块进行识别,若无人脸则采用行人重识别网络进行识别,最后通过多线程并行处理,可以在监控视频中对多个摄像头中的目标进行实时检测。

The real-time detection method of multi-camera based on multi-threading, firstly load the pedestrian re-recognition network based on ResNet50 and triple loss function, build the detection face library, use the face_recognition library to extract the feature vector of the face library, and then start to build a multi-threaded system and apply multiprocess The Queue in the library builds the queue and uses the daemon daemon process, then uses Yolo3 to locate the characters and use Opencv to cut them out, and then use the recognition module in the face_recognition library for recognition. If there is no face, use the pedestrian re-recognition network for recognition, and finally pass Multi-threaded parallel processing enables real-time detection of targets in multiple cameras in surveillance video.

Description

A kind of multi-cam real-time detection method based on multithreading
Technical field
The present invention relates to the methods being measured in real time to camera shooting video.
Background technique
Since safety-security area is quickly grown, camera function is become stronger day by day, and existing camera generally has communicationAgreement may be implemented wired and wireless long-distance video and read.Simultaneously as the increase in demand of safety, more and more to imageHead is installed in building, and monitoring is played the role of in the places such as street.Thus police etc. can carry out personage's by cameraMonitoring, and handle multiple cameras in real time and improve efficiency.
Recognition of face and pedestrian identify it is the key technology for identifying specific pedestrian again.But due to current effective sideFado uses deep learning neural network, its committed memory is big, while calculation amount is also more, and the scene of real time monitoring is difficultIt is handled.So using multithreading, parallel processing carried out using multiple threads for multiple cameras, it is so can be withGuarantee does not have successive influence for the video of multi-source camera, while can guarantee a higher real-time yet.
Summary of the invention
The present invention will overcome the disadvantages mentioned above of the prior art, provide a kind of multi-cam real-time detection side based on multithreadingMethod.
For real-time purpose to be realized, the present invention devises a kind of multi-cam real-time detection side based on multithreadingMethod can effectively improve the requirement of real-time, the precision that reduction recognition of face and pedestrian identify again.This is for real-time meshMark detection, is a very big promotion in efficiency, utilizable because the quantity of same time-triggered protocol camera increasesInformation is also more with time-varying, and it is accurate that user also can judge to detect whether from more information.
The present invention realizes technical solution used by foregoing invention purpose are as follows:
A kind of multi-cam method of real-time of multithreading, comprising the following steps:
Step 1. load pedestrian identifies network again: using the ResNet50 network of pre-training, will connect entirely in ResNet50Output before layer uses triple loss function tectonic networks as pedestrian's feature, and passes through the training of Market1501 data set.
Step 2. establishes face database, loads recognition of face network: selecting the third party library dlib of Python, and face_Recognition carries out the judgement of recognition of face, and the face picture that will test target is added to local library and carries out feature extraction.
Step 3. reads monitoring camera video: monitoring camera mostly uses greatly wired form to be configured, and usually takesIt is loaded with Rstp agreement, carries out video reading using the VideoCapture function in Opencv.
Step 4. personage cuts step: the Yolo3 weight of pre-download is put under specified directory, Yolo3 network is loaded, it willThe picture read from camera is put into Yolo3, obtains the coordinate of pedestrian, and cut out pedestrian's picture and identify.
Step 5. constructs the step of multithreading frame: the multithreading library multiprocess for selecting Python included, and setsSet the picture that multiple queues are used to store multiple cameras (quantity depends on camera quantity).And by main programProcess.start () function starts multithreading service.And daemon finger daemon is used, guarantee that it, in running background, is moreThread comes with being environmentally isolated before operation, guarantees the operation of parent process.
Step 6. person detecting step: in single subprocess, the knowledge of personage is carried out using the target detection network of Yolo3Not, the picture cut is put into the face detection module of face_recoginition and has detected whether clear face, such asFruit can carry out recognition of face if having face, in the case where no face, if someone in pedestrian library, and progressMatch, if there is being matched to people (Euclidean distance is less than threshold value), then identifies successfully and outline personage to add label, if do not hadThe people being matched to can not then judge;If the nobody of pedestrian library, it can not judge
Compared with prior art, have the advantages of technical solution of the present invention:
(1) present invention makes full use of computer memory space, can handle multiple cameras as far as possible, promotes work effectRate, and reduce cost.
(2) third party library carried using Python itself has transplanting convenient, the advantages of should be readily appreciated that.
Detailed description of the invention
Fig. 1: the flow chart of the method for the present invention;
Fig. 2: multithreading setting procedure figure of the invention;
Fig. 3: face characteristic saves flow chart.
Specific embodiment
Understand for the ease of those of ordinary skill in the art and implement the present invention, with reference to the accompanying drawings and examples to this hairIt is bright to be described in further detail.
A kind of multi-cam real-time detection method based on multithreading contains step:
(1) pedestrian that load was trained identifies network again
Step 11: selecting existing pedestrian to identify network again, have on current some open source websites in Market1501 dataThe accuracy for having reached 94% on collection, is substantially able to satisfy demand.The structure of the network of selection is as described below, ResNet50 conductLast full articulamentum is removed, and handled 3 block once by backbone network, and res5a, res5b do pondization processing,And the feature vector of one 1024 dimension is obtained by exporting the full articulamentum tieed up for 1024 after the splicing of left and right, while doing to res5cPondization processing, is directly launched into the feature vector of 2048 dimensions.The two are superimposed and is used as final feature vector.
Step 12: add triple loss functions, be added hard_triplet loss function, softmax loss function andRing loss function is built into last pedestrian and identifies network again.The data set of oneself can be finely adjusted, be had reached more preferableEffect.
(2) face database is established, and loads human face recognition model
Step 21: each 2-3 positive face photos of taking one's hat off of example storage, wherein photo is preferably without any processing, otherwiseIt will affect precision.It is stored in a file then according to naming rule, if Li Ming reference numeral is 0003, then photo is namedFor the photo sequence that 0003_*.jpg, * are this example face.
Step 22: dlib and face_recognition third party library being installed in the environment, and can be first by face databaseFace picture pass through feature vector save.
(3) camera head monitor picture step is read
Step 31: the reading of camera video is carried out using the VideoCapture class in Opencv.It will be assisted with RTSPThe user name of camera is discussed, password and IP address define respectively, and are filled according to specified format, and each company is taken the photographAs head is all different.
Step 32: the picture in VideoCapture class being read out using read () function in Opencv, is providedWe are handled.
(4) person detecting step
Step 41: the Yolo3 weight of pre-download being put under specified directory, Yolo3 is a kind of mesh that occupied space is lessMark detection neural network, accuracy rate is low compared to Faster-Rcnn, but uses enough.
Step 42: the picture read from camera is put into Yolo3, obtains the coordinate of pedestrian by load Yolo3 network,And it cuts out pedestrian's picture and identifies.
(5) the step of constructing multithreading frame
Step 51: the load Python included library Multiprocess, and multiple queues are set, number and desired readingThe quantity of camera video is identical, and capacity is set as 2.
Step 52: camera picture is read and is pressed into queue by two queue operations of setting, operation of bringing up the rear, dequeue operationPicture is extruded from queue, and is handled.
Step 53: each sub thread identifies the pedestrian loaded before again and Yolo3 network reads and carries out independent pointAnalysis carrys out parallel work-flow with this, promotes processing speed.
(6) person detecting step:
Step 61: after the picture of camera is read by RSTP protocol remote first, in single subprocess, usingThe target detection network of Yolo3 carries out the identification of personage, and is cut personage by the coordinate that Yolo3 is exported.
Step 62: the picture cut being put into the face detection module of face_recoginition and is detected whetherThere is clear face, recognition of face can be carried out if there is face, step 3 is jumped into if without face.Carry out face knowledgeIf capableing of the information (reaching under threshold value) of very determining pedestrian when other, current information is charged in pedestrian library.
Step 63: in the case where no face, be first the case where seeing pedestrian library, if someone in pedestrian library,It is then matched, if there is being matched to people (Euclidean distance be less than threshold value), then identifies successfully and outline personage to add label,If the people being not matched to can not judge.If the nobody of pedestrian library, it can not judge.
Content described in this specification embodiment is only enumerating to the way of realization of inventive concept, protection of the inventionRange should not be construed as being limited to the specific forms stated in the embodiments, and protection scope of the present invention is also and in art technologyPersonnel conceive according to the present invention it is conceivable that equivalent technologies mean.

Claims (1)

Translated fromChinese
1.一种基于多线程的多摄像头实时检测方法,包括以下步骤;1. a multi-thread-based multi-camera real-time detection method, comprising the following steps;(1)加载训练过的行人重识别网络;(1) Load the trained pedestrian re-identification network;选择现有行人重识别网络,将ResNet50网络最后部分的结构转换成3个分别的block,并分别将其的输出转化为最后的3072维的特征;最后添加3重损失函数作为行人重识别网络的步骤;Select the existing person re-identification network, convert the structure of the last part of the ResNet50 network into 3 separate blocks, and convert its output into the final 3072-dimensional feature; finally add three loss functions as the pedestrian re-identification network. step;(2)建立人脸库,并加载人脸识别模型;(2) Establish a face database and load the face recognition model;步骤21,每个实例存放2-3张免冠正脸照片,并以编号+排列序号命名图片,保存在指定目录下的步骤;Step 21, each instance stores 2-3 bareheaded face photos, and names the pictures with the serial number + sequence number, and saves them in the specified directory;步骤22,在指定目录下建立图片名与人名相应的文件;Step 22, establishes the corresponding file of picture name and person's name under the designated directory;(3)读取摄像头监控画面步骤;(3) the step of reading the monitoring screen of the camera;步骤31,使用Opencv中的VideoCapture类进行摄像头视频的读取;Step 31, use the VideoCapture class in Opencv to read the camera video;步骤32,使用Opencv中的read()函数将VideoCapture类中的图片图区出来并加入到队列中;Step 32, use the read() function in Opencv to extract the picture area in the VideoCapture class and add it to the queue;(4)人物裁剪步骤;(4) Character cutting steps;步骤41,将预下载的Yolo3权重放入指定目录下,加载Yolo3网络;Step 41, put the pre-downloaded Yolo3 weights into the specified directory, and load the Yolo3 network;步骤42,将从摄像头读取的图片放入Yolo3中,得到行人的坐标,并裁剪出行人图片进行识别的步骤;Step 42, put the picture read from the camera into Yolo3, get the coordinates of the pedestrian, and crop the pedestrian picture for identification;(5)构建多线程框架的步骤;(5) the steps of constructing a multi-threaded framework;步骤51,加载Python自带的Multiprocess库,设定两个队列操作;Step 51, load the Multiprocess library that comes with Python, and set two queue operations;步骤52,每个子线程将之前加载的行人重识别和Yolo3网络读取并进行独立的分析;Step 52, each sub-thread reads the previously loaded pedestrian re-identification and Yolo3 network and performs independent analysis;(6)人物检测步骤;(6) a person detection step;步骤61,在单个子进程中,使用Yolo3的目标检测网络进行人物的识别,将裁剪下来的图片放入face_recoginition的人脸检测模块中检测是否有清晰人脸;Step 61, in a single sub-process, use the target detection network of Yolo3 to identify the person, and put the cropped picture into the face detection module of face_recoginition to detect whether there is a clear face;步骤62,如果有人脸的话可以进行人脸识别,在没有人脸的情况下,如果行人库中有人的话,则进行匹配,如果有匹配到人(欧式距离小于阈值),则识别成功并将人物框出来加上标签,如果没有匹配到的人,则无法判断;如果行人库没有人的话,则无法判断的。Step 62, if there is a face, face recognition can be performed. In the absence of a face, if there is someone in the pedestrian database, then matching is performed. If there is a matching person (the Euclidean distance is less than the threshold), the recognition is successful and the person is identified. If there is no matching person, it cannot be judged; if there is no one in the pedestrian database, it cannot be judged.
CN201811197765.3A2018-10-152018-10-15Multi-camera real-time detection method based on multithreadingActiveCN109446946B (en)

Priority Applications (1)

Application NumberPriority DateFiling DateTitle
CN201811197765.3ACN109446946B (en)2018-10-152018-10-15Multi-camera real-time detection method based on multithreading

Applications Claiming Priority (1)

Application NumberPriority DateFiling DateTitle
CN201811197765.3ACN109446946B (en)2018-10-152018-10-15Multi-camera real-time detection method based on multithreading

Publications (2)

Publication NumberPublication Date
CN109446946Atrue CN109446946A (en)2019-03-08
CN109446946B CN109446946B (en)2022-03-18

Family

ID=65546376

Family Applications (1)

Application NumberTitlePriority DateFiling Date
CN201811197765.3AActiveCN109446946B (en)2018-10-152018-10-15Multi-camera real-time detection method based on multithreading

Country Status (1)

CountryLink
CN (1)CN109446946B (en)

Cited By (7)

* Cited by examiner, † Cited by third party
Publication numberPriority datePublication dateAssigneeTitle
CN109948490A (en)*2019-03-112019-06-28浙江工业大学 An employee-specific behavior recording method based on pedestrian re-identification
CN110457991A (en)*2019-06-242019-11-15平安科技(深圳)有限公司Picture feature value file optimization method, device, terminal and storage medium
CN111027462A (en)*2019-12-062020-04-17长沙海格北斗信息技术有限公司Pedestrian track identification method across multiple cameras
CN112818917A (en)*2021-02-242021-05-18复旦大学Real-time pedestrian detection and re-identification method and device
CN113095199A (en)*2021-04-062021-07-09复旦大学High-speed pedestrian identification method and device
CN113591809A (en)*2021-09-282021-11-02广州思林杰科技股份有限公司Method and device for determining action track of client in website
CN114495011A (en)*2022-02-152022-05-13辽宁奥普泰通信股份有限公司 Non-motor vehicle and pedestrian illegal intrusion identification method, storage medium and computer equipment based on target detection

Citations (5)

* Cited by examiner, † Cited by third party
Publication numberPriority datePublication dateAssigneeTitle
CN107016341A (en)*2017-03-032017-08-04西安交通大学A kind of embedded real-time face recognition methods
US20180005343A1 (en)*2016-07-012018-01-04Digimarc CorporationImage-based pose determination
CN108038462A (en)*2017-12-222018-05-15深圳英飞拓科技股份有限公司A kind of method and device that Face datection is carried out to real-time video and is identified
CN108564052A (en)*2018-04-242018-09-21南京邮电大学Multi-cam dynamic human face recognition system based on MTCNN and method
CN108596010A (en)*2017-12-312018-09-28厦门大学The implementation method of pedestrian's weight identifying system

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication numberPriority datePublication dateAssigneeTitle
US20180005343A1 (en)*2016-07-012018-01-04Digimarc CorporationImage-based pose determination
CN107016341A (en)*2017-03-032017-08-04西安交通大学A kind of embedded real-time face recognition methods
CN108038462A (en)*2017-12-222018-05-15深圳英飞拓科技股份有限公司A kind of method and device that Face datection is carried out to real-time video and is identified
CN108596010A (en)*2017-12-312018-09-28厦门大学The implementation method of pedestrian's weight identifying system
CN108564052A (en)*2018-04-242018-09-21南京邮电大学Multi-cam dynamic human face recognition system based on MTCNN and method

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
JUN XIANG 等: "Person Re-identification Based on Feature Fusion and Triplet Loss Function", 《2018 24TH INTERNATIONAL CONFERENCE ON PATTERN RECOGNITION (ICPR)》*

Cited By (10)

* Cited by examiner, † Cited by third party
Publication numberPriority datePublication dateAssigneeTitle
CN109948490A (en)*2019-03-112019-06-28浙江工业大学 An employee-specific behavior recording method based on pedestrian re-identification
CN110457991A (en)*2019-06-242019-11-15平安科技(深圳)有限公司Picture feature value file optimization method, device, terminal and storage medium
CN110457991B (en)*2019-06-242024-05-31平安科技(深圳)有限公司Picture characteristic value file optimization method, device, terminal and storage medium
CN111027462A (en)*2019-12-062020-04-17长沙海格北斗信息技术有限公司Pedestrian track identification method across multiple cameras
CN112818917A (en)*2021-02-242021-05-18复旦大学Real-time pedestrian detection and re-identification method and device
CN112818917B (en)*2021-02-242022-03-22复旦大学 A real-time pedestrian detection and re-identification method and device
CN113095199A (en)*2021-04-062021-07-09复旦大学High-speed pedestrian identification method and device
CN113095199B (en)*2021-04-062022-06-14复旦大学 A high-speed pedestrian identification method and device
CN113591809A (en)*2021-09-282021-11-02广州思林杰科技股份有限公司Method and device for determining action track of client in website
CN114495011A (en)*2022-02-152022-05-13辽宁奥普泰通信股份有限公司 Non-motor vehicle and pedestrian illegal intrusion identification method, storage medium and computer equipment based on target detection

Also Published As

Publication numberPublication date
CN109446946B (en)2022-03-18

Similar Documents

PublicationPublication DateTitle
CN109446946A (en)A kind of multi-cam real-time detection method based on multithreading
CN109858371B (en)Face recognition method and device
CN107481327B (en)About the processing method of augmented reality scene, device, terminal device and system
CN108885698B (en)Face recognition method and device and server
US20180268205A1 (en)Picture Ranking Method, and Terminal
CN105590097B (en) Dual-camera collaborative real-time face recognition security system and method under dark vision conditions
CN102880634B (en)Intelligent human-face recognition and retrieval method based on cloud
WO2020078229A1 (en)Target object identification method and apparatus, storage medium and electronic apparatus
CN110609920A (en) Method and system for mixed pedestrian search in video surveillance scene
CN108073948A (en)A kind of photo sort management, server, apparatus and system
CN110493517A (en)The auxiliary shooting method and image capture apparatus of image capture apparatus
CN104331509A (en)Picture managing method and device
CN111028222B (en)Video detection method and device, computer storage medium and related equipment
CN101300588A (en)Determining a particular person from a collection
TWI586160B (en)Real time object scanning using a mobile phone and cloud-based visual search engine
CN112784740A (en)Gait data acquisition and labeling method and application
WO2016145844A1 (en)Picture sorting method and corresponding picture storage and display device
CN105224913A (en)A kind of number of articles detection method and device
CN114821647A (en)Sleeping post identification method, device, equipment and medium
CN112183431A (en)Real-time pedestrian number statistical method and device, camera and server
CN105354252A (en)Information processing method and apparatus
CN113591620A (en)Early warning method, device and system based on integrated mobile acquisition equipment
CN107666573A (en)The method for recording of object video and device, computing device under camera scene
CN113642472B (en) Training method of discriminator model and action recognition method
CN115393755A (en) Visual target tracking method, device, equipment and storage medium

Legal Events

DateCodeTitleDescription
PB01Publication
PB01Publication
SE01Entry into force of request for substantive examination
SE01Entry into force of request for substantive examination
GR01Patent grant
GR01Patent grant

[8]ページ先頭

©2009-2025 Movatter.jp