Alarm method and device, electronic equipment and readable storage medium
By analyzing the target image data in the face capture and control system, and acquiring and comparing continuous image frames with higher quality scores, the problem of low efficiency in real-time recognition of faces is solved, and more efficient and accurate alarm deployment is achieved.
Patent Information
- Application Number
- CN202411535948.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-10-30
- Publication Date
- 2025-03-18
AI Technical Summary
The existing face capture layout control system is inefficient in processing and analyzing face images in real time, especially in scenes with dense crowds and complex environments, and it is difficult to accurately and quickly identify target characters, resulting in poor layout control results.
By analyzing the target image data, at least two consecutive image frames are obtained, image frames with high quality scores are obtained according to the time series for each target time interval, and compared them with the preset image data. If the similarity is greater than the threshold, alarm information is output.
It improves the efficiency and accuracy of face recognition, shortens the time for selecting image frames, ensures the timeliness and reliability of alarms, and thus improves the timeliness and accuracy of control.
Smart Images

Figure CN119649285A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of face recognition technology, and in particular to an alarm method, device, electronic equipment and readable storage medium. Background Art
[0002] With the acceleration of urbanization and the increase in public safety needs, face capture and control systems have been widely used. However, due to the huge amount of data and high algorithm complexity, the system is unable to process and analyze facial images in real time. Especially in scenes with dense crowds and complex environments, the system often finds it difficult to accurately and quickly identify the target person, which greatly reduces the control effect.
[0003] In the related art, the best quality image frame of the face in the complete video is often selected, and the face comparison and alarm are performed based on the image frame. However, since this method requires selecting the best quality image frame within a period of time from the appearance to the disappearance of the face in the video, it is impossible to ensure the timeliness of the alarm deployment, which reduces the efficiency of the alarm deployment. Summary of the invention
[0004] In order to overcome the problems existing in the related art, the present invention provides an alarm method, device, electronic device and readable storage medium.
[0005] In a first aspect, the present invention provides an alarm method, the method comprising:
[0006] Parsing the target image data to obtain at least two consecutive image frames containing target face information;
[0007] In the case of detecting a face control task, according to the time sequence corresponding to the at least two consecutive image frames, a first image frame is obtained from the image frames within the target time length among the at least two consecutive image frames at each target time length; the first image frame is an image frame whose quality score corresponding to the target face information among the image frames within the target time length is greater than a preset score threshold;
[0008] For any of the first image frames, the first image frame is compared with preset image data to obtain a similarity corresponding to the first image frame; the preset image data includes image data corresponding to a designated face indicated by the face control task;
[0009] When the similarity is greater than a preset threshold, first warning information for the target face information is output based on the first image frame.
[0010] Optionally, before comparing the first image frame with preset image data to obtain a similarity corresponding to the first image frame, the method further includes:
[0011] When it is detected that the first warning information for the target face information has been output and the quality score corresponding to the first image frame is greater than the quality score corresponding to the image frame stored in the target cache, storing the first image frame in the target cache;
[0012] The comparing the first image frame with the preset image data to obtain the similarity corresponding to the first image frame includes:
[0013] When it is detected that the first warning information for the target face information is not output, the first image frame is compared with preset image data to obtain a similarity corresponding to the first image frame.
[0014] Optionally, the method further comprises:
[0015] When the similarities corresponding to each of the first image frames in the at least two consecutive image frames are less than or equal to the preset threshold, second warning information for the target facial information is output based on the first image frame with the highest quality score among the first image frames.
[0016] Optionally, the method further comprises:
[0017] Determine the image frame in which the target face information is first detected in the at least two consecutive image frames as the second image frame;
[0018] Based on the second image frame, second warning information for the target face information is output.
[0019] Optionally, when the similarity is less than or equal to the preset threshold, the first image frame is deleted.
[0020] Optionally, the outputting first warning information for the target face information based on the first image frame includes:
[0021] Generate first warning information based on a first identifier corresponding to the target face information, a quality score corresponding to the first image frame, and the first image frame;
[0022] Output the first alarm information.
[0023] In a second aspect, the present invention provides an alarm device, the device comprising:
[0024] A first parsing module is used to parse the target image data to obtain at least two consecutive image frames containing target face information;
[0025] A first acquisition module is used to acquire, in the case of detecting a face control task, a first image frame from the image frames within the target time length among the at least two consecutive image frames according to the time sequence corresponding to the at least two consecutive image frames at each target time length interval; the first image frame is an image frame whose quality score corresponding to the target face information among the image frames within the target time length is greater than a preset score threshold;
[0026] A first comparison module is used to compare any of the first image frames with preset image data to obtain a similarity corresponding to the first image frame; the preset image data includes image data corresponding to a designated face indicated by the face control task;
[0027] The first output module is used to output first warning information for the target face information based on the first image frame when the similarity is greater than a preset threshold.
[0028] Optionally, the device further comprises:
[0029] A first storage module is configured to store the first image frame in the target cache when it is detected that the first warning information for the target face information has been output and the quality score corresponding to the first image frame is greater than the quality score corresponding to the image frame stored in the target cache;
[0030] The comparing the first image frame with the preset image data to obtain the similarity corresponding to the first image frame includes:
[0031] When it is detected that the first warning information for the target face information is not output, the first image frame is compared with preset image data to obtain a similarity corresponding to the first image frame.
[0032] Optionally, the device further comprises:
[0033] A second output module is used to output second warning information for the target facial information based on the first image frame with the highest quality score among the at least two consecutive image frames, when the similarities corresponding to the first image frames in the at least two consecutive image frames are less than or equal to the preset threshold.
[0034] Optionally, the device further comprises:
[0035] A first determining module, configured to determine the image frame in which the target face information is first detected in the at least two consecutive image frames as the second image frame;
[0036] The third output module outputs second warning information for the target face information based on the second image frame.
[0037] Optionally, the device further comprises:
[0038] The first deleting module is configured to delete the first image frame when the similarity is less than or equal to the preset threshold.
[0039] Optionally, the first output module includes:
[0040] A first generating module, configured to generate first warning information based on a first identifier corresponding to the target face information, a quality score corresponding to the first image frame, and the first image frame;
[0041] The first output submodule is used to output the first alarm information.
[0042] In a third aspect, the present invention provides an electronic device comprising: a processor, a memory, and a computer program stored in the memory and executable on the processor, wherein the processor implements the alarm method described in any one of the first aspects when executing the program.
[0043] In a fourth aspect, the present invention provides a readable storage medium. When the instructions in the storage medium are executed by a processor of an electronic device, the electronic device can execute the steps in the alarm method in any one of the embodiments of the first aspect above.
[0044] In an embodiment of the present invention, the target image data is parsed to obtain at least two continuous image frames containing target face information; when a face control task is detected, the first image frame is obtained from the image frames within the target time length in the at least two continuous image frames according to the time sequence corresponding to the at least two continuous image frames, and each target time length interval; the first image frame is the image frame with the highest quality score corresponding to the target face information among the image frames within the target time length; for any first image frame, the first image frame is compared with the preset image data to obtain the similarity corresponding to the first image frame; the preset image data includes the image data corresponding to the designated face indicated by the face control task; when the similarity is greater than the preset threshold, the first alarm information for the target face information is output based on the first image frame. In this way, by dividing at least two continuous image frames according to the target time length, and selecting the image frame with the highest quality score corresponding to the target face information within the target time length as the first image frame, the local optimal frame within the target time length is determined. Then, face comparison is performed based on the first image frame to determine whether the first image frame can hit the image data corresponding to the designated face indicated by the face control task. Therefore, based on the face quality in the local time series, the frames that are most suitable for further analysis and face recognition are used for face comparison, which shortens the time of selecting the first image frame. This not only ensures the timeliness of the alarm, but also ensures the quality of the image frame for face comparison, ensuring the alarm efficiency and alarm reliability, thereby improving the timeliness and accuracy of deployment to a certain extent. BRIEF DESCRIPTION OF THE DRAWINGS
[0045] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the following briefly introduces the drawings required for use in the embodiments or the description of the prior art. Obviously, the drawings described below are some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.
[0046] Figure 1 is a flowchart of a warning method provided by an embodiment of the present invention;
[0047] Figure 2 This is a schematic diagram of an alarm method provided by an embodiment of the present invention;
[0048] Figure 3 is a schematic diagram of another alarm method provided by an embodiment of the present invention;
[0049] Figure 4 It is a flowchart of specific steps of an alarm method provided by an embodiment of the present invention;
[0050] Figure 5 is a structural diagram of an alarm device provided by an embodiment of the present invention;
[0051] Figure 6 It is a structural diagram of an electronic device provided by an embodiment of the present invention. DETAILED DESCRIPTION
[0052] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0053] Figure 1 is a flowchart of a method for providing an alarm according to an embodiment of the present invention. Figure 1 As shown, the method may include:
[0054] Step 101: parse the target image data to obtain at least two consecutive image frames containing target face information.
[0055] In an embodiment of the present invention, the collected target image data is parsed to obtain at least two image frames containing target facial information. Among them, at least two consecutive image frames contain the same target facial information, and at least two consecutive image frames contain the entire process from the appearance to the disappearance of the target facial information in the target image data. Exemplarily, a camera captures a video screen to obtain the target image data, and performs frame extraction on the target image data. For example, a video processing tool can be used to output a series of static picture files by specifying parameters such as the frame range and frame rate to be extracted to obtain at least two image frames. The at least two extracted image frames are processed using a face recognition algorithm to automatically detect and identify the facial information in the screen, and the consecutive image frames containing the target facial information are determined as at least two consecutive image frames.
[0056] Step 102, when a face control task is detected, according to the time sequence corresponding to the at least two consecutive image frames, obtain a first image frame from the image frames within the target time length in the at least two consecutive image frames at each target time length; the first image frame is an image frame in which the quality score corresponding to the target face information among the image frames within the target time length is greater than a preset score threshold.
[0057] In the embodiment of the present invention, the face control task may refer to the use of face recognition technology to monitor, identify and control personnel in a specific area or place in real time. In the case of receiving the face control task, it is necessary to quickly and accurately identify the target personnel by collecting, comparing and analyzing the face image, and perform corresponding control management. The business platform can send the face control task to the intelligent video surveillance system. In the case of receiving the face control task, the intelligent video surveillance system obtains the first image frame from the image frames within the target time length in at least two consecutive image frames according to the time series duration corresponding to at least two consecutive image frames, every target time length interval. Among them, the first image frame is an image frame containing the target face information in at least two consecutive image frames and the quality score corresponding to the target face information in the target time length is greater than the preset score threshold, that is, the first image frame is an image frame with a quality score greater than the preset score threshold in multiple consecutive image frames containing the target face information within the target time length. At the same time, in order to facilitate subsequent analysis of recognition efficiency and recognition effect, when there are multiple image frames with quality scores greater than the preset score threshold, the first image frame can also be the image frame with the highest quality score among multiple continuous image frames containing target facial information within the target time length, that is, the local optimal frame.
[0058] Among them, the preset score threshold can be set according to the needs, and the embodiment of the present invention does not limit this. The target duration can be a specific time determined in the corresponding time sequence of at least two consecutive image frames (for example, the time range of X seconds or milliseconds covered by the image frame corresponding to the time point T1 to the image frame corresponding to the time point T2, etc.). The target duration can be less than or equal to the duration corresponding to at least two consecutive image frames. For example, assuming that at least two consecutive image frames correspond to 3 minutes and the target duration is 1 minute, for at least two consecutive image frames, every 1 minute interval, the image frame with a quality score greater than the preset score threshold within the 1 minute (0 minute-1 minute) is obtained as the first image frame corresponding to the target duration; accordingly, the image frame with a quality score greater than the preset score threshold within the next 1 minute (1 minute-2 minutes) is obtained as the first image frame corresponding to the target duration; the image frame with a quality score greater than the preset score threshold within the next 1 minute (2 minutes-3 minutes) is obtained as the first image frame corresponding to the target duration. That is, in this case, 3 first image frames can be determined from at least two image frames. It is understandable that the value of the target duration can be determined according to demand, and can be adjusted and modified according to the video scene. For example, the target duration can be 3 minutes.
[0059] The quality scores corresponding to the target facial information in at least two consecutive image frames are obtained, and the image frame whose quality score is greater than a preset score threshold within the target duration is determined as the first image frame. Exemplarily, the facial information in each consecutive image frame containing the target facial information can be scored based on a face scoring algorithm to obtain the quality score corresponding to each consecutive image frame. Among them, the face scoring algorithm can include a variance method, an average gradient method, a facial feature model, a multi-task learning method or a feature fusion and machine learning method, etc., which is not limited in the embodiment of the present invention.
[0060] Step 103: for any of the first image frames, compare the first image frame with preset image data to obtain a similarity corresponding to the first image frame; the preset image data includes image data corresponding to a designated face indicated by the face control task.
[0061] In an embodiment of the present invention, for any first image frame, the first image frame is compared with a plurality of image data in a preset image library to obtain the similarity corresponding to the first image frame. The preset image data may include image data corresponding to a designated face indicated by a face control task in an image base library. The image data corresponding to a designated face indicated by a face control task refers to a face image corresponding to a target person that needs to be monitored and identified by the face control task. The first image frame is compared and identified with the image data in an existing image base library. For example, relevant face recognition algorithms and techniques, such as a feature-based face recognition method, a model-based face recognition method, and a deep learning-based face recognition method, may be used for recognition and comparison to obtain the similarity corresponding to the first image frame. Furthermore, in the case where the image data corresponding to the designated face contains multiple face images, the similarity corresponding to the first image frame may be determined based on the average value of the similarities between each face image and the first image frame.
[0062] It can be understood that if there are at least two face control services, the preset image data corresponding to the designated faces indicated by the face control service can be compared at one time, and the similarity of the first image frame corresponding to different preset image data can be obtained, and multiple face control recognitions can be performed at one time, thereby improving the execution efficiency of face control recognition.
[0063] Exemplarily, in the process of comparing the first image frame with the preset image data, the number of image comparisons and the time of image comparison can be set, which can be specifically set according to needs. The embodiment of the present invention does not limit the method of image comparison.
[0064] Step 104: When the similarity is greater than a preset threshold, output first warning information for the target face information based on the first image frame.
[0065] In the embodiment of the present invention, when the similarity is greater than a preset threshold, it indicates that the target face information contained in the first image frame has a high degree of match with the designated face indicated by the face control task, and it is highly likely that the target face information contained in the first image frame and the designated face indicated by the face control task belong to the same person. Therefore, based on the first image frame, the first warning information for the target face information is output.
[0066] In summary, in the embodiment of the present invention, the target image data is parsed to obtain at least two continuous image frames containing target face information; when a face control task is detected, the first image frame is obtained from the image frames within the target time length in the at least two continuous image frames according to the time sequence corresponding to the at least two continuous image frames, and each target time length interval; the first image frame is the image frame with the highest quality score corresponding to the target face information among the image frames within the target time length; for any first image frame, the first image frame is compared with the preset image data to obtain the similarity corresponding to the first image frame; the preset image data includes the image data corresponding to the designated face indicated by the face control task; when the similarity is greater than the preset threshold, the first alarm information for the target face information is output based on the first image frame. In this way, by dividing at least two continuous image frames according to the target time length, and selecting the image frame with the highest quality score corresponding to the target face information within the target time length as the first image frame, the local optimal frame within the target time length is determined. Then, face comparison is performed based on the first image frame to determine whether the first image frame can hit the image data corresponding to the designated face indicated by the face control task. Therefore, based on the face quality in the local time series, the frames that are most suitable for further analysis and face recognition are used for face comparison, which shortens the time of selecting the first image frame. This not only ensures the timeliness of the alarm, but also ensures the quality of the image frame for face comparison, ensuring the alarm efficiency and alarm reliability, thereby improving the timeliness and accuracy of deployment to a certain extent.
[0067] Optionally, before step 103, the embodiment of the present invention may further include the following steps:
[0068] Step 201: When it is detected that the first alarm information for the target face information has been output and the quality score corresponding to the first image frame is greater than the quality score corresponding to the image frame stored in the target cache, the first image frame is stored in the target cache.
[0069] In an embodiment of the present invention, when the first first image frame containing target facial information is identified, the first first image frame is stored in the target cache. In each case where the first image frame is identified, it is determined whether the first alarm information has been output for the target facial information. In the case where it is detected that the first alarm information for the target facial information has been output, it indicates that the first alarm information has been fed back for the face control task, and there is no need to compare the first image frame with the preset image data to determine whether the first alarm information can be output. Accordingly, the quality score of the first image frame can be compared with the quality score of the image frame stored in the target cache. In the case where the quality score of the first image frame is greater than the quality score corresponding to the image frame stored in the target cache, the first image frame is stored in the target cache, that is, the first image frame replaces the stored image frame in the target cache.
[0070] It is understandable that when it is detected that the first warning information for the target face information has been output and the quality score corresponding to the first image frame is less than or equal to the quality score corresponding to the image frame stored in the target cache, the first image frame can be directly discarded.
[0071] Accordingly, step 103 may include the following steps:
[0072] Step 202: When it is detected that the first warning information for the target face information is not output, the first image frame is compared with preset image data to obtain a similarity corresponding to the first image frame.
[0073] In an embodiment of the present invention, it is determined whether the first warning information has been output for the target facial information. Specifically, based on the first identifier of the target facial information, such as the face ID, it is possible to search whether there is the first warning information corresponding to the first identifier. When it is detected that the first warning information for the target facial information has not been output, the first image frame is compared with the preset image data to obtain the similarity corresponding to the first image frame.
[0074] In an embodiment of the present invention, by comparing the quality scores of the first image frames, it can be ensured that what can be stored in the target cache is the first image frame whose current quality score is greater than a preset score threshold for the target facial information. In this way, after a judgment is made based on each first image frame, it can be ensured that what is finally stored in the target cache is the first image frame whose quality score is greater than the preset score threshold among multiple first image frames. Since the first image frame is the image frame with the highest quality score within the corresponding target duration, what is finally stored in the target cache is the image frame with the highest quality score among at least two consecutive image frames corresponding to the target facial information, that is, the global optimal frame. When subsequent processing is performed based on the image frames stored in the target cache, the target facial information in the global optimal frame has the highest recognition degree, which improves the image quality to a certain extent, and facilitates subsequent more accurate processing of the image of the target facial information.
[0075] Optionally, the embodiment of the present invention may further include the following steps:
[0076] Step 301: When the similarities corresponding to the first image frames in the at least two consecutive image frames are less than or equal to the preset threshold, output a second warning information for the target facial information based on the first image frame with the highest quality score among the first image frames.
[0077] In an embodiment of the present invention, when the similarities corresponding to each first image frame in at least two consecutive image frames are less than or equal to a preset threshold value, it indicates that the target facial information contained in at least two consecutive image frames cannot match the designated face indicated by the face control task, and then a second alarm information for the target facial information can be output based on the first image frame with the highest quality score among the first image frames. The second alarm information is a parsing alarm information, which is used to instruct the carried first image frame to perform further facial parsing. It is understandable that after determining the quality score of each first image frame in at least two consecutive image frames, the first image frame stored in the target cache can be used as the first image frame with the highest quality score.
[0078] It can be understood that after the similarity corresponding to any first image frame is greater than a preset threshold and the first alarm information is output based on the first image frame, a second alarm information can also be output based on the first image frame to instruct the business platform to perform subsequent face analysis operations based on the target face information contained in the first image frame.
[0079] In an embodiment of the present invention, when the similarities corresponding to the first image frames in at least two consecutive image frames are less than or equal to a preset threshold value, indicating that the target facial information has not matched the target person of the face control task, a second alarm information for the target facial information can be output based on the first image frame with the highest quality score. In this way, when the target facial information contained in at least two consecutive image frames cannot match the designated face indicated by the face control task, that is, the first alarm information cannot be output for the face control task, the second alarm information can be pushed based on the global optimal frame with the best quality as the final captured data that needs to be further analyzed subsequently, thereby ensuring that the image frames used in the subsequent analysis process have the best quality, that is, the highest recognition and clearer images, which is conducive to accurate face analysis.
[0080] Optionally, the embodiment of the present invention may include the following steps:
[0081] Step 401: Determine the image frame in which the target face information is first detected among the at least two consecutive image frames as the second image frame.
[0082] In the embodiment of the present invention, the image frame in which the target face information is detected first among at least two consecutive image frames is determined as the second image frame, wherein the second image frame is the image frame that first captures the target face information, that is, the fastest frame of the system.
[0083] Step 402: Based on the second image frame, output second warning information for the target face information.
[0084] In an embodiment of the present invention, the second alarm information can be output to the business platform based on the second image frame. Specifically, the second alarm information can be generated based on the first identifier corresponding to the target facial information and the second image frame, and the second alarm information can be output. Furthermore, in order to achieve timely alarm push of the second image frame, the system usually adopts low-latency encoding technology and efficient transmission protocol to ensure that it can be sent to the business platform at the moment the face is captured. In this way, a clear starting point can be provided for the system, so that the system can obtain the second image frame containing the target facial information in a timely manner, so as to immediately start analyzing and processing the facial image.
[0085] Optionally, the embodiment of the present invention may further include the following steps:
[0086] Step 501: When the similarity is less than or equal to the preset threshold, delete the first image frame.
[0087] In the embodiment of the present invention, when the similarity corresponding to the first image frame is less than or equal to the preset threshold, it indicates that the target face information contained in the first image frame has a low matching degree with the designated face indicated by the face control task, and the target face information contained in the first image frame and the designated face indicated by the face control task are unlikely to belong to the same person. Therefore, the first image frame can be discarded, that is, the first image frame can be deleted.
[0088] In the embodiment of the present invention, the first image frame with a similarity less than or equal to a preset threshold is directly deleted, which reduces memory usage to a certain extent and improves the processing efficiency of the control alarm.
[0089] Optionally, step 104 may include the following steps:
[0090] Step 601: Generate first warning information based on a first identifier corresponding to the target facial information, a quality score corresponding to the first image frame, and the first image frame.
[0091] Step 602: Output the first alarm information.
[0092] In an embodiment of the present invention, a first identifier corresponding to the target face information is obtained, and different face information may correspond to different identifiers. Based on the first identifier corresponding to the target face information, the quality score corresponding to the first image frame, and the first image frame, a first alarm information is generated. The first alarm information is output to the business platform to issue an alarm in a timely manner for the face control task.
[0093] In an embodiment of the present invention, a first alarm message is generated and output based on the first identifier corresponding to the target facial information, the quality score corresponding to the first image frame, and the first image frame, so that the business platform can accurately obtain the information of the image frame that matches the target face indicated by the face control task, thereby facilitating subsequent processing.
[0094] For example, Figure 2 FIG. 1 is a schematic diagram of an alarm method provided by an embodiment of the present invention. Figure 2 As shown, the intelligent video surveillance system can deploy a face recognition algorithm (such as 9xfacePPL) and a face control service, and the intelligent video surveillance system and the business platform can be scheduled through an API. The business platform creates a face parsing task based on the API or scheduling. When the intelligent video surveillance system only receives a face parsing task but does not receive a face control task, it uses the face recognition algorithm to perform face recognition on at least two consecutive image frames, and pushes the second image frame that first recognizes the target face information to the business platform. Then, the recognized first image frame is pushed to the control service. When the control service detects that there is no face control service, it outputs the second alarm data based on the first image frame with the highest quality score.
[0095] For example, Figure 3 FIG. 1 is a schematic diagram of another alarm method provided by an embodiment of the present invention. Figure 3 As shown, the business platform creates face analysis tasks and face control tasks based on API or scheduling. When the intelligent video surveillance system receives face analysis tasks and face control tasks, it uses the face recognition algorithm to perform face recognition on at least two consecutive image frames, and pushes the second image frame that first recognizes the target face information to the business platform. The alarm process can then be divided into three situations:
[0096] Case 1: Push the identified first image frame to the control service. When the control service detects the presence of a face, it compares the first image frame with the preset image data to obtain the similarity corresponding to the first image frame. When the similarity is greater than the preset threshold, it outputs the first alarm information and the second alarm information based on the first image frame. After that, when the control service receives the first image frame corresponding to the target face information, it can discard the first image frame.
[0097] Case 2: The identified first image frame is pushed to the control service. When the control service detects the presence of a face, the first image frame is compared with the preset image data to obtain the similarity corresponding to the first image frame. If the similarity is less than or equal to the preset threshold, the first image frame is discarded. After discarding multiple first image frames, the last first image frame, which is also the first image frame with the highest quality score among at least two consecutive image frames, that is, the global optimal frame, can be pushed to the control service. If the similarity of the first image frame with the highest quality score is greater than the preset threshold, the first alarm information and the second alarm information are output based on the first image frame.
[0098] Case 3: The identified first image frame is pushed to the control service. When the control service detects the presence of a face, the first image frame is compared with the preset image data to obtain the similarity corresponding to the first image frame. If the similarity is less than or equal to the preset threshold, the first image frame is discarded. After discarding all the first image frames, that is, the similarities corresponding to all the first image frames are less than or equal to the preset threshold, the second alarm data is output based on the first image frame with the highest quality score.
[0099] It is understandable that in each case, before discarding the first image frame, the quality score of the first image frame may be compared with the quality score of the first image frame in the target cache, and the first image frame with a higher quality score may be stored in the target cache.
[0100] For example, Figure 4 A flowchart of the specific steps of an alarm method is shown, such as Figure 4As shown, the target image data is parsed to obtain at least two consecutive image frames containing target facial information, and the second image frame that first recognizes the target facial information in the at least two consecutive image frames is pushed to the business platform. According to the target duration, the first image frame is obtained to detect whether there is a face control task. If not, the first image frame is discarded, and the first image frame with the highest quality score is obtained. Based on the first image frame with the highest quality score, the second alarm data is output; if so, the first image frame is compared with the preset image data to obtain the similarity corresponding to the first image frame, and it is determined whether the similarity is greater than the preset threshold value. If so, the first alarm information and the second alarm information are output based on the first image frame; if not, the first image frame is discarded, and it is determined whether all the first image frames in at least two consecutive image frames have been obtained. If so, the second alarm data is output based on the first image frame with the highest quality score; if not, the next first image frame is obtained, and the above steps of comparing the first image frame with the preset image data to obtain the similarity corresponding to the first image frame and determining whether the similarity is greater than the preset threshold value are repeated until the system outputs the first alarm data and / or the second alarm data to the business platform.
[0101] Figure 5 is a structural diagram of an alarm device provided by an embodiment of the present invention, such as Figure 5 As shown, the device may specifically include:
[0102] The first parsing module 701 is used to parse the target image data to obtain at least two consecutive image frames containing target face information;
[0103] The first acquisition module 702 is used to acquire, in the case of detecting a face control task, a first image frame from the image frames within the target time length among the at least two consecutive image frames according to the time sequence corresponding to the at least two consecutive image frames at each target time length interval; the first image frame is an image frame whose quality score corresponding to the target face information among the image frames within the target time length is greater than a preset score threshold;
[0104] A first comparison module 703 is used to compare any of the first image frames with preset image data to obtain a similarity corresponding to the first image frame; the preset image data includes image data corresponding to a designated face indicated by the face control task;
[0105] The first output module 704 is used to output first warning information for the target face information based on the first image frame when the similarity is greater than a preset threshold.
[0106] The embodiment of the present invention provides an alarm device, which analyzes the target image data to obtain at least two continuous image frames containing target face information; when a face control task is detected, according to the time sequence corresponding to the at least two continuous image frames, the first image frame is obtained from the image frames within the target time length in the at least two continuous image frames at each target time length interval; the first image frame is the image frame with the highest quality score corresponding to the target face information among the image frames within the target time length; for any first image frame, the first image frame is compared with the preset image data to obtain the similarity corresponding to the first image frame; the preset image data includes the image data corresponding to the designated face indicated by the face control task; when the similarity is greater than the preset threshold, the first alarm information for the target face information is output based on the first image frame. In this way, by dividing at least two continuous image frames according to the target time length, and selecting the image frame with the highest quality score corresponding to the target face information within the target time length as the first image frame, the local optimal frame within the target time length is determined. Then, based on the first image frame, face comparison is performed to determine whether the first image frame can hit the image data corresponding to the designated face indicated by the face control task. Therefore, based on the face quality in the local time series, the frames that are most suitable for further analysis and face recognition are used for face comparison, which shortens the time of selecting the first image frame, not only ensuring the timeliness of the alarm, but also ensuring the quality of the picture frame for face comparison, ensuring the alarm efficiency and alarm reliability, thereby improving the timeliness and accuracy of the deployment to a certain extent.
[0107] Optionally, the device further comprises:
[0108] A first storage module is configured to store the first image frame in the target cache when it is detected that the first warning information for the target face information has been output and the quality score corresponding to the first image frame is greater than the quality score corresponding to the image frame stored in the target cache;
[0109] The first comparison module includes:
[0110] The first comparison submodule is used to compare the first image frame with preset image data to obtain the similarity corresponding to the first image frame when it is detected that the first warning information for the target face information is not output.
[0111] Optionally, the device further comprises:
[0112] A second output module is used to output second warning information for the target facial information based on the first image frame with the highest quality score among the at least two consecutive image frames, when the similarities corresponding to the first image frames in the at least two consecutive image frames are less than or equal to the preset threshold.
[0113] Optionally, the device further comprises:
[0114] A first determining module, configured to determine the image frame in which the target face information is first detected in the at least two consecutive image frames as the second image frame;
[0115] The third output module outputs second warning information for the target face information based on the second image frame.
[0116] Optionally, the device further comprises:
[0117] The first deleting module is configured to delete the first image frame when the similarity is less than or equal to the preset threshold.
[0118] Optionally, the first output module 704 includes:
[0119] A first generating module, configured to generate first warning information based on a first identifier corresponding to the target face information, a quality score corresponding to the first image frame, and the first image frame;
[0120] The first output submodule is used to output the first alarm information.
[0121] The present invention also provides an electronic device, see Figure 6 , including: a processor 801, a memory 802, and a computer program 8021 stored in the memory and executable on the processor, wherein the processor implements the alarm method of the aforementioned embodiment when executing the program.
[0122] The present invention also provides a readable storage medium, when the instructions in the storage medium are executed by the processor of the electronic device, the electronic device can execute the alarm method of the above embodiment.
[0123] As for the device embodiment, since it is basically similar to the method embodiment, the description is relatively simple, and the relevant parts can be referred to the partial description of the method embodiment.
[0124] The algorithm and display provided herein are not inherently related to any particular computer, virtual system or other device. Various general purpose systems can also be used together with the teachings based on this. According to the above description, it is obvious that the structure required for constructing such systems. In addition, the present invention is not directed to any specific programming language either. It should be understood that various programming languages can be utilized to realize the content of the present invention described herein, and the description of the above specific languages is for disclosing the best mode of the present invention.
[0125] In the description provided herein, a large number of specific details are described. However, it is understood that embodiments of the present invention can be practiced without these specific details. In some instances, well-known methods, structures and techniques are not shown in detail so as not to obscure the understanding of this description.
[0126] Similarly, it should be understood that in order to streamline the present invention and aid in understanding one or more of the various inventive aspects, in the above description of exemplary embodiments of the present invention, the various features of the present invention are sometimes grouped together into a single embodiment, figure, or description thereof. However, this disclosed method should not be interpreted as reflecting the following intention: that the claimed invention requires more features than the features explicitly recited in each claim. More specifically, as reflected in the claims below, inventive aspects lie in less than all the features of the individual embodiments disclosed above. Therefore, the claims that follow the specific embodiment are hereby expressly incorporated into the specific embodiment, with each claim itself serving as a separate embodiment of the present invention.
[0127] Those skilled in the art will appreciate that the modules in the devices in the embodiments may be adaptively changed and arranged in one or more devices different from the embodiments. The modules or units or components in the embodiments may be combined into one module or unit or component, and in addition they may be divided into a plurality of submodules or subunits or subcomponents. Except that at least some of such features and / or processes or units are mutually exclusive, all features disclosed in this specification (including the accompanying claims, abstracts and drawings) and all processes or units of any method or device disclosed in this manner may be combined in any combination. Unless otherwise expressly stated, each feature disclosed in this specification (including the accompanying claims, abstracts and drawings) may be replaced by an alternative feature providing the same, equivalent or similar purpose.
[0128] The various component embodiments of the present invention may be implemented in hardware, or in software modules running on one or more processors, or in a combination thereof. It should be understood by those skilled in the art that a microprocessor or digital signal processor (DSP) may be used in practice to implement some or all of the functions of some or all of the components in the sorting device according to the present invention. The present invention may also be implemented as a device or apparatus program for executing part or all of the methods described herein. Such a program for implementing the present invention may be stored on a computer-readable medium, or may be in the form of one or more signals. Such a signal may be downloaded from an Internet website, or provided on a carrier signal, or provided in any other form.
[0129] It should be noted that the above embodiments illustrate the present invention rather than limit it, and that those skilled in the art may devise alternative embodiments without departing from the scope of the appended claims. In the claims, any reference symbol between brackets shall not be construed as a limitation on the claims. The word "comprising" does not exclude the presence of elements or steps not listed in the claims. The word "one" or "an" preceding an element does not exclude the presence of a plurality of such elements. The present invention may be implemented by means of hardware comprising a number of different elements and by means of a suitably programmed computer. In a unit claim enumerating a number of devices, several of these devices may be embodied by the same hardware item. The use of the words first, second, and third, etc., does not indicate any order. These words may be interpreted as names.
[0130] Those skilled in the art can clearly understand that, for the convenience and brevity of description, the specific working processes of the systems, devices and units described above can refer to the corresponding processes in the aforementioned method embodiments and will not be repeated here.
[0131] It should be noted that all actions of acquiring signals, information or data in this application are carried out in compliance with the relevant data protection laws and policies of the country where they are located and with the authorization given by the owner of the corresponding device.
[0132] The above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. Any modifications, equivalent substitutions and improvements made within the spirit and principles of the present invention should be included in the protection scope of the present invention.
[0133] The above is only a specific embodiment of the present invention, but the protection scope of the present invention is not limited thereto. Any person skilled in the art can easily think of changes or substitutions within the technical scope disclosed by the present invention, which should be included in the protection scope of the present invention. Therefore, the protection scope of the present invention should be based on the protection scope of the claims.
Claims
1. An alarm method, characterized in that: The method comprises: Parsing the target image data to obtain at least two consecutive image frames containing target face information; In the case of detecting a face control task, according to the time sequence corresponding to the at least two consecutive image frames, a first image frame is obtained from the image frames within the target time length among the at least two consecutive image frames at each target time length; the first image frame is an image frame whose quality score corresponding to the target face information among the image frames within the target time length is greater than a preset score threshold; For any of the first image frames, the first image frame is compared with preset image data to obtain a similarity corresponding to the first image frame; the preset image data includes image data corresponding to a designated face indicated by the face control task; When the similarity is greater than a preset threshold, first warning information for the target face information is output based on the first image frame.
2. The method according to claim 1, characterized in that Before comparing the first image frame with the preset image data to obtain the similarity corresponding to the first image frame, the method further includes: When it is detected that the first warning information for the target face information has been output and the quality score corresponding to the first image frame is greater than the quality score corresponding to the image frame stored in the target cache, storing the first image frame in the target cache; The comparing the first image frame with the preset image data to obtain the similarity corresponding to the first image frame includes: When it is detected that the first warning information for the target face information is not output, the first image frame is compared with preset image data to obtain a similarity corresponding to the first image frame.
3. The method according to claim 1, characterized in that The method further comprises: When the similarities corresponding to each of the first image frames in the at least two consecutive image frames are less than or equal to the preset threshold, second warning information for the target facial information is output based on the first image frame with the highest quality score among the first image frames.
4. The method according to claim 1, characterized in that: The method further comprises: Determine the image frame in which the target face information is first detected in the at least two consecutive image frames as the second image frame; Based on the second image frame, second warning information for the target face information is output.
5. The method according to claim 1, characterized in that The method further comprises: When the similarity is less than or equal to the preset threshold, the first image frame is deleted.
6. The method according to claim 1, characterized in that The outputting first warning information for the target face information based on the first image frame includes: Generate first warning information based on a first identifier corresponding to the target face information, a quality score corresponding to the first image frame, and the first image frame; Output the first alarm information.
7. An alarm device, characterized in that: The device comprises: A first parsing module is used to parse the target image data to obtain at least two consecutive image frames containing target face information; A first acquisition module is used to acquire, in the case of detecting a face control task, a first image frame from the image frames within the target time length among the at least two consecutive image frames according to the time sequence corresponding to the at least two consecutive image frames at each target time length interval; the first image frame is an image frame whose quality score corresponding to the target face information among the image frames within the target time length is greater than a preset score threshold; A first comparison module is used to compare any of the first image frames with preset image data to obtain a similarity corresponding to the first image frame; the preset image data includes image data corresponding to a designated face indicated by the face control task; The first output module is used to output first warning information for the target face information based on the first image frame when the similarity is greater than a preset threshold.
8. The device according to claim 7, characterized in that The device also includes: A first storage module is configured to store the first image frame in the target cache when it is detected that the first warning information for the target face information has been output and the quality score corresponding to the first image frame is greater than the quality score corresponding to the image frame stored in the target cache; The first comparison module includes: The first comparison submodule is used to compare the first image frame with preset image data to obtain the similarity corresponding to the first image frame when it is detected that the first warning information for the target face information is not output.
9. An electronic device, characterized in that: include: A processor, a memory, and a computer program stored in the memory and executable on the processor, wherein the processor implements the alarm method according to any one of claims 1 to 6 when executing the program.
10. A readable storage medium, characterized in that: When the instructions in the storage medium are executed by a processor of an electronic device, the electronic device is enabled to execute the alarm method described in any one of claims 1-6.