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
CN109446946A CN201811197765.3A CN201811197765A CN109446946A CN 109446946 A CN109446946 A CN 109446946A CN 201811197765 A CN201811197765 A CN 201811197765A CN 109446946 A CN109446946 A CN 109446946A
Authority
CN
China
Prior art keywords
face
pedestrian
network
picture
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 ZJUT filed Critical Zhejiang University of Technology ZJUT
Priority to CN201811197765.3A priority Critical patent/CN109446946B/en
Publication of CN109446946A publication Critical patent/CN109446946A/en
Application granted granted Critical
Publication of CN109446946B publication Critical patent/CN109446946B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V40/00Recognition of biometric, human-related or animal-related patterns in image or video data
    • G06V40/10Human or animal bodies, e.g. vehicle occupants or pedestrians; Body parts, e.g. hands
    • G06V40/16Human faces, e.g. facial parts, sketches or expressions
    • G06V40/172Classification, e.g. identification
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F18/00Pattern recognition
    • G06F18/20Analysing
    • G06F18/24Classification techniques
    • G06F18/241Classification techniques relating to the classification model, e.g. parametric or non-parametric approaches
    • G06F18/2413Classification techniques relating to the classification model, e.g. parametric or non-parametric approaches based on distances to training or reference patterns
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V40/00Recognition of biometric, human-related or animal-related patterns in image or video data
    • G06V40/10Human or animal bodies, e.g. vehicle occupants or pedestrians; Body parts, e.g. hands
    • G06V40/103Static body considered as a whole, e.g. static pedestrian or occupant recognition

Abstract

Multi-cam real-time detection method based on multithreading, pedestrian of the load based on ResNet50 and triple loss functions identifies network again first, building detection face database, the feature vector of face database is extracted using the library face_recognition, start to construct multi-threaded system later, queue is constructed using the Queue in the library multiprocess, and use daemon finger daemon, later by Yolo3 by personage position and with Opencv cut out come, it is identified later using the identification module in the library face_recognition, pedestrian is used to identify that network identifies again if no face, finally by multi-threading parallel process, the target in multiple cameras can be measured in real time in monitor 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 communication Agreement may be implemented wired and wireless long-distance video and read.Simultaneously as the increase in demand of safety, more and more to image Head 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 camera Monitoring, 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 side Fado uses deep learning neural network, its committed memory is big, while calculation amount is also more, and the scene of real time monitoring is difficult It is handled.So using multithreading, parallel processing carried out using multiple threads for multiple cameras, it is so can be with Guarantee 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 multithreading Method.
For real-time purpose to be realized, the present invention devises a kind of multi-cam real-time detection side based on multithreading Method can effectively improve the requirement of real-time, the precision that reduction recognition of face and pedestrian identify again.This is for real-time mesh Mark detection, is a very big promotion in efficiency, utilizable because the quantity of same time-triggered protocol camera increases Information 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 ResNet50 Output 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 takes It 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 will The 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 sets Set the picture that multiple queues are used to store multiple cameras (quantity depends on camera quantity).And by main program Process.start () function starts multithreading service.And daemon finger daemon is used, guarantee that it, in running background, is more Thread 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 Yolo3 Not, the picture cut is put into the face detection module of face_recoginition and has detected whether clear face, such as Fruit can carry out recognition of face if having face, in the case where no face, if someone in pedestrian library, and progress Match, 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 had The 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 effect Rate, 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 hair It 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 data The 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 conduct Last 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 res5c Pondization 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 and Ring loss function is built into last pedestrian and identifies network again.The data set of oneself can be finely adjusted, be had reached more preferable Effect.
(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, otherwise It will affect precision.It is stored in a file then according to naming rule, if Li Ming reference numeral is 0003, then photo is named For 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 database Face 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 RTSP The 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 photograph As head is all different.
Step 32: the picture in VideoCapture class being read out using read () function in Opencv, is provided We 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 less Mark 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 reading The 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 operation Picture 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 point Analysis 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, using The 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 whether There 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 knowledge If 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 invention Range 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 technology Personnel conceive according to the present invention it is conceivable that equivalent technologies mean.

Claims (1)

1. a kind of multi-cam real-time detection method based on multithreading, includes the following steps;
(1) pedestrian that load was trained identifies network again;
It selects existing pedestrian to identify network again, the back-page structure of ResNet50 network is converted into the block of 3 difference, And respectively convert its output to the feature of 3072 last dimensions;3 weight loss function of finally addition identifies net as pedestrian again The step of network;
(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, and picture is named with number+arrangement serial number, it is stored in specified Step under catalogue;
Step 22, picture name file corresponding with name is established under specified directory;
(3) camera head monitor picture step is read;
Step 31, the reading of camera video is carried out using the VideoCapture class in Opencv;
Step 32, the picture figure area in VideoCapture class is come out using read () function in Opencv and is added to team In column;
(4) personage cuts step;
Step 41, the Yolo3 weight of pre-download is put under specified directory, loads Yolo3 network;
Step 42, the picture read from camera is put into Yolo3, obtains the coordinate of pedestrian, and cut out pedestrian's picture into The step of row identification;
(5) the step of constructing multithreading frame;
Step 51, the load Python included library Multiprocess, sets two queue operations;
Step 52, each sub thread identifies the pedestrian loaded before again and Yolo3 network reads and carries out independent analysis;
(6) person detecting step;
Step 61, in single subprocess, the identification of personage is carried out using the target detection network of Yolo3, by what is cut Picture, which is put into the face detection module of face_recoginition, has detected whether clear face;
Step 62, recognition of face can be carried out if there is face, in the case where no face, if someone in pedestrian library If, then it is matched, if there is being matched to people (Euclidean distance is less than threshold value), then identifies successfully and outline personage to add Label can not judge if the people being not matched to;If the nobody of pedestrian library, it can not judge.
CN201811197765.3A 2018-10-15 2018-10-15 Multi-camera real-time detection method based on multithreading Active CN109446946B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201811197765.3A CN109446946B (en) 2018-10-15 2018-10-15 Multi-camera real-time detection method based on multithreading

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201811197765.3A CN109446946B (en) 2018-10-15 2018-10-15 Multi-camera real-time detection method based on multithreading

Publications (2)

Publication Number Publication Date
CN109446946A true CN109446946A (en) 2019-03-08
CN109446946B CN109446946B (en) 2022-03-18

Family

ID=65546376

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201811197765.3A Active CN109446946B (en) 2018-10-15 2018-10-15 Multi-camera real-time detection method based on multithreading

Country Status (1)

Country Link
CN (1) CN109446946B (en)

Cited By (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109948490A (en) * 2019-03-11 2019-06-28 浙江工业大学 A kind of employee's specific behavior recording method identified again based on pedestrian
CN110457991A (en) * 2019-06-24 2019-11-15 平安科技(深圳)有限公司 Picture feature value file optimization method, device, terminal and storage medium
CN111027462A (en) * 2019-12-06 2020-04-17 长沙海格北斗信息技术有限公司 Pedestrian track identification method across multiple cameras
CN112818917A (en) * 2021-02-24 2021-05-18 复旦大学 Real-time pedestrian detection and re-identification method and device
CN113095199A (en) * 2021-04-06 2021-07-09 复旦大学 High-speed pedestrian identification method and device
CN113591809A (en) * 2021-09-28 2021-11-02 广州思林杰科技股份有限公司 Method and device for determining action track of client in website

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107016341A (en) * 2017-03-03 2017-08-04 西安交通大学 A kind of embedded real-time face recognition methods
US20180005343A1 (en) * 2016-07-01 2018-01-04 Digimarc Corporation Image-based pose determination
CN108038462A (en) * 2017-12-22 2018-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-24 2018-09-21 南京邮电大学 Multi-cam dynamic human face recognition system based on MTCNN and method
CN108596010A (en) * 2017-12-31 2018-09-28 厦门大学 The implementation method of pedestrian's weight identifying system

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20180005343A1 (en) * 2016-07-01 2018-01-04 Digimarc Corporation Image-based pose determination
CN107016341A (en) * 2017-03-03 2017-08-04 西安交通大学 A kind of embedded real-time face recognition methods
CN108038462A (en) * 2017-12-22 2018-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-31 2018-09-28 厦门大学 The implementation method of pedestrian's weight identifying system
CN108564052A (en) * 2018-04-24 2018-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 (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109948490A (en) * 2019-03-11 2019-06-28 浙江工业大学 A kind of employee's specific behavior recording method identified again based on pedestrian
CN110457991A (en) * 2019-06-24 2019-11-15 平安科技(深圳)有限公司 Picture feature value file optimization method, device, terminal and storage medium
CN111027462A (en) * 2019-12-06 2020-04-17 长沙海格北斗信息技术有限公司 Pedestrian track identification method across multiple cameras
CN112818917A (en) * 2021-02-24 2021-05-18 复旦大学 Real-time pedestrian detection and re-identification method and device
CN112818917B (en) * 2021-02-24 2022-03-22 复旦大学 Real-time pedestrian detection and re-identification method and device
CN113095199A (en) * 2021-04-06 2021-07-09 复旦大学 High-speed pedestrian identification method and device
CN113095199B (en) * 2021-04-06 2022-06-14 复旦大学 High-speed pedestrian identification method and device
CN113591809A (en) * 2021-09-28 2021-11-02 广州思林杰科技股份有限公司 Method and device for determining action track of client in website

Also Published As

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

Similar Documents

Publication Publication Date Title
CN109446946A (en) A kind of multi-cam real-time detection method based on multithreading
US20230063920A1 (en) Content navigation with automated curation
US10242250B2 (en) Picture ranking method, and terminal
CN107481327B (en) About the processing method of augmented reality scene, device, terminal device and system
CN103207870B (en) Photo classification management method, server, device and system
CN104331509A (en) Picture managing method and device
US20150055879A1 (en) Method, Server and System for Setting Background Image
CN102880634B (en) Intelligent human-face recognition and retrieval method based on cloud
CN108256439A (en) A kind of pedestrian image generation method and system based on cycle production confrontation network
CN103617432A (en) Method and device for recognizing scenes
CN113365147B (en) Video editing method, device, equipment and storage medium based on music card point
CN110163041A (en) Video pedestrian recognition methods, device and storage medium again
CN101300588A (en) Determining a particular person from a collection
WO2016145844A1 (en) Picture sorting method and corresponding picture storage and display device
CN110765134A (en) File establishing method, equipment and storage medium
CN109670517A (en) Object detection method, device, electronic equipment and target detection model
CN105224913A (en) A kind of number of articles detection method and device
CN103428537A (en) Video processing method and video processing device
CN103501410B (en) The based reminding method of shooting, the generation method of device and detection pattern, device
CN106250396B (en) Automatic image label generation system and method
CN105631404A (en) Method and device for clustering pictures
CN110324589A (en) A kind of monitoring system and method for tourist attraction
CN105787131A (en) Information processing method and device and mobile terminal
Presa-Reyes et al. Deep learning with weak supervision for disaster scene description in low-altitude imagery
CN112101387A (en) Salient element identification method and device

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant