Video desensitization method and computing device

By generating graphic codes to overlay facial images in videos and determining the processing order based on facial attributes and computing resources, the problem of facial information leakage in videos is solved, achieving efficient video desensitization and privacy protection.

CN122268993APending Publication Date: 2026-06-23XFUSION DIGITAL TECH CO LTD

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
XFUSION DIGITAL TECH CO LTD
Filing Date
2026-02-14
Publication Date
2026-06-23

AI Technical Summary

Technical Problem

Facial images in videos can easily lead to identity leaks and privacy violations, and existing technologies struggle to effectively de-identify them.

Method used

By generating a graphic code to overlay the face image in the video, the processing order is determined based on the attribute information of the face image and the computing resources. The graphic code corresponding to the target face image is generated and overlaid on the original face image to generate the target video.

Benefits of technology

It achieves facial information anonymization in videos, retains backtracking capabilities, improves video anonymization efficiency, balances privacy protection and identity tracing, and adapts to different computing resource environments.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122268993A_ABST
    Figure CN122268993A_ABST
Patent Text Reader

Abstract

The application relates to the technical field of computing, in particular to a video desensitization method and a computing device, which comprises the following steps: acquiring an initial video needing desensitization processing, and determining a first image containing a human face from the initial video; in the case that the first image contains multiple human face images, determining a processing sequence corresponding to each of the multiple human face images according to attribute information of the multiple human face images; generating a graph code corresponding to a target human face image according to a computing resource condition and the processing sequence corresponding to each of the multiple human face images; the target human face image is part or all of the human face images in the first image selected according to the computing resource condition; covering the corresponding graph code on the target human face image in the first image to obtain a second image, and replacing the first image in the initial video with the second image to obtain a target video.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of computing technology, and in particular to a video desensitization method and computing device. Background Technology

[0002] With the rapid development of computer vision technology, video capture is involved in many fields such as video surveillance, video conferencing, social media, and telemedicine. Facial images often appear in these videos, and as key biometric features, they pose high security requirements. If faces in videos are shared directly without anonymization, it can easily lead to risks such as identity leakage and privacy violations. Therefore, how to anonymize faces in videos is a pressing technical task that needs to be addressed. Summary of the Invention

[0003] This application provides a video desensitization method and computing device, which covers the face image in the video with a graphic code to desensitize the face in the video and improve the security of personal privacy information.

[0004] According to a first aspect of the embodiments of this application, a video desensitization method is provided, comprising: Obtain the initial video that needs to be de-identified, and determine the first image containing a human face from the initial video; When the first image includes multiple face images, the processing order corresponding to each face image is determined based on the attribute information of the multiple face images. Based on the available computing resources, according to the processing order of multiple face images, a graphic code corresponding to the target face image is generated. The target face image is a partial or complete face image selected from the first image based on the available computing resources. The target face image in the first image is overlaid with the corresponding graphic code to obtain the second image, and the first image in the initial video is replaced with the second image to obtain the target video.

[0005] If the first image includes a face image, the graphic code of that face image is generated directly.

[0006] In this embodiment, for an initial video requiring desensitization, a first image containing a face can be obtained from the initial video to identify the image to be desensitized. For the first image, the face image corresponding to the face region in the image can be extracted, and a graphic code corresponding to the target face image can be generated, thus making the graphic code associated with the face image and preserving the ability to trace back the face. The target face image in the first image is then overlaid with the graphic code to obtain a second image. The face image is hidden through the graphic code, avoiding the risk of facial information leakage. Replacing the first image in the initial video with the second image desensitizes the face image in the video while retaining the ability to trace back the face. This improves video desensitization efficiency while simultaneously considering multiple performance aspects such as privacy protection, identity tracing, and high processing performance.

[0007] Since the desensitization process consumes significant computational resources, this application first sorts multiple face images, and then, based on available computational resources, desensitizes a number of higher-priority face images. This is one of the innovations of this application, enabling it to adapt to resource-intensive scenarios, such as real-time video desensitization.

[0008] According to a first aspect of the embodiments of this application, in some embodiments of the first aspect, determining the processing order corresponding to the multiple face images based on their respective attribute information includes: The processing order of multiple face images is determined based on whether they are frontal views and whether they appear for the first time.

[0009] In this embodiment, whether a face image is a frontal view and whether it appears for the first time are used as the core judgment criteria to determine the corresponding processing order for multiple face images. This realizes the intelligent and standardized division of face image processing priorities, which can prioritize the scheduling of high-value face images for subsequent processing, optimize the execution logic of batch face image processing, and improve the rationality and efficiency of the overall processing flow.

[0010] According to a first aspect of the embodiments of this application, in some embodiments of the first aspect, determining the processing order corresponding to multiple face images based on whether the multiple face images are frontal and whether they appear for the first time includes: Based on whether multiple face images are frontal and whether they appear for the first time, determine the image group, image category, and face identifier for each face image. The image group includes the first appearance group and the non-first appearance group, and the image category includes frontal face images or non-frontal face images. The processing order for each face image is determined by prioritizing the first-appearance group over the non-first-appearance group, prioritizing frontal face images over non-frontal face images within the same group, and sorting multiple face images in the first image according to the order of face identification within the same group and category.

[0011] In this embodiment, the processing order of face images is ranked by determining whether a face appears for the first time and whether it is a frontal face. That is, the urgency and reliability of face processing are considered in the face image ranking scenario. Then, based on a multi-level priority ranking rule—first-appearance group > non-first-appearance group, frontal face images > non-frontal face images within the same group, and face identification order within the same group and category—the processing order of multiple face images in the first image is quantitatively ranked. This design accurately filters out high-value face information (first-appearance, frontal face images) and assigns them priority, effectively improving the resource allocation efficiency and core information filtering accuracy of face image processing. Furthermore, face identification maintains the orderliness and traceability of the ranking results, ensuring the stability and interpretability of the processing flow.

[0012] According to a first aspect of the embodiments of this application, in some embodiments of the first aspect, generating a graphic code corresponding to a target face image includes: Calculate the size of the first border corresponding to the initial video based on the attribute information of the initial video; Obtain the second border size corresponding to the target face image of the first image; If the second border size is smaller than the first border size, enlarge the second border size to obtain the third border size, and generate the graphic code corresponding to the target face image according to the third border size. If the second border size is greater than or equal to the first border size, generate the graphic code corresponding to the target face image according to the second border size.

[0013] In this embodiment, the first border size corresponding to the initial video is used as a benchmark, and the second border size of the face in the first image is compared with it, with different processing cases. For second border sizes smaller than the benchmark, the size is enlarged to obtain a third border size; for those not smaller than the benchmark, the original size is directly used. Then, a graphic code corresponding to the target face image is generated based on the adapted border size. This not only anchors the minimum specification baseline for graphic code generation, effectively avoiding the problem of insufficient pixel density, decreased recognition rate, or even inability to recognize the graphic code due to an excessively small face border size, but also avoids meaningless enlargement of borders that already meet the specifications, balancing resource utilization efficiency and processing speed in graphic code generation. Simultaneously, through standardized size adaptation rules, the graphic code generation specifications corresponding to the two different sources of faces—the initial video and the first image—are unified, significantly improving the consistency and recognizability of the graphic codes, and ensuring the stability and accuracy of subsequent graphic code recognition.

[0014] According to a first aspect of the embodiments of this application, in some embodiments of the first aspect, when the second border size is smaller than the first border size, the second border size is enlarged to obtain a third border size, including: When a face first appears in the target face image and the size of the second border is smaller than the size of the first border, the size of the second border is enlarged to obtain the size of the third border. When the second border size is larger than the first border size, generate the graphic code corresponding to the target face image according to the second border size, including: When a face first appears in the target face image, and the second border size is larger than the first border size, a graphic code corresponding to the target face image is generated according to the second border size. Also includes: If the face in the target face image is not appearing for the first time, a graphic code corresponding to the target face image is generated based on the size of the graphic code determined from the history of the target face image.

[0015] In this embodiment, whether the target face image appears for the first time is used as the criterion for size adjustment. In the case of the target face image appearing for the first time, the border size of the graphic code is adjusted in a timely manner. This not only anchors the minimum specification bottom line for graphic code generation, effectively avoiding the problem of insufficient pixel density, decreased recognition rate, or even failure to recognize due to the face border size being too small, but also avoids meaningless enlargement of the border that already meets the specification, thus balancing the resource utilization efficiency and processing speed of graphic code generation.

[0016] According to a first aspect of the embodiments of this application, in some embodiments of the first aspect, calculating the first border size corresponding to the initial video based on the attribute information of the initial video includes: Extract the attribute information of the initial video, including the resolution of the initial video; Based on the attribute information and the dynamic threshold calculation formula, determine the initial size corresponding to the initial video; Determine the first border size of the initial video based on the initial dimensions.

[0017] In this embodiment, by extracting the attribute information of the initial video, such as the resolution of each image frame, and adaptively determining the initial size using a dynamic threshold calculation formula, and then further determining the first border size based on this initial size, dynamic and adaptive adjustment of the first border size is achieved. This ensures that the first border size is highly compatible with the resolution and other attribute features of the initial video itself, effectively improving the rationality and scene compatibility of the border size setting. It also ensures that subsequent operations such as face detection and image processing based on the first border size can match the actual characteristics of videos with different resolutions, significantly enhancing the robustness, adaptability, and processing accuracy of the overall solution.

[0018] According to a first aspect of the embodiments of this application, in some embodiments of the first aspect, determining the first border size of the initial video based on an initial size includes: Based on multiple preset resolution levels, the target resolution level corresponding to the initial video resolution is determined, and the multiple resolution levels are associated with size threshold ranges respectively; Based on the size threshold range associated with the target resolution level, adjust the initial size of the initial video to obtain the first border size of the initial video.

[0019] In this embodiment, by adaptively adjusting the resolution of the images in the video and the initial size of the initial video, a more accurate first border size can be obtained. Based on multiple preset resolution levels each associated with a size threshold range, the target resolution level corresponding to the initial video resolution is first determined. Then, the initial size is adjusted according to the size threshold range associated with that level to obtain the first border size. This achieves hierarchical and adaptively precise setting of the first border size, effectively adapting to video scenes with different resolutions, overcoming the limitations of fixed size thresholds, and significantly improving the adaptability, rationality, and setting accuracy of the first border size.

[0020] According to a first aspect of the embodiments of this application, in some embodiments of the first aspect, a graphic code corresponding to a target face image is generated according to the processing order corresponding to multiple face images, based on computing resource availability, including: When the initial video is real-time, the graphic code corresponding to the target face image is generated according to the processing order of multiple face images based on the available computing resources.

[0021] In this embodiment, the graphic code corresponding to the target face image is generated according to the processing order of multiple face images, taking into account the computing resource status. In real-time video scenarios, the computing resources can be dynamically adapted to prioritize the generation of graphic codes for high-priority faces. This not only improves the computing power utilization efficiency of real-time video face processing, but also ensures the smoothness and real-time performance of the graphic code generation process, avoiding processing delays or stutters due to insufficient computing power.

[0022] According to a first aspect of the embodiments of this application, in some embodiments of the first aspect, generating a graphic code corresponding to a target face image includes: Extract facial features corresponding to the target face image; If the face in the target face image is determined to be appearing for the first time based on the facial features of the target face image, then a face identifier is generated for the target face image. If, based on the facial features of the target face image, it is determined that the face in the target face image is not appearing for the first time, then the face identifier corresponding to the target face image is obtained. Generate a graphic code corresponding to the target face image based on the facial features and facial identifiers corresponding to the target face image.

[0023] In this embodiment, facial features are encoded and bound to a unique facial identifier, achieving a precise one-to-one correspondence between the target facial image and the graphic code. This ensures the uniqueness of the graphic code and allows for rapid tracing and matching of the corresponding facial features and identity information. This effectively improves the efficiency of facial information storage, transmission, and verification, providing a standardized and quickly readable information carrier for subsequent facial identity verification and information association matching, thereby enhancing the accuracy, security, and convenience of facial information management.

[0024] According to a first aspect of the embodiments of this application, in some embodiments of the first aspect, generating a graphic code corresponding to the target face image based on the face features and face identifier corresponding to the target face image includes: Based on the facial features and facial identifiers corresponding to the target facial image, determine the data to be encoded for the target facial image; Encrypt the data to be encoded to obtain encrypted data; Based on a preset image encoding algorithm, a graphic code corresponding to the encrypted data is generated.

[0025] In this embodiment, the unique data to be encoded is first determined by combining the facial features and facial identifiers corresponding to the target face image to ensure the unique correspondence between the data and the face. Then, the data to be encoded is encrypted to improve information security. Finally, a graphic code corresponding to the encrypted data is generated through a preset image encoding algorithm. This realizes the encryption and standardization of facial features and identity identifiers through graphic encoding. It not only ensures the accurate binding between the data to be encoded and the facial information, but also effectively prevents security risks such as leakage and tampering of facial information through encryption. It takes into account the accuracy, security and convenience of facial information processing, and provides a safe and reliable information carrier for subsequent facial information verification, traceability and other links.

[0026] According to a second aspect of the embodiments of this application, a video desensitization apparatus is provided, which may include: The video acquisition unit is used to acquire the initial video that needs to be desensitized and to determine the first image containing a human face from the initial video.

[0027] The sequence determination unit is used to determine the processing order of multiple face images based on their respective attribute information when the first image includes multiple face images.

[0028] The image generation unit is used to generate an image code corresponding to a target face image according to the processing order of multiple face images based on the computing resources available; the target face image is a partial or complete face image selected from the first image based on the computing resources available.

[0029] The video desensitization unit is used to overlay the corresponding graphic code on the target face image in the first image to obtain the second image, and replace the first image in the initial video with the second image to obtain the target video.

[0030] According to a third aspect of the embodiments of this application, a computing device is provided, including a memory storing a computer program, the computer program being invoked by a processor to execute any of the video desensitization methods in the embodiments of this application.

[0031] According to a fourth aspect of the embodiments of this application, a computer-readable storage medium is provided, on which a computer program is stored, and when the computer program is executed by a processor, it implements any of the video desensitization methods.

[0032] According to a fifth aspect of the present application, a computer product is provided, comprising: a computer program that, when executed by a processor, implements the steps of any video desensitization method.

[0033] It should be understood that both the foregoing general description and the following detailed description are exemplary and intended to provide further illustration of the claimed technology. Attached Figure Description

[0034] The above and other objects, features, and advantages of the embodiments of this application will become more apparent from the more detailed description of the embodiments in conjunction with the accompanying drawings. The accompanying drawings are used to provide a further understanding of the embodiments of this application and constitute a part of the specification. They are used together with the embodiments of this application to explain the embodiments of this application and do not constitute a limitation on the embodiments of this application. In the accompanying drawings, the same reference numerals generally represent the same components or steps.

[0035] Figure 1 The figure shows an example diagram of a video desensitization system according to an embodiment of this application; Figure 2 The figure shows an application example of a smart home scenario provided by an embodiment of this application; Figure 3 The figure shows an application example of a telemedicine scenario provided by an embodiment of this application; Figure 4 The illustration shows an application example in the new retail field according to an embodiment of this application; Figure 5 The figure shows a flowchart of a video desensitization method according to an embodiment of this application; Figure 6 The figure shows another flowchart of a video desensitization method according to an embodiment of this application; Figure 7 The figure shows another flowchart of a video desensitization method according to an embodiment of this application; Figure 8 The figure shows another flowchart of a dynamic adjustment of the border size according to an embodiment of this application; Figure 9 The figure shows another flowchart of a video desensitization method according to an embodiment of this application; Figure 10 The figure shows another flowchart of a video desensitization method according to an embodiment of this application; Figure 11 The figure shows another flowchart of a video desensitization method according to an embodiment of this application; Figure 12 The figure shows another flowchart of a video desensitization method according to an embodiment of this application; Figure 13 The figure shows a schematic diagram of a video desensitization device according to an embodiment of this application; Figure 14 The figure shows a hardware block diagram of a computing device according to an embodiment of this application. Detailed Implementation

[0036] To make the objectives, technical solutions, and advantages of the embodiments of this application more apparent, exemplary embodiments according to the embodiments of this application will be described in detail below with reference to the accompanying drawings. Obviously, the described embodiments are merely some embodiments of the embodiments of this application, and not all embodiments of the embodiments of this application. It should be understood that the embodiments of this application are not limited to the exemplary embodiments described herein.

[0037] The technical solution of this application embodiment can be applied to video desensitization scenarios. By covering the face image in the video with the corresponding graphic code, the video can be quickly desensitized, while the backtracking capability is retained through the setting of the graphic code.

[0038] The technical solutions of the embodiments of this application will now be described in detail with reference to the accompanying drawings.

[0039] like Figure 1 The diagram shown is an example of a video anonymization system provided in an embodiment of this application. The video anonymization system may include a terminal device 10 and a server 20.

[0040] The terminal device 10 can be a camera, or a mobile phone, computer, wearable device, smart home appliance, or other device with camera functionality. The terminal device 10 can capture initial video and upload it to the server 20, where the server 20 performs anonymization processing on the initial video.

[0041] Specifically, after obtaining the initial video that needs to be de-identified, server 20 can execute the video de-identification method provided in this application embodiment. For example, it obtains the initial video that needs to be de-identified and determines a first image containing a face from the initial video; if the first image includes multiple face images, it determines the processing order corresponding to each of the multiple face images based on their respective attribute information; according to computing resources, it generates a graphic code corresponding to the target face image according to the processing order corresponding to each of the multiple face images; the target face image is a partial or complete face image selected from the first image based on computing resources; the corresponding graphic code is overlaid on the target face image in the first image to obtain a second image, and the first image in the initial video is replaced with the second image to obtain the target video.

[0042] The following describes several application scenarios involved in the embodiments of this application.

[0043] 1. Smart Home Scenarios With the rapid development of technology, the deployment of cameras in communities and homes is becoming increasingly common. When these cameras are in operation, they inevitably capture images of pedestrians in public areas. While family members or community members can be authorized to be filmed, thus protecting their privacy, directly filming non-family members or non-community members poses a risk of privacy infringement.

[0044] like Figure 2 The diagram shown is an application example of a smart home scenario provided in an embodiment of this application.

[0045] refer to Figure 2 Building 201 can be located on one side of the road, with a camera 202 installed on its wall. Pedestrians 203 and 204 will have their videos captured by the camera 202 as they walk on the road. Of course, the camera 202 will continuously capture video regardless of whether pedestrians are present.

[0046] The initial video captured by the camera can be, for example, as shown in 205. For an image containing a face in the initial video, i.e., the first image, the face image 207 corresponding to the face region 206 in the first image can be obtained, and a graphic code 208 for the face image 207 can be generated. Then, the graphic code 208 is used to overwrite the face image in the first image to obtain the overwritten second image 209. The first image in the initial video is replaced with the second image to obtain the target video.

[0047] 2. Telemedicine Scenarios During home rehabilitation, physical therapists can guide patients through rehabilitation exercises via video. However, other people may appear in the video during these sessions. Figure 3As shown, this is a remote medical scenario provided by an embodiment of this application. By dynamically acquiring the initial video from the patient's side, the face of the therapist or medical staff appearing for the first time can be generated and covered with a graphic code using the technical solution of this application.

[0048] like Figure 3 As shown, the face region 301 of the first appearance of a physical therapist or medical staff member's face can be used to determine the face image 302 corresponding to the face region 301, generating a graphic code 303. The graphic code 303 is then overlaid on the face image 302 of the face region 301 in the first image to obtain the overlaid second image 304.

[0049] Furthermore, the priority of the patient's image can be lower than that of other users in the frame.

[0050] 3. New Retail Sector Currently, with the installation of cameras in shopping malls and other venues to analyze customer movement and dwell time, directly collecting customers' facial information poses risks of infringement and information leakage. To address these issues, the technical solution described in this application can be adopted.

[0051] Figure 4 The illustration shows an application example in the new retail field provided by an embodiment of this application.

[0052] The cameras can be installed in multiple locations within the shopping mall. When a customer first enters the monitored area of ​​a camera, based on the first image captured in video 401 by that camera, a facial image 402 of the customer in the first image can be obtained, and a corresponding graphic code 403 can be generated. Then, the graphic code can be overlaid on the facial image in the first image to obtain a second image with the overlaid graphic code. The first image in the initial video is then replaced with the second image to obtain the target video 404.

[0053] Optionally, a customer identifier can also be set for this customer, such as... Figure 4 As shown, a customer ID (identification code) can be displayed above the customer's head in the video to identify the customer. When a customer walks through the store, facial images captured in the video can be overlaid with this graphic code to track the customer's movements while protecting their privacy. The customer ID could, for example, refer to the facial ID assigned to that customer.

[0054] It should be noted that, Figure 2-4 The graphic code in the image is a QR code, which can be accessed through... like Figure 5 The diagram shown is a flowchart of a video desensitization method provided in an embodiment of this application. The video desensitization method may include the following steps: S501. Obtain the initial video that needs to be desensitized, and determine the first image containing a human face from the initial video.

[0055] Referring to the above, cameras are mostly installed in high-traffic areas such as shopping malls, communities, and hospitals. The video captured by the cameras can be temporarily stored in the camera's memory or stored on a remote server. In this embodiment, computing devices include cloud servers, servers, handheld terminals, tablet computers, and personal computers.

[0056] Obtaining the initial video that needs to be anonymized can include: retrieving the initial video that needs to be anonymized from a video database; or receiving the initial video that needs to be anonymized from a camera.

[0057] The initial video can refer to the video that needs to undergo de-identification processing.

[0058] Optionally, determining the first image containing a face from the initial video may include: performing face detection on each image frame in the initial video; if a face is detected in an image frame, then the image frame is determined to be the first image containing a face; if no face is detected in an image frame, then the next detection is performed.

[0059] Specifically, a face detection algorithm can be used to detect faces in each image frame of the initial video. The face detection algorithm can be, for example, a deep learning algorithm or a feature-based face detection algorithm; however, this embodiment does not impose excessive limitations on the specific type of face detection algorithm.

[0060] S502. When the first image includes multiple face images, determine the processing order corresponding to each of the multiple face images based on their respective attribute information.

[0061] Optionally, at least one of the first appearance attribute and frontal face attribute of the facial image's attribute information.

[0062] Specifically, if a face appears for the first time in a face image, then "first appearance" is its appearance attribute. If a face does not appear for the first time in a face image, then "not first appearance" is its appearance attribute.

[0063] If the face in the face image is a frontal face, then it has the attribute of a frontal face; if the face in the face image is not a frontal face, then it has the attribute of a frontal face.

[0064] For the same first image, there may be one or more faces. In order to avoid confusion in the processing order, the processing order of multiple faces in the same first image can be sorted to obtain the processing order of each face image in the same first image.

[0065] S503. Based on the available computing resources, generate the graphic code corresponding to the target face image according to the processing order of the multiple face images.

[0066] The target face image is a partial or complete face image selected from the first image based on computing resources.

[0067] The target face image can be selected based on the processing order of multiple face images and the availability of computing resources.

[0068] Specifically, based on available computing resources, the number of face images that can currently be processed to generate image codes can be determined. The target face image is then selected according to the processing order of the multiple face images and the number of face images.

[0069] For example, given the number of face images N, N face images are selected as target face images in chronological order, according to the processing order of the multiple face images. N is an integer greater than or equal to 1.

[0070] The computing resource situation refers to the computing power resources of the computing device executing the video desensitization method of this application embodiment. This may include parameters such as processing time, memory size, and CPU (Central Processing Unit) utilization. The computing resources of the computing device can be quantified using these parameters to obtain the computing resources possessed by the device.

[0071] Furthermore, the average computing resources required to generate the graphic code can be determined in advance, and then the number N of face images that can be processed can be calculated based on the computing resources available to the computing device.

[0072] Optionally, for multiple face images in the same first image, the multiple face images can be added to the processing queue according to the processing order of each face image, so as to schedule the face images from the processing queue in sequence and generate the graphic code of the face image.

[0073] In this context, a graphic code can refer to a combination of points, lines, geometric shapes, grids, or structured patterns in an image that can be visually recognized, according to a preset encoding rule. For example, a graphic code can be a QR code, barcode, etc. The specific type of graphic code is not limited in this embodiment.

[0074] In one possible design, based on available computing resources, and according to the processing order of multiple face images, a graphic code corresponding to the target face image is generated, including: When the initial video is real-time, the graphic code corresponding to the target face image is generated according to the processing order of multiple face images based on the available computing resources.

[0075] In this embodiment, the graphic code corresponding to the target face image is generated according to the processing order of multiple face images, taking into account the computing resource status. In real-time video scenarios, the computing resources can be dynamically adapted to prioritize the generation of graphic codes for high-priority faces. This not only improves the computing power utilization efficiency of real-time video face processing, but also ensures the smoothness and real-time performance of the graphic code generation process, avoiding processing delays or stutters due to insufficient computing power.

[0076] S504. Overlay the corresponding graphic code on the target face image in the first image to obtain the second image, and replace the first image in the initial video with the second image to obtain the target video.

[0077] Optionally, to obtain a second image by overlaying a corresponding graphic code onto the target face image in the first image, the method may include: determining the image region corresponding to the target face image in the first image, and filling the corresponding image region in the first image with the graphic code based on the image region to obtain the second image.

[0078] Specifically, for an image region, a local image corresponding to the image region is cropped from the first image. The size of this local image is the same as the size of the graphic code, such as 150 pixels. 150. The pixels of a local image and the pixels of a graphic code can correspond one-to-one, or the corresponding pixels can be called pixel pairs. The pixel value of each pixel in the local image at the pixel position in the first image can be set to the pixel value of the corresponding pixel in the graphic code.

[0079] Understandably, a face image can refer to a local image corresponding to the face bounding boxes detected by a face detection algorithm from a first image. A face bounding box can be the smallest detection box that can enclose a face in the first image. The size of the face bounding box is proportional to the size of the face; the larger the face in the first image, the larger the face bounding box, and vice versa.

[0080] In this embodiment, for an initial video requiring desensitization, a first image containing faces can be identified first, thus locating the image to be desensitized. Then, given multiple face images in the first image, the processing order for each face image can be determined based on their respective attribute information. Then, depending on computing resources, some or all face images from the first image are selected, and the target face images are sequentially masked according to their respective processing order. Next, the target face image in the first image is covered with a graphic code to obtain a second image. The graphic code hides the target face image, avoiding the risk of facial information leakage. Replacing the first image in the initial video with the second image desensitizes the target face image in the video while retaining traceability. This improves video desensitization efficiency while simultaneously considering multiple performance aspects such as privacy protection, identity tracing, and high processing performance.

[0081] For multiple face images in the same image, the processing order of the multiple face images is determined according to their respective attribute information. This includes determining the processing order of the multiple face images based on whether they are frontal faces and whether they appear for the first time.

[0082] Specifically, the processing order of multiple face images is determined based on whether they are frontal views and whether they appear for the first time, including: Based on whether multiple face images are frontal and whether they appear for the first time, the image group, image category, and face identifier of each face image are determined. The image group includes the first appearance group and the non-first appearance group, and the image category includes frontal face images or non-frontal face images.

[0083] The processing order for each face image is determined by prioritizing the first-appearance group over the non-first-appearance group, prioritizing frontal face images over non-frontal face images within the same group, and sorting multiple face images in the first image according to the order of face identification within the same group and category.

[0084] The following explains how to sort multiple face images within the same image. For example... Figure 6 The diagram shown is another example of a video desensitization method provided in this application. The difference from other embodiments is that the method includes: S601. Determine whether each face image in the first image is appearing for the first time. If so, add it to the first appearance group; otherwise, add it to the non-first appearance group.

[0085] Optionally, the first-appearance group may include one or more face images that are appearing for the first time. The non-first-appearance group may include one or more face images that are not appearing for the first time.

[0086] To determine whether a face is appearing for the first time, the face can be compared with previously saved first-time appearances. If the face is not detected in the previously saved first-time appearances, it is determined that the face is appearing for the first time. If the face is detected in the previously saved first-time appearances, it is determined that the face is not appearing for the first time.

[0087] Optionally, for a face appearing for the first time, a face identifier (FACE_ID) can be set for the face image to distinguish different face images. For faces that appear multiple times, the face identifier of the same face can be set for the face image.

[0088] S602. Determine whether the face in the face image is a frontal face. If so, mark the face image as a frontal face image; otherwise, mark the face image as a non-frontal face image.

[0089] Optionally, to determine whether a face is frontal, key points in the face can be detected, such as the left eye, right eye, nose, left corner of the mouth, and right corner of the mouth. The detected key points can then be used to determine whether the face is frontal.

[0090] Furthermore, the following criteria can be used to determine whether a face is a frontal face by detecting key points: ① The difference in horizontal coordinates (x) between the left and right eyes / the width of the face frame ≤ 0.1 (they are almost on the same horizontal line); ② The difference between the x-coordinate of the nose and the x-coordinate of the center of the face frame / the width of the face frame ≤ 0.05 (nose centered); ③ The x-coordinates of the left and right corners of the mouth are symmetrical about the nose (difference / face frame width ≤ 0.1).

[0091] S603. Sort multiple face images in the first image according to the priority of the first appearance group being greater than that of non-first appearance groups, the priority of frontal face images being greater than that of non-frontal face images within the same group, and the order of face identification within the same group and category, to obtain the processing order corresponding to the multiple face images respectively.

[0092] In this embodiment, the processing order of face images is ranked by determining whether a face appears for the first time and whether it is a frontal face. That is, the urgency and reliability of face processing are considered in the face image ranking scenario. Then, based on a multi-level priority ranking rule—first-appearance group > non-first-appearance group, frontal face images > non-frontal face images within the same group, and face identification order within the same group and category—the processing order of multiple face images in the first image is quantitatively ranked. This design accurately filters out high-value face information (first-appearance, frontal face images) and assigns them priority, effectively improving the resource allocation efficiency and core information filtering accuracy of face image processing. Furthermore, face identification maintains the orderliness and traceability of the ranking results, ensuring the stability and interpretability of the processing flow.

[0093] like Figure 7 The diagram shown is another flowchart of a video desensitization method provided in this application embodiment. The difference between this method and other embodiments is that it may include the following steps: S701. Obtain the initial video that needs to be desensitized, and determine the first image containing a human face from the initial video.

[0094] S702. Based on the attribute information of the initial video, calculate the size of the first border corresponding to the initial video.

[0095] The first border size represents the standard size of the face images in each video frame of the initial video. In other words, a standard detection box size is set for the initial video, and the second border size corresponding to the face images being detected is dynamically adjusted based on this standard detection box size, i.e., the first border size.

[0096] S703. Obtain the second border size corresponding to the target face image of the first image.

[0097] The second border size can be the size of the detection box of the target face image obtained in real time from the first image.

[0098] The first border size can be used as the standard size of the face image in the initial video. That is, if the second border size of the target face image is smaller than the first border size, the second border size of the target face image can be increased. If the second border size of the target face image is greater than or equal to the first border size, no adjustment needs to be made.

[0099] S704. Determine whether the size of the second border is smaller than the size of the first border. If yes, execute S705; otherwise, execute S706.

[0100] Optionally, before executing S704, the method further includes: determining whether the face in the target face image appears for the first time.

[0101] If a face appears for the first time in the target face image, S704 is executed directly to complete the dynamic adjustment of the border.

[0102] If the face in the target face image is not appearing for the first time, the dynamic adjustment of the border is not performed. Instead, the graphic code corresponding to the target face image can be generated based on the size of the graphic code determined by the history of the target face image.

[0103] The size of the graphic code determined by the history of the target face image can refer to the size of the graphic code used in the last time the graphic code of the target face image was generated.

[0104] Alternatively, if the face in the target face image is not appearing for the first time, dynamic adjustment of the border is not performed, and a graphic code corresponding to the target face image can be generated based on the second border size.

[0105] Understandably, using whether a face appears for the first time as a constraint for border adjustment allows border adjustment to be applied only to faces that appear for the first time, avoiding the waste of resources that would otherwise be used to adjust borders for all face images, thus improving conversion efficiency.

[0106] In addition, you can set different colors for each border to make them easier to distinguish.

[0107] Specifically: If a face appears for the first time in the target face image and is a frontal face, then the first color is set as the border color.

[0108] If a face appears for the first time in the target face image and is not a frontal face, then the second color is set as the border color.

[0109] If the face in the target face image is not appearing for the first time and is a frontal face, then the third color is set as the border color.

[0110] If the face in the target face image is not appearing for the first time and is not a frontal face, then the fourth color is set as the border color.

[0111] The border color in this application embodiment may include, for example, the color of the graphic code and the color of the prompt box where the ID of the border above the graphic code is located.

[0112] S705. Enlarge the second border size to obtain the third border size, and generate the graphic code corresponding to the target face image according to the third border size.

[0113] The third border size is the size obtained by enlarging the second border size.

[0114] Optionally, enlarging the second border size to obtain the third border size may include: enlarging the second border size to the first border size, that is, determining the first border size as the third border size.

[0115] Optionally, enlarging the second border size to obtain the third border size can include: enlarging the second border size according to a preset enlargement ratio to obtain the third border size. For example, enlarging the second border size according to a preset enlargement ratio can include: enlarging the length and width of the second border size proportionally according to the preset enlargement ratio.

[0116] For example, the second border size is 3. 5. With a magnification ratio of 1.2, the length of the second border can be increased to 3. 1.2 = 3.6, increase the width of the second border size by 5. 1.2 = 6, so we get 3.6. 6 represents the third border size.

[0117] For example, the second bounding box of the target face image detected by the face detection algorithm is (x1, y1, x2, y2). Boundary check: Determine if the size of the second bounding box, i.e., its length, is less than the size of the first bounding box, T. If it is less, enlarge the size of the second bounding box. When enlarging the bounding box, center enlargement and hard constraints can be used: If enlargement is required, calculate the new coordinates (new_x1, new_y1, new_x2, new_y2) based on the center of the box, and strictly enforce boundary constraints to ensure that the new coordinates do not exceed the range of [0, frame_width] and [0, frame_height]. This step outputs a final coverage area with stable size and valid position.

[0118] If the second border size is smaller than the first border size of the initial video, the second border size is enlarged to obtain a third border size. Based on this third border size, a graphic code corresponding to the target face image is generated. In this case, the size of the graphic code is the third border size.

[0119] S706. Generate the graphic code corresponding to the target face image according to the second border size.

[0120] If the second border size is greater than or equal to the first border size, a graphic code corresponding to the target face image is generated according to the second border size. In this case, the size of the graphic code is the second border size.

[0121] S707. Cover the target face image in the first image with the graphic code to obtain the covered second image.

[0122] S708. Replace the first image in the initial video with the second image to obtain the target video.

[0123] In this embodiment, the first border size corresponding to the initial video is used as a benchmark, and the second border size of the face in the first image is compared with it, with different processing cases. For second border sizes smaller than the benchmark, the size is enlarged to obtain a third border size; for those not smaller than the benchmark, the original size is directly used. Then, a graphic code corresponding to the target face image is generated based on the adapted border size. This approach anchors the minimum specification baseline for graphic code generation, effectively avoiding the problem of insufficient pixel density, decreased recognition rate, or even inability to recognize the graphic code due to an excessively small face border size. It also avoids meaningless enlargement of borders that already meet the specifications, balancing resource utilization efficiency and processing speed in graphic code generation. This significantly improves the consistency and recognizability of the graphic code, ensuring the stability and accuracy of subsequent downstream processes such as graphic code recognition and face association verification.

[0124] It is understandable that any video can include one or more images. If an image contains a face, the proportion of that face in the video is generally within a reasonable range. Therefore, based on the image size, the reasonable size of the face in the image can be estimated. Based on this, the initial video border size is dynamically obtained.

[0125] As another embodiment, calculating the first border size corresponding to the initial video based on the attribute information of the initial video may include: Extract the attribute information of the initial video, including the resolution of each image frame in the initial video; Based on the attribute information and the dynamic threshold calculation formula, determine the initial size corresponding to the initial video; Determine the first border size of the initial video based on the initial dimensions.

[0126] Optionally, attributes such as resolution, frame rate, and aspect ratio in the initial video can be analyzed to obtain the attribute information of the initial video. Attribute information may include the resolution, length, width, and aspect ratio of each image frame in the initial video. Length refers to the number of pixels in length, and width refers to the number of pixels in width.

[0127] The formula for calculating the dynamic threshold is as follows: T = K × log2(length × width) × f(aspect ratio) + C Where K is a coefficient and C is a constant that can be set.

[0128] It is understandable that the resolution P=W H; W is length, H is width. The aspect ratio R = W / H.

[0129] ,in, This is for adjusting the index. The default value is 0.4, and it can be adjusted between 0.3 and 0.5.

[0130] For example, suppose the initial video has a resolution of 1920×1080 and an aspect ratio of 16 / 9.

[0131] The dynamic threshold calculation formula is T = K × log2(1920 × 1080) × f(16 / 9) + C = 150, so the initial size is 150. 150.

[0132] Optionally, different threshold ranges can be set according to the resolution level. The threshold range can refer to the range of values ​​of T at the resolution level.

[0133] For example, resolution levels can include: Level 1, P<640 480 represents low-resolution video, with a threshold range of 80-100 pixels for Level 1.

[0134] Level 2, 640 480 <P<1920 1080 is a medium resolution video, and the threshold range for Level 2 is 100-140 pixels.

[0135] Level 3, P>1902 1080 is a high-resolution video, and the threshold range for Level 3 is 140-180.

[0136] Optionally, for the calculated initial size of the initial video, the first border size of the initial video can be determined based on the threshold range corresponding to the resolution level of the initial video and the initial size.

[0137] For example, if the initial size exceeds the threshold range, the boundary value corresponding to the threshold range is determined as the first border size. If it is greater than the upper boundary of the threshold range, the upper boundary is used as the first border size; if it is less than the lower boundary of the threshold range, the lower boundary is used as the first border size. The threshold range can be represented as (lower boundary, upper boundary).

[0138] Assuming the initial video resolution level is level 2, its corresponding threshold range is 100-140 pixels, and the initial size is 150, 150>140, which exceeds the threshold range, then the upper boundary of the threshold range, 140, is determined as the first border size.

[0139] In this embodiment, by extracting the attribute information of the initial video, such as the resolution of each image frame, and adaptively determining the initial size using a dynamic threshold calculation formula, and then further determining the first border size based on this initial size, dynamic and adaptive adjustment of the first border size is achieved. This ensures that the first border size is highly compatible with the resolution and other attribute features of the initial video itself, effectively improving the rationality and scene compatibility of the border size setting. It also ensures that subsequent operations such as face detection and image processing based on the first border size can match the actual characteristics of videos with different resolutions, significantly enhancing the robustness, adaptability, and processing accuracy of the overall solution.

[0140] In one possible design, the initial dimensions of the calculated initial video can be directly used as the border dimensions of the initial video.

[0141] In another possible design, the border size of the initial video can be adaptively adjusted based on the resolution of the images in the video and the initial size of the initial video, thereby obtaining a more accurate first border size.

[0142] Therefore, based on the initial dimensions, the first border size of the initial video is determined, including: Based on multiple preset resolution levels, the target resolution level corresponding to the resolution of the initial video is determined, and each resolution level is associated with a size threshold range. Based on the size threshold range associated with the target resolution level, the initial size of the initial video is adjusted to obtain the first border size of the initial video.

[0143] For ease of understanding, such as Figure 8 The diagram shown is a flowchart of a dynamic adjustment of border size provided in an embodiment of this application.

[0144] 801. Extract the attribute information of the initial video. The attribute information includes the resolution of the initial video, which includes the video width W and the video height H.

[0145] 802. Calculate the product P of the video width W and the video height H.

[0146] 803. Calculate the quotient R of video width W and video height H.

[0147] 804. Calculate the aspect ratio factor

[0148] 805. Determine the coefficients K and constant C in the dynamic threshold calculation formula.

[0149] 806. Input the above parameters into the dynamic threshold calculation formula: This yields the initial dimensions.

[0150] 807. Multiple preset resolution levels are: the first resolution level (threshold range 80-100 pixels), the second resolution level (threshold range 100-140 pixels), and the third resolution level (threshold range 140-180 pixels), with resolution ranging from low to high.

[0151] 808. Based on the target resolution level corresponding to the initial video resolution, dynamically adjust the initial size to obtain the first border size T.

[0152] For example, the threshold range corresponding to the target resolution level can be obtained, and the initial size can be dynamically adjusted according to the threshold range to obtain the first border size T.

[0153] 809. Output the first border size T.

[0154] In this embodiment, by adaptively adjusting the resolution of the images in the video and the initial size of the initial video, a more accurate first border size can be obtained. Based on multiple preset resolution levels each associated with a size threshold range, the target resolution level corresponding to the initial video resolution is first determined. Then, the initial size is adjusted according to the size threshold range associated with that level to obtain the first border size. This achieves hierarchical and adaptively precise setting of the first border size, effectively adapting to video scenes with different resolutions, overcoming the limitations of fixed size thresholds, and significantly improving the adaptability, rationality, and setting accuracy of the first border size.

[0155] It's understandable that videos are typically captured continuously over time; therefore, the same person's face may appear in multiple images. To improve management efficiency and avoid information confusion, the same face identifier can be assigned to multiple face images of the same person to achieve face tracking. Therefore, in practical applications, whether a new face identifier needs to be generated or an existing one can be reused based on whether the face appears for the first time. The face identifier from the face image can then be used to generate a graphic code, ensuring the graphic code contains sufficiently rich information for graphic code backtracking.

[0156] Therefore, as Figure 9 The diagram shown is another flowchart of a video desensitization method provided in this application embodiment. The difference from other embodiments lies in the generation of a graphic code corresponding to the target face image, which specifically includes: S901. Extract the facial features corresponding to the target face image.

[0157] S902. Based on the facial features of the target face image, determine whether the face in the target face image appears for the first time. If yes, execute S903; otherwise, execute S904.

[0158] S903, Generate a face identifier for the target face image.

[0159] If the first appearance of a face in a target face image is determined based on its facial features, a face identifier is generated for that target face image.

[0160] If, based on the facial features of the target face image, it is determined that the face in the target face image is not appearing for the first time, then the face identifier corresponding to the target face image is obtained.

[0161] S904. Obtain the face identifier corresponding to the target face image.

[0162] Understandably, for each person represented by a face, image acquisition for that person is continuous. Since multiple face images of a continuously acquired person are included, face identifiers are set up to distinguish between different people's face images. Based on these face identifiers, a feature cache queue is generated. Each time a new face image is acquired, its features are added to the feature cache queue.

[0163] To distinguish whether a person has been collected, this embodiment of the application can associate a standard facial feature with a facial identifier. This standard facial feature can be obtained by weighting multiple facial features in a corresponding feature cache queue, thereby forming a highly robust and stable feature vector.

[0164] S905. Generate a graphic code corresponding to the target face image based on the face features and face identifiers corresponding to the face image.

[0165] In this embodiment, facial features are encoded and bound to a unique facial identifier, achieving a precise one-to-one correspondence between the target facial image and the graphic code. This ensures the uniqueness of the graphic code and allows for rapid tracing and matching of the corresponding facial features and identity information. This effectively improves the efficiency of facial information storage, transmission, and verification, providing a standardized and quickly readable information carrier for subsequent facial identity verification and information association matching, thereby enhancing the accuracy, security, and convenience of facial information management.

[0166] As one embodiment, generating a graphic code corresponding to the target face image based on the facial features and facial identifiers corresponding to the target face image includes: Based on the facial features and facial identifiers corresponding to the target facial image, determine the data to be encoded for the target facial image; Encrypt the data to be encoded to obtain encrypted data; Based on a preset image encoding algorithm, a graphic code corresponding to the encrypted data is generated.

[0167] Optionally, determining the data to be encoded for the target face image based on the face features and face identifier corresponding to the target face image may include: packaging information such as the feature vector, face identifier, timestamp, and current feature dimension corresponding to the target face image to obtain the data to be encoded.

[0168] Encrypting the data to be encoded to obtain encrypted data can include: encrypting the data to be encoded using a preset encryption algorithm. For example, the encryption algorithm could be the SM4 (commercial cryptographic) algorithm. The preset image encoding algorithm could be, for example, Base64 (an encoding method based on 64 printable characters).

[0169] In this embodiment, the unique data to be encoded is first determined by combining the facial features and facial identifiers corresponding to the target face image to ensure the unique correspondence between the data and the face. Then, the data to be encoded is encrypted to improve information security. Finally, a graphic code corresponding to the encrypted data is generated through a preset image encoding algorithm. This realizes the encryption and standardization of facial features and identity identifiers through graphic encoding. It not only ensures the accurate binding between the data to be encoded and the facial information, but also effectively prevents security risks such as leakage and tampering of facial information through encryption. It takes into account the accuracy, security and convenience of facial information processing, and provides a safe and reliable information carrier for subsequent facial information verification, traceability and other links.

[0170] Figure 10 This is another flowchart of a video desensitization method provided in this application embodiment, which differs from the previous embodiments in that it further includes: S1001. Based on the target face image of the first image, determine the target priority of the target face image from a set of preset priorities.

[0171] S1002, Obtain the target border color that has been pre-set for the target priority.

[0172] Overlay the target face image of the first image with a graphic code to obtain the second image corresponding to the first image, including: S1003. Set the border of the graphic code according to the target border color, and associate the graphic code border with a label border of the same color. The label border is used to display prompt information of the target face image. The prompt information includes the face identifier corresponding to the target face image, the target priority, and the size of the graphic code.

[0173] Optionally, setting the graphic code border according to the target border color can be performed before the graphic code covers the target face image in the first image, and the target face image in the first image can be covered with a graphic code that includes the graphic code border.

[0174] Optionally, setting the graphic code border according to the target border color can be performed after the graphic code covers the target face image in the first image, and the graphic code border in the second image can be set according to the target border color.

[0175] In this embodiment, the target priority is determined based on the target face image in the first image, and a pre-set corresponding border color is matched. Then, the target border color is set for the graphic code, and a label border of the same color is configured to display prompts such as face identification, target priority, and graphic code size. Finally, the graphic code is overlaid on the target face image to obtain the second image. This achieves the visual differentiation of face priority and the standardized and information-based display of graphic codes. By binding priority with exclusive colors, target face images of different importance can be distinguished intuitively and quickly, improving the efficiency of face management and recognition. The design of the same-color border and label not only ensures the uniformity and aesthetics of the visual display, but also integrates and displays the core related information of the face, avoiding information dispersion and greatly enhancing the readability, information interactivity, and management convenience of the image interface. This provides clear and intuitive visual support for subsequent face query, priority control, information verification, and other operations.

[0176] As one embodiment, multiple priorities are preset, including the highest priority, the second-highest priority, the third-highest priority, and the fourth-highest priority, which decrease in order of priority. Based on the target face image of the first image, the target priority corresponding to the graphic code of the target face image is determined from the multiple preset priorities, including: If the target face image appears for the first time in the first image and is a frontal face image, determine the target priority of the highest priority target face image; If the target face image appears for the first time in the first image and is not a frontal face image, then the secondary priority is determined to be the target priority of the target face image; If the target face image in the first image is not the first appearance and is a frontal face image, then the third priority level is determined as the target priority of the target face image; If the target face image in the first image is not appearing for the first time and is not a frontal face image, then the fourth priority level is determined as the target priority of the target face image.

[0177] For example, assuming the highest priority associated color is blue, then when the target face image of the first image appears for the first time and is a frontal face image, the border of the graphic code is blue.

[0178] Assuming the secondary priority associated color is orange, then when the target face image of the first image appears for the first time and is not a frontal face image, the border of the graphic code is orange.

[0179] Assuming the color associated with the third priority level is green, then if the target face image in the first image is not appearing for the first time and is a frontal face image, the border of the graphic code is green.

[0180] Assuming the color associated with the fourth priority level is red, then if the target face image in the first image is not appearing for the first time and is not a frontal face image, the border of the graphic code will be red.

[0181] In this embodiment, a four-level standardized priority classification rule is established based on two dual judgment dimensions: whether the target face image appears for the first time and whether it is a frontal face image. The first-time appearance of a frontal face target face image is set as the highest priority. Subsequent non-frontal face, non-first-time appearance of a frontal face, and non-first-time appearance of a non-frontal face target face images are assigned secondary, tertiary, and quaternary priorities, respectively. This achieves a refined and structured distinction of the importance of target face images with different attributes. It can accurately focus on high-value faces such as first-time appearances and frontal faces and assign them the highest processing weight. This provides a clear priority basis for subsequent target face image processing, graphic code generation, visual annotation, and resource scheduling, effectively improving the targeting, rationality, and execution efficiency of intelligent face processing, and making the overall processing flow more in line with the core needs of prioritizing high-value faces in actual business.

[0182] Figure 7 In the illustrated embodiment, generating the graphic code requires determining the size of the graphic code. Figure 9 In the illustrated embodiment, the generation of the graphic code depends on the facial features and facial identifiers of the target face image.

[0183] Therefore, in the process of generating graphic codes, the facial features and facial identifiers of the target face image can be used as the content for generating graphic codes to generate graphic codes of a certain size (such as the third border size or the third border size).

[0184] In one possible design, the content to be generated by the graphic code can be determined first, namely the facial features and facial identifiers of the face image, and then the size of the graphic code can be determined.

[0185] Therefore, as Figure 11 The diagram shown is another flowchart of a video desensitization method provided in this application embodiment. The method may include: S1101. Obtain the initial video that needs to be desensitized, and determine the first image containing a human face from the initial video.

[0186] S1102. When the first image includes multiple face images, determine the processing order corresponding to each of the multiple face images based on their respective attribute information.

[0187] S1103. Based on the available computing resources and the processing order of the multiple face images, extract the facial features corresponding to the target face image. The target face image is a partial or complete face image selected from the first image based on the available computing resources. Perform S1104-S1115 for any face image.

[0188] S1104. Based on the facial features of the target face image, determine whether the face in the target face image appears for the first time. If yes, execute S1105; otherwise, execute S1113.

[0189] S1105. Based on the attribute information of the initial video, calculate the first border size T corresponding to the initial video.

[0190] S1106. Obtain the second border size S corresponding to the face region of the first image.

[0191] S1107. Determine whether the second border size S is smaller than the first border size T. If yes, execute S1108; otherwise, keep the original size.

[0192] S1108. Enlarge the second border size to obtain the third border size, and generate the graphic code corresponding to the target face image according to the third border size.

[0193] If the second border size is smaller than the first border size of the initial video, the second border size is enlarged to obtain the third border size.

[0194] S1109. Generate the graphic code of the target face image according to the second border size.

[0195] Of course, when there are multiple target face images, the graphic code of each face image can be generated sequentially according to the processing order corresponding to the multiple target face images.

[0196] S1110. Determine whether the target face image is a frontal face image. If yes, execute S1111; otherwise, execute S1112.

[0197] S1111: Set a blue border for the graphic code and associate it with blue label information.

[0198] S1112. Set an orange border for the graphic code and associate it with orange label information.

[0199] S1113. Determine whether the target face image is a frontal face image. If yes, proceed to S1114; otherwise, proceed to S1115.

[0200] S1114. Set a green border for the graphic code and associate it with green label information.

[0201] S1115. Set a red border for the graphic code and associate it with red label information.

[0202] Optionally, the label information may include a face identifier corresponding to the image image of the graphic code. The label information and the border corresponding to the label information may have a border of the same color as the graphic code.

[0203] Of course, in this embodiment, the colors of the graphic code and the associated color tag information can be randomly set. The use of blue, orange, green, and red borders in this embodiment is merely illustrative and does not constitute a specific limitation. For example, blue can be replaced with black, orange with yellow, green with purple, and red with blue.

[0204] S1116. Overwrite the face image in the corresponding first image with the graphic code corresponding to the target face image to obtain the overwritten second image.

[0205] S1117. Overwrite the target face image in the corresponding first image with the graphic code corresponding to the target face image to obtain the overwritten second image.

[0206] In this embodiment, face extraction and feature matching are performed on the initial video to determine whether the face appears for the first time and whether it is a frontal face. The border size is adaptively adjusted to generate a matching graphic code, and different colored borders and labels are assigned according to the face attributes. Finally, the face is covered with the graphic code to achieve video desensitization. This not only ensures the readability of the graphic code, but also achieves visual annotation of face attributes through color differentiation. The face desensitization process is completed automatically, taking into account desensitization security, information recognition, and processing efficiency.

[0207] like Figure 12 The diagram shown is another flowchart of a video desensitization method provided in this application embodiment. The method may include: S1201. Obtain the initial video that needs to be desensitized, and determine the first image containing a human face from the initial video.

[0208] S1202. When the first image includes multiple face images, determine the processing order corresponding to each of the multiple face images based on their respective attribute information.

[0209] S1203. Based on the available computing resources and the processing order of the multiple face images, extract the facial features corresponding to the target face image. The target face image is a partial or complete face image selected from the first image based on the available computing resources.

[0210] S1204. Based on the attribute information of the initial video, calculate the first border size T corresponding to the initial video.

[0211] S1205. Obtain the second border size S corresponding to the face region of the first image.

[0212] S1206. Based on the facial features of the target face image, determine whether the face in the target face image appears for the first time. If yes, execute S1207; otherwise, execute S1221.

[0213] Traverse multiple target face images, and execute S1206-S1228 on the currently traversed target face image.

[0214] S1207. Detect the frontal face confidence of the target face image.

[0215] Understandably, frontal face confidence score refers to the degree of confidence that a face in a face image is a frontal face. The value can be between 0 and 1 or between 0 and 100. The higher the value, the greater the probability that it is close to a frontal face.

[0216] The frontal face confidence score of a face image can be detected using a frontal face confidence score detection algorithm obtained through training. The training process of the frontal face confidence score detection algorithm can be found in relevant technical content and will not be elaborated here.

[0217] S1208. Determine whether the confidence score of the frontal face in the target face image is greater than a preset confidence threshold. If yes, proceed to S1209. Otherwise, proceed to S1215.

[0218] S1209. Label the image category of the target face image as the first frontal face type. For example, the first frontal face type is represented by RECFACE.

[0219] S1210. Determine whether the second border size S is smaller than the first border size T. If yes, execute S1211; otherwise, execute S1213.

[0220] S1211. Enlarge the second border size to obtain the third border size, and determine the graphic code size of the target face image as the third border size.

[0221] S1212. Determine that the border color of the graphic code is blue, and associate it with blue label information. The blue label information can be, for example, RECFACE_EXT, including the ext suffix.

[0222] S1213. Determine the graphic code size of the target face image as the second border size.

[0223] S1214. Determine that the border color of the graphic code is blue, and associate it with blue label information. The blue label information can be, for example, RECFACE, excluding the ext suffix.

[0224] S1215. Mark the image category of the target face image as the first non-frontal face type.

[0225] S1216. Determine whether the second border size S is smaller than the first border size T. If yes, execute S1217; otherwise, execute S1219.

[0226] S1217. Enlarge the second border size to obtain the third border size, and determine the graphic code size of the target face image as the third border size.

[0227] S1218. Determine that the border color of the graphic code is orange, and associate orange label information. The orange label information can be, for example, FFACE_EXT, including the ext suffix.

[0228] S1219. Determine the graphic code size of the target face image as the second border size.

[0229] S1220. Determine that the border color of the graphic code is orange, and associate orange label information. For example, the orange label information can be: FFACE, excluding the ext suffix.

[0230] S1221. Detect the frontal face confidence of the target face image.

[0231] S1222. Determine whether the confidence level of the frontal face of the target face image is greater than the preset confidence threshold. If yes, execute S1223; otherwise, execute S1225.

[0232] S1223. Determine the graphic code size of the target face image as the second border size.

[0233] S1224. Determine the border color of the graphic code to be green, and associate it with green label information. For example, the green label information can be: PFACE.

[0234] S1225. Determine the graphic code size of the target face image as the second border size.

[0235] S1226. Determine the border color of the graphic code to be red, and associate it with red label information. For example, the red label information can be: GFACE.

[0236] S1227. Following the processing order of the target face image, generate the graphic code of the target face image according to the graphic code size and graphic code border color, and associate it with the corresponding tag information.

[0237] S1228. Cover the target face image in the first image with the corresponding graphic code to obtain the second image, and replace the first image in the initial video with the second image to obtain the target video.

[0238] In this embodiment, by detecting borders, judging confidence levels, and setting graphic code colors and borders according to categories, it is possible to adaptively adjust the border size to generate a suitable graphic code, and assign different colored borders and labels according to facial attributes. Finally, the graphic code covers the face to achieve video desensitization, which not only ensures the recognition effect of the graphic code, but also realizes the visualization of facial attributes through color differentiation, and automates the face desensitization process, taking into account desensitization security, information recognition and processing efficiency.

[0239] like Figure 13 The diagram shown is a structural schematic of a video desensitization device provided in an embodiment of this application. The video desensitization device 1300 may include: The video acquisition unit 1301 is used to acquire the initial video that needs to be desensitized and to determine the first image containing a human face from the initial video.

[0240] The sequence determination unit 1302 is used to determine the processing order of the multiple face images according to their respective attribute information when the first image includes multiple face images.

[0241] The image generation unit 1303 is used to generate an image code corresponding to a target face image according to the processing order of multiple face images based on the computing resources available; the target face image is a partial or complete face image selected from the first image based on the computing resources available.

[0242] The video desensitization unit 1304 is used to overlay the corresponding graphic code on the target face image in the first image to obtain the second image, and replace the first image in the initial video with the second image to obtain the target video.

[0243] As one embodiment, the sequence determination unit 1302 includes: The sequence determination module is used to determine the processing order of multiple face images based on whether they are frontal views and whether they appear for the first time.

[0244] As another embodiment, the sequence determination unit 1302 includes: The grouping submodule is used to determine the image group, image category, and face identifier of each face image based on whether multiple face images are frontal and whether they appear for the first time. The image group includes the first appearance group and the non-first appearance group, and the image category includes frontal face images or non-frontal face images. The sequence submodule is used to sort multiple face images in the first image according to the priority of the first appearance group being greater than that of non-first appearance groups, the priority of frontal face images being greater than that of non-frontal face images within the same group, and the order of face identification within the same group and category, so as to obtain the processing order corresponding to the multiple face images respectively.

[0245] As another embodiment, the graphics generation unit 1303 includes: The first acquisition module is used to calculate the first border size corresponding to the initial video based on the attribute information of the initial video. The first border size represents the standard size of the face image corresponding to each video frame in the initial video. The second acquisition module is used to acquire the second border size corresponding to the target face image of the first image; The size enlargement module is used to enlarge the second border size when the second border size is smaller than the first border size to obtain the third border size, and generate the graphic code corresponding to the target face image according to the third border size. The size maintenance module is used to generate a graphic code corresponding to the target face image according to the second border size when the second border size is greater than or equal to the first border size.

[0246] As another embodiment, the size enlargement module is specifically used to: when the face first appears in the target face image and the size of the second border is smaller than the size of the first border, enlarge the size of the second border to obtain the size of the third border.

[0247] The size maintenance module is specifically used to: when a face first appears in the target face image, and the second border size is larger than the first border size, generate the graphic code corresponding to the target face image according to the second border size.

[0248] Also includes: The graphics generation unit also includes: The image generation module is used to generate a graphic code corresponding to the target face image based on the size of the graphic code determined by the history of the target face image when the face in the target face image is not appearing for the first time.

[0249] As another embodiment, the first acquisition module includes: The attribute pre-processing submodule is used to extract attribute information from the initial video, including the resolution of the initial video.

[0250] The size calculation submodule is used to determine the initial size of the initial video based on attribute information and dynamic threshold calculation formula.

[0251] The size determination submodule is used to determine the first border size of the initial video based on the initial size.

[0252] As another embodiment, the size determination submodule is specifically used for: Based on multiple preset resolution levels, the target resolution level corresponding to the initial video resolution is determined, and the multiple resolution levels are associated with size threshold ranges respectively; Based on the size threshold range associated with the target resolution level, adjust the initial size of the initial video to obtain the first border size of the initial video.

[0253] As another embodiment, the graphics generation unit 1303: The feature extraction module is used to extract the facial features corresponding to each face image. The identifier generation module is used to generate a face identifier for a face image when it is determined that the face first appears in the face image based on the face features of the face image. The identifier reading module is used to obtain the face identifier corresponding to the face image when it is determined that the face in the face image is not appearing for the first time based on the face features of the face image. The image generation module is used to generate an image code corresponding to the target face image based on the face features and face identifiers corresponding to the face image.

[0254] As yet another embodiment, the graphics generation module is specifically used for: Based on the facial features and facial identifiers corresponding to the facial image, determine the data to be encoded from the facial image; encrypt the data to be encoded to obtain encrypted data; and generate the graphic code corresponding to the encrypted data according to the preset image encoding algorithm.

[0255] As another embodiment, the graphics generation unit is specifically used to: when the initial video is a real-time video, generate a graphic code corresponding to the target face image according to the processing order corresponding to the multiple face images, based on the computing resources available.

[0256] In the embodiments of this application, Figure 13 The device shown can also be a chip or a chip system, such as a system on chip (SoC) or a baseboard management controller (BMC).

[0257] Figure 14 This is a hardware block diagram of a computing device provided in an embodiment of this application. The computing device 1400 according to an embodiment of this application includes at least a memory 1401 and a processor 1402. The memory 1401 is used to store computer programs. The processor 1402 is used to execute the computer programs to implement the video desensitization method of any of the above embodiments.

[0258] In addition, both memory 1401 and processor 1402 are electrically connected to bus 1403.

[0259] Furthermore, embodiments of this application also provide a computer-readable storage medium for storing a computer program. When executed by a processor, the computer program implements the video desensitization method of any of the preceding embodiments of this application.

[0260] Computer-readable storage media include, but are not limited to, volatile storage media and / or non-volatile storage media. Volatile storage media may include, for example, random access storage media (RAM) and / or cache storage media. Non-volatile storage media may include, for example, read-only storage media (ROM), hard disks, flash memory, optical disks, magnetic disks, etc.

[0261] This application also provides a computer program product, including a computer program / instruction, which, when executed by a processor, implements the video desensitization method of any of the preceding embodiments of this application.

[0262] The basic principles of the embodiments of this application have been described above with reference to specific examples. However, it should be noted that the advantages, benefits, and effects mentioned in the embodiments of this application are merely examples and not limitations, and should not be considered as essential features of each embodiment of this application. Furthermore, the specific details disclosed above are for illustrative and facilitative purposes only, and are not limitations. These details do not limit the embodiments of this application from necessarily employing the aforementioned specific details.

[0263] The block diagrams of devices, apparatuses, devices, and systems involved in the embodiments of this application are merely illustrative examples and are not intended to require or imply that they must be connected, arranged, or configured in the manner shown in the block diagrams. As those skilled in the art will recognize, these devices, apparatuses, devices, and systems can be connected, arranged, and configured in any manner. Words such as “comprising,” “including,” “having,” etc., are open-ended terms meaning “including but not limited to,” and are used interchangeably with them. The terms “or” and “and” as used herein refer to the terms “and / or,” and are used interchangeably with them unless the context explicitly indicates otherwise. The term “such as” as used herein refers to the phrase “such as but not limited to,” and is used interchangeably with it.

[0264] Additionally, as used herein, the "or" used in a list of items beginning with "at least one" indicates a separate list, such that a list of, for example, "at least one of A, B, or C" means A or B or C, or AB or AC or BC, or ABC (i.e., A and B and C). Furthermore, the word "exemplary" does not imply that the described example is preferred or better than other examples.

[0265] It should also be noted that in the systems and methods of this application embodiment, each component or step can be decomposed and / or recombined. These decompositions and / or recombinations should be considered as equivalent solutions of the embodiments of this application.

[0266] Various changes, substitutions, and modifications can be made to the technology herein without departing from the teachings defined by the appended claims. Furthermore, the scope of the claims of the embodiments of this application is not limited to the specific aspects of the processes, machines, manufactures, events, means, methods, and actions described above. Currently existing or later-developed processes, machines, manufactures, events, means, methods, or actions that perform substantially the same function or achieve substantially the same result as the corresponding aspects herein can be utilized. Therefore, the appended claims include such processes, machines, manufactures, events, means, methods, or actions within their scope.

[0267] The above description of the disclosed aspects is provided to enable any person skilled in the art to make or use embodiments of this application. Various modifications to these aspects will be readily apparent to those skilled in the art, and the general principles defined herein can be applied to other aspects without departing from the scope of embodiments of this application. Therefore, embodiments of this application are not intended to be limited to the aspects shown herein, but rather to be accorded the widest scope consistent with the principles and novel features disclosed herein.

[0268] The above description has been given for illustrative and descriptive purposes. Furthermore, this description is not intended to limit the embodiments of this application to the forms disclosed herein. Although numerous exemplary aspects and embodiments have been discussed above, those skilled in the art will recognize certain variations, modifications, alterations, additions, and sub-combinations therein.

Claims

1. A video anonymization method, characterized in that, include: Obtain the initial video that needs to be desensitized, and determine the first image containing a human face from the initial video; When the first image includes multiple face images, the processing order corresponding to the multiple face images is determined according to the attribute information of each of the multiple face images; Based on the available computing resources, and in accordance with the processing order corresponding to the multiple face images, a graphic code corresponding to the target face image is generated. The target face image is a partial or complete face image selected from the first image based on the computing resources available. The target face image in the first image is overlaid with a corresponding graphic code to obtain a second image, and the first image in the initial video is replaced with the second image to obtain the target video.

2. The method according to claim 1, characterized in that, The step of determining the processing order corresponding to each of the plurality of face images based on their respective attribute information includes: The processing order of the multiple face images is determined based on whether they are frontal views and whether they appear for the first time.

3. The method according to claim 2, characterized in that, The step of determining the processing order of the multiple face images based on whether they are frontal or not, and whether they appear for the first time, includes: Based on whether the multiple face images are frontal and whether they appear for the first time, the image group, image category, and face identifier of each face image are determined. The image group includes the first appearance group and the non-first appearance group. The image category includes frontal face images or non-frontal face images. The processing order for each face image is obtained by sorting multiple face images in the first image according to the following priority: first appearance group has higher priority than non-first appearance group; frontal face images have higher priority than non-frontal face images within the same group; and face images within the same category and group are sorted according to the order of face identification.

4. The method according to any one of claims 1-3, characterized in that, The generated graphic code corresponding to the target face image includes: Based on the attribute information of the initial video, the first border size corresponding to the initial video is calculated; the first border size represents the standard size of the face image corresponding to each video frame in the initial video. Obtain the second border size corresponding to the target face image of the first image; If the second border size is smaller than the first border size, the second border size is enlarged to obtain a third border size, and the graphic code corresponding to the target face image is generated according to the third border size. If the second border size is larger than the first border size, a graphic code corresponding to the target face image is generated according to the second border size.

5. The method according to claim 4, characterized in that, The step of enlarging the second border size to obtain a third border size when the second border size is smaller than the first border size includes: When a face first appears in the target face image and the second border size is smaller than the first border size, the second border size is enlarged to obtain a third border size; When the second border size is larger than the first border size, generating the graphic code corresponding to the target face image according to the second border size includes: When a face first appears in the target face image, and the second border size is larger than the first border size, a graphic code corresponding to the target face image is generated according to the second border size. Also includes: If the face in the target face image is not appearing for the first time, a graphic code corresponding to the target face image is generated based on the size of the graphic code determined by the history of the target face image.

6. The method according to claim 4, characterized in that, The step of calculating the first border size corresponding to the initial video based on the attribute information of the initial video includes: Extract the attribute information of the initial video, including the resolution of the initial video; Based on the attribute information and the dynamic threshold calculation formula, the initial size corresponding to the initial video is determined; Based on the initial dimensions, determine the first border size of the initial video.

7. The method according to claim 6, characterized in that, Determining the first border size of the initial video based on the initial size includes: Based on multiple preset resolution levels, a target resolution level corresponding to the resolution of the initial video is determined, and the multiple resolution levels are respectively associated with size threshold ranges; Based on the size threshold range associated with the target resolution level, the initial size of the initial video is adjusted to obtain the first border size of the initial video.

8. The method according to any one of claims 1-7, characterized in that, The step of generating a graphic code corresponding to the target face image according to the processing order corresponding to the multiple face images, based on computing resources, includes: When the initial video is a real-time video, based on the computing resources available, a graphic code corresponding to the target face image is generated according to the processing order corresponding to the multiple face images.

9. A computer program product, characterized in that, include: A computer program that, when executed by a processor, implements the steps of any one of the video desensitization methods of claims 1-8.

10. A computing device, characterized in that, include: A processor and a memory, the memory storing a computer program that is invoked by the processor to execute the video desensitization method according to any one of claims 1-8.