CN109886074A - A kind of elevator passenger number parallel detecting method based on video flow processing - Google Patents
A kind of elevator passenger number parallel detecting method based on video flow processing Download PDFInfo
- Publication number
- CN109886074A CN109886074A CN201811608009.5A CN201811608009A CN109886074A CN 109886074 A CN109886074 A CN 109886074A CN 201811608009 A CN201811608009 A CN 201811608009A CN 109886074 A CN109886074 A CN 109886074A
- Authority
- CN
- China
- Prior art keywords
- data
- elevator
- video
- detection
- frame
- 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
Links
Landscapes
- Indicating And Signalling Devices For Elevators (AREA)
Abstract
A kind of elevator passenger number parallel detecting method based on video flow processing.Firstly, carrying out positive negative sample calibration using acquisition video data, and the classifier file of elevator passenger is obtained using cascade classifier training sample;Secondly, reading and converting elevator video stream data, pretreatment is carried out to video and is converted into elasticity distribution formula data set RDD;Then, the elevator passenger number detection algorithm based on Spark Streaming is executed, after input video flow data, output has the video requency frame data of elevator passenger number;Finally, elevator passenger number detection stream Processing Algorithm is deployed on Spark distributed type assemblies, the node to match with algorithm steps number is set, handles video automatically obtaining quickly controllable real-time streaming data from the background.The present invention analyzes elevator video data using stream process technology, the ridership of real-time detection elevator, carries out parallelization to elevator passenger number detection algorithm using Spark Streaming stream process frame, improves the real-time of elevator video ridership detection.
Description
Technical field
The invention patent relates to the fields such as video big data, machine learning, parallel computation, especially give one kind and are based on
The elevator passenger number real-time detection method of video flow processing.
Background technique
Elevator is the essential vehicles in people's work and life, however, quickling increase with elevator quantity
And the gradually quickening of people's rhythm of life, lift running safety are increasingly becoming the social hot spot an of public attention.Sufficiently
The Various types of data generated using elevator has become academia and industry in conjunction with the safety that artificial intelligence technology improves elevator
An important topic.Elevator monitoring video data is a kind of important data source, has contained the operation shape of elevator at every moment
State provides data abundant for analysis state of elevator.
In terms of video data processing, Zheng Jian etc. (computer system application, 2017) proposes a kind of real-time video analysis
System can improve video efficiency by way of kafka dispatch messages queue and by stream process;(the computers such as Li Haiyue
Application study, 2017) it proposes a kind of be converted into after pictures video to cut frame and put to the method for distributed system, accelerate
To the processing speed of video;Flood equal (computer measurement and control, 2017) proposes a kind of by video frame method and distributed
The method that frame combines, to Quick Test Vehicle flow;Ye Feng etc. (computer system application, 2017) propose it is a kind of by Hog with
Spark big data frame combines, and is aided with RFID the method for realizing vehicle count.
In terms of for parallel video processing frame, also has multidigit scholar and carried out correlative study.Hanlin Tan etc.
(ICME, 2014), which is proposed, a kind of to be put video record to making multinode detection on Hadoop Distributed Architecture to promote operation effect
The method of rate;Xiaomen Zhao etc. (8th International Conference on Cloud Computing, 2015)
It compares the efficiency of each picture detective operators on Hadoop Distributed Architecture in detail and incorporates a kind of frame of synthesis;
Vaithilingam etc. (International Conference on Big Data, 2015) is to video flowing usage time interval
Mode is cut and is put to being handled on hadoop frame.
Spark parallel processing frame is a kind of parallel processing frame calculated based on memory, devises unified abstract volume
Journey, i.e. elasticity distribution formula data set (RDD), this completely new model can allow user to directly control the shared of data, so that being
System has stronger fault-tolerance and faster computing capability, this is most important for video processing.
Summary of the invention
For examinations elevator passenger number, the present invention proposes that a kind of elevator passenger number based on video flow processing is parallel
Detection method, the invention is to the ridership detection algorithm based on machine learning in Spark Streaming parallel computation frame
Parallelization has been carried out, the real-time of elevator passenger number detection is improved.
A kind of elevator passenger number parallel detecting method based on video flow processing, comprising the following steps:
(1) the elevator passenger number based on machine learning detects classifier;
(1.1) elevator passenger data scaling;
Data scaling is carried out according to video data, sample is divided into positive and negative data set, positive sample collection is detection target, negative sample
This collection is elevator environment, and interception passenger's head-and-shoulder area is free of the elevator interior environment conduct of passenger as training positive sample, interception
Training negative sample, positive and negative sample proportion approximately 1:2, when interception by the way of manually demarcating, calibration tool is that video is cut
Take tool;
(1.2) training classifier;
It is trained using the Haar characteristic point of image, using cascade classifier CascadeClassifier training sample,
Positive and negative sample set and description file are got out, the classifier file of xml format is obtained after the completion of training;
(2) the elevator passenger number detection based on Spark Streaming;
The present invention is handled elevator passenger number detection algorithm parallelization using Spark Streaming stream process frame, is mentioned
The real-time of high patronage detection:
(2.1) it reads and converts elevator video data;
According to elevator video camera IP address, elevator monitoring data are read, the real-time RTSP data received parsing is become
Image data, and caching format bufferedImage is saved as, then bufferedImage is converted into byte arrays;
(2.2) video elasticity distribution formula data set RDD is created;
Enter ArrayList for byte arrays as list element addition, using in Spark Streaming
Above-mentioned list is divided into RDD by parallelize method, the object as Spark Streaming processing;
(2.3) the elevator passenger number detection algorithm based on Spark Streaming;
Video elasticity distribution formula data set RDD is combined into video stream data with queue Queue formal layout
DStreams, the input as elevator passenger number detection stream Processing Algorithm, the specific steps are as follows:
Input: video stream data
Output: the ridership of each frame in video
Step:
Step1: calling mapToPair operator with numbering of elevator for Key value, and elevator flow data is Value value, generates
PairDStream flow data key-value pair;
Step2: mapValues operator is called, for the video requency frame data in manipulation of data stream;
Step3: the interim picture variable i mage of creation one stores every frame data and is stored in byte arrays, creates with Rect
For the list of unit, to record the position and the number that detect passenger in every frame data;
Step4: extracting the pixel value of image data image, carries out gray processing to pixel color, image is switched to grayscale image
To promote detection efficiency;
Step5: extracting image data image and Gamma conversion is carried out to it, reduces influence of the illumination variation to it;
Step6: the detection method of the resulting xml number of people classifier cooperation machine learning of training before calling
DetectMultiScale detects passenger's target in image at this time;
Step7: will test resulting passenger position and be put into Rect list, Rect list length be extracted, as detecting
Number;
Step8: being mapped that in picture image using putText method, the image data as frame every after processing;
Step9: the conveter converter of JavaCV is called, org.opencv.core.Mat picture format is converted to
Org.bytedeco.javacpp.opencv_core.Mat picture format calls opencv relational operator after convenient;
Step10: the use of convert operator transformed picture is frame data frame, uses FFmpeg kit
Recorder operator is by frame data frame write-in designated position composition treated new video;
Step11: data are written in the key-value pair data stream generated after the record detection of backstage, the data as elevator passenger
Library;
(3) elevator passenger number detection algorithm is disposed on Spark cluster;
Elevator passenger number detection stream Processing Algorithm is deployed on Spark distributed type assemblies, is set and algorithm steps number
The node to match can handle video automatically obtaining quickly controllable real-time streaming data from the background.
Advantages of the present invention:
The present invention analyzes elevator video data using stream process technology, the ridership of real-time detection elevator, uses
Spark Streaming stream process frame carries out parallelization to elevator passenger number detection algorithm, improves elevator video ridership
The real-time of detection.
Detailed description of the invention
Fig. 1 is data prediction flow chart of the invention.
Fig. 2 is RDD data structure diagram of the invention.
Fig. 3 is the elevator passenger number overhaul flow chart of the invention based on Spark Streaming.
Fig. 4 is the schematic diagram that the present invention collects elevator data sample on the spot.
Fig. 5 is the detection that the present invention carries out the head and shoulder position of people position and quantity, and the testing result of return is mapped
Schematic diagram on every frame image data.
Specific embodiment
Specific real-time mode in order to further illustrate the present invention, by taking the monitor video of certain elevator as an example, in conjunction with attached drawing
A specific embodiment of the invention is described further, wherein overall framework is as shown in Figure 3.
A kind of elevator passenger number parallel detecting method based on video flow processing, the specific steps are as follows:
(1) elevator passenger based on machine learning detects classifier;
Use the target object in machine learning detection video, i.e. number of people position, it is necessary first to collect elevator data on the spot
Sample, the artificial head and shoulder position for demarcating passenger include shoulder part as far as possible, and intercept a large amount of empty elevator environment as the negative sample of training
This, positive and negative sample number ratio is instructed after separating positive and negative data set using the haar that opencv is carried in 1:2 or so, such as Fig. 4
Practice the xml format that can be obtained after the completion of component cooperation cascade classifier CascadeClassifier is trained for elevator environment
Classifier file;
(2) the elevator passenger number detection based on Spark Streaming;
The real-time processing of elevator video stream data is based on Spark Streaming flow data frame, can be to elevator monitoring
Data carry out real-time, quick target identification, and steps are as follows:
(2.1) it reads and converts elevator video data;
Processing end and video camera IP address are connected, this example uses Haikang prestige to regard fluorite C6C camera, will receive
The parsing of real-time RTSP data become image data and save as image cache format bufferedImage, and receiving caching
Video data is returned to byte array form simultaneously to save, the real-time prison of elevator has been preserved in real-time caching at this time
Control data;Process is as shown in Figure 1;
(2.2) elasticity distribution formula data set RDD is established
Enter ArrayList for byte arrays as list element addition, using in Spark Streaming
Above-mentioned list is divided into RDD by parallelize method, the object as Spark Streaming processing;
(2.3) the elevator passenger number detection algorithm based on Spark Streaming;
RDD is with queue Queue formal layout, then is combined into video stream data DStreams, according to algorithm flow, root
Distributed arithmetic is carried out after generating different key assignments stream data PairDStream according to various teaching building numbering of elevator;At this time
Flow data format is as shown in Fig. 2, K indicates that numbering of elevator, V indicate current monitoring video flow in the school;
After the generation of key assignments stream data, using the key value in mapValues operator manipulation of data stream, i.e., in each subregion
Video requency frame data;
Firstly, since haar characteristic point is the image detection for grey scale change, the pixel value of video requency frame data will be operated
Make its gray processing, reduces influence of the color to it;
Then influence of the illumination variation to elevator environment is reduced using gamma correction, is instructed before use after processing is completed
Practice the detection that the xml picture classification device cooperation CascadeClassifier cascade classifier completed carries out number to every frame video;
It is then the detection for carrying out position and quantity for the head and shoulder position of people in this example, the testing result of return is mapped
On every frame image data, then using the data of processing completion as video by saving to designated position, and handle the entire of completion
Key-value pair data stream is then responsible for record by backstage.It is as shown in Figure 5:
(3) elevator passenger number detection algorithm is disposed on Spark cluster;
Whole system is put to Spark distributed type assemblies, the node to match with number of steps is set, so that video is examined
It surveys step and obtains distributed treatment by way of partition by fine granularities, every elevator can be further according to elevator number if having multi-section elevator
Subregion is carried out, to automatically derive quickly controllable real-time streaming data processing result.In this example, after tested when there is 2 sections
When point operation, video distribution formula detection efficiency is apparently higher than common stream process efficiency.The following are detection efficiencies when experiment to compare:
The transmitting of this experiment interior joint is about 11ms, and gray processing and image flame detection are about 14ms, and number detection is about 34ms;It is general
Gray processing and correction are about 21ms in logical experiment, and number detection is about 66ms.It is significantly mentioned it can be seen that the efficiency of detection has
It rises, binodal point efficiency is about 1.47 times of single node, and can automatically derive from the background the electricity with ridership after processing is completed
Terraced video data.
The present invention analyzes elevator video data using stream process technology, the ridership of real-time detection elevator, uses
Spark Streaming stream process frame carries out parallelization to elevator passenger number detection algorithm, improves elevator video ridership
The speed of detection.
It should be appreciated that specific embodiment described herein is used only for explaining the present invention, it is not intended to limit the present invention.
Claims (1)
1. a kind of elevator passenger number parallel detecting method based on video flow processing, comprising the following steps:
(1) the elevator passenger number based on machine learning detects classifier;
(1.1) elevator passenger data scaling;
Data scaling is carried out according to video data, sample is divided into positive and negative data set, positive sample collection is detection target, negative sample collection
For elevator environment, passenger's head-and-shoulder area is intercepted as training positive sample, it is negative that elevator interior environment of the interception without passenger makees training
Sample, when interception by the way of manually demarcating, calibration tool is video intercepting tool;
(1.2) training classifier;
It is trained using the Haar characteristic point of image, using cascade classifier CascadeClassifier training sample, is prepared
Good positive and negative sample set and description file, obtain the classifier file of xml format after the completion of training;
(2) the elevator passenger number detection based on Spark Streaming;
(2.1) it reads and converts elevator video data;
According to elevator video camera IP address, elevator monitoring data are read, the real-time RTSP data received parsing is become into picture
Data, and caching format bufferedImage is saved as, then bufferedImage is converted into byte arrays;
(2.2) video elasticity distribution formula data set RDD is created;
Enter ArrayList for byte arrays as list element addition, using in Spark Streaming
Above-mentioned list is divided into RDD by parallelize method, the object as Spark Streaming processing;
(2.3) the elevator passenger number detection algorithm based on Spark Streaming;
Video elasticity distribution formula data set RDD is combined into video stream data DStreams with queue Queue formal layout,
Input as elevator passenger number detection stream Processing Algorithm, the specific steps are as follows:
Input: video stream data
Output: the ridership of each frame in video
Step:
Step1: calling mapToPair operator with numbering of elevator for Key value, and elevator flow data is Value value, generates
PairDStream flow data key-value pair;
Step2: mapValues operator is called, for the video requency frame data in manipulation of data stream;
Step3: the interim picture variable i mage of creation one stores every frame data and is stored in byte arrays, and creation is single with Rect
The list of position, to record the position and the number that detect passenger in every frame data;
Step4: extracting the pixel value of image data image, carries out gray processing to pixel color, image is switched to grayscale image to mention
Rise detection efficiency;
Step5: extracting image data image and Gamma conversion is carried out to it, reduces influence of the illumination variation to it;
Step6: the detection method of the resulting xml number of people classifier cooperation machine learning of training before calling
DetectMultiScale detects passenger's target in image at this time;
Step7: will test resulting passenger position and be put into Rect list, Rect list length be extracted, as the people detected
Number;
Step8: being mapped that in picture image using putText method, the image data as frame every after processing;
Step9: the conveter converter of JavaCV is called, org.opencv.core.Mat picture format is converted to
Org.bytedeco.javacpp.opencv_core.Mat picture format calls opencv relational operator after convenient;
Step10: being frame data frame using convert operator transformed picture, is calculated using the recorder of FFmpeg kit
Son is by frame data frame write-in designated position composition treated new video;
Step11: database is written in the key-value pair data stream generated after the record detection of backstage, the data as elevator passenger;
(3) elevator passenger number detection algorithm is disposed on Spark cluster;
Elevator passenger number detection stream Processing Algorithm is deployed on Spark distributed type assemblies, is set and algorithm steps number phase
The node matched can handle video automatically obtaining quickly controllable real-time streaming data from the background.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201811608009.5A CN109886074B (en) | 2018-12-27 | 2018-12-27 | Elevator passenger number parallel detection method based on video stream processing |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201811608009.5A CN109886074B (en) | 2018-12-27 | 2018-12-27 | Elevator passenger number parallel detection method based on video stream processing |
Publications (2)
Publication Number | Publication Date |
---|---|
CN109886074A true CN109886074A (en) | 2019-06-14 |
CN109886074B CN109886074B (en) | 2020-11-13 |
Family
ID=66925286
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201811608009.5A Active CN109886074B (en) | 2018-12-27 | 2018-12-27 | Elevator passenger number parallel detection method based on video stream processing |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN109886074B (en) |
Cited By (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN111908288A (en) * | 2020-07-30 | 2020-11-10 | 上海繁易信息科技股份有限公司 | TensorFlow-based elevator safety system and method |
CN115334332A (en) * | 2022-06-28 | 2022-11-11 | 苏州体素信息科技有限公司 | Video stream processing method and system |
US20230153267A1 (en) * | 2021-11-18 | 2023-05-18 | Nanhu Laboratory | High-performance data lake system and data storage method |
Citations (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN106897664A (en) * | 2017-01-08 | 2017-06-27 | 广东工业大学 | A kind of pedestrian detection method based on distributed big data platform |
CN108229258A (en) * | 2016-12-21 | 2018-06-29 | 田文洪 | A kind of face parallelism recognition method based on deep learning and Spark |
-
2018
- 2018-12-27 CN CN201811608009.5A patent/CN109886074B/en active Active
Patent Citations (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN108229258A (en) * | 2016-12-21 | 2018-06-29 | 田文洪 | A kind of face parallelism recognition method based on deep learning and Spark |
CN106897664A (en) * | 2017-01-08 | 2017-06-27 | 广东工业大学 | A kind of pedestrian detection method based on distributed big data platform |
Cited By (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN111908288A (en) * | 2020-07-30 | 2020-11-10 | 上海繁易信息科技股份有限公司 | TensorFlow-based elevator safety system and method |
US20230153267A1 (en) * | 2021-11-18 | 2023-05-18 | Nanhu Laboratory | High-performance data lake system and data storage method |
US11789899B2 (en) * | 2021-11-18 | 2023-10-17 | Nanhu Laboratory | High-performance data lake system and data storage method |
CN115334332A (en) * | 2022-06-28 | 2022-11-11 | 苏州体素信息科技有限公司 | Video stream processing method and system |
Also Published As
Publication number | Publication date |
---|---|
CN109886074B (en) | 2020-11-13 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN104573640B (en) | Data processing system and its generating device, type of face detection method | |
CN109886074A (en) | A kind of elevator passenger number parallel detecting method based on video flow processing | |
CN112183166B (en) | Method and device for determining training samples and electronic equipment | |
CN106940790B (en) | People flow congestion prediction method and system | |
CN110516529A (en) | It is a kind of that detection method and system are fed based on deep learning image procossing | |
KR102503116B1 (en) | Automatic Data Set Generation Device and their Control Method for AI Machine Learning Learning | |
CN110633610A (en) | Student state detection algorithm based on YOLO | |
CN109961003A (en) | A kind of airborne auxiliary inspection device of embedded transmission line of electricity based on FPGA | |
CN103020590B (en) | A kind of vehicle identification system based on three-dimensional model and images match and method thereof | |
CN109241030A (en) | Robot work data analysis server and robot work data analysis method | |
CN112257799A (en) | Method, system and device for detecting household garbage target | |
CN113037783B (en) | Abnormal behavior detection method and system | |
CN111723656B (en) | Smog detection method and device based on YOLO v3 and self-optimization | |
CN114842185A (en) | Method, device, equipment and medium for identifying fire | |
CN112613438A (en) | Portable online citrus yield measuring instrument | |
CN116630766A (en) | Multi-source information data processing system, method and equipment | |
CN115131747A (en) | Knowledge distillation-based power transmission channel engineering vehicle target detection method and system | |
CN113284144A (en) | Tunnel detection method and device based on unmanned aerial vehicle | |
CN115272252A (en) | Improved YOLOX-based carbon fiber defect detection method, device and system | |
CN116823793A (en) | Device defect detection method, device, electronic device and readable storage medium | |
Li et al. | Object detection for uav images based on improved yolov6 | |
CN105912997B (en) | Face recognition method and system | |
CN113139452A (en) | Method for detecting behavior of using mobile phone based on target detection | |
CN112529836A (en) | High-voltage line defect detection method and device, storage medium and electronic equipment | |
CN112132088A (en) | Inspection point location missing inspection identification method |
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 |