Image anonymization method, image de-anonymization method, apparatus, and electronic device

By dividing and swapping pixel positions during image anonymization and recording the swapping operation information, the problems of time-consuming and ineffective anonymization are solved, and accurate image restoration is achieved.

CN119862601BActive Publication Date: 2026-01-06HANGZHOU EZVIZ SOFTWARE CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202411863741.2
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-12-17
Publication Date
2026-01-06
Estimated Expiration
2044-12-17

AI Technical Summary

Technical Problem

Existing technologies cannot effectively balance the time consumption and effect of anonymization in image anonymization processing, and the anonymized image is difficult to accurately restore.

Method used

By defining a rectangular image region in the original image, it is divided into multiple sub-regions of the same size to be anonymized. Pixels with the same relative positions are swapped, and the swap operation information is recorded to achieve anonymization. Subsequently, deanonymization is performed based on the swap operation information to restore the image.

Benefits of technology

It achieves accurate image restoration while anonymizing, balancing the time consumption and effect of anonymization, and provides a restorable anonymization method.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119862601B_ABST
    Figure CN119862601B_ABST
Patent Text Reader

Abstract

Embodiments of the present application provide an image anonymization method, an image de-anonymization method, an apparatus and an electronic device, and relate to the technical field of image processing. The image anonymization method comprises: determining a rectangular image region to be anonymized in an original image to obtain a region to be anonymized; dividing a region to be divided containing the region to be anonymized according to a rectangular grid with a to-be-utilized size to obtain a plurality of sub-regions to be anonymized with consistent sizes; for each group of sub-regions to be anonymized selected from the sub-regions to be anonymized, exchanging current pixel values at pixel positions with consistent relative positions in two sub-regions to be anonymized in the group to obtain an anonymized image; and recording exchange operation information for de-anonymizing the anonymized image. In this way, while implementing image anonymization processing, it can be ensured that the image after the anonymization processing can be accurately restored subsequently, and the time consumption of the anonymization processing and the effect of the anonymization processing can be effectively balanced.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of image processing technology, and in particular to an image anonymization method, an image deanonymization method, apparatus, and electronic device. Background Technology

[0002] To effectively protect privacy, it is often necessary to anonymize specific objects in images (such as a person's face or a license plate). For example, traditional anonymization methods (such as mosaic or Gaussian blur) can be used, but in this approach, the information of the anonymized image region is completely lost, making restoration impossible. Alternatively, deep learning-based anonymization methods (such as generative adversarial networks and diffusion models) can be used, which can restore the anonymized image region to some extent, but information loss still occurs, and the restored image still differs from the original. Therefore, how to achieve image anonymization while ensuring accurate restoration of the anonymized image is a pressing problem to be solved. Summary of the Invention

[0003] The purpose of this application is to provide an image anonymization method, image deanonymization method, apparatus, and electronic device, so as to ensure accurate subsequent restoration of the anonymized image while performing image anonymization processing, and to effectively balance the time consumption and effect of anonymization processing. The specific technical solution is as follows:

[0004] A first aspect of this application provides an image anonymization method, the method comprising:

[0005] Identify the rectangular image region to be anonymized in the original image to obtain the region to be anonymized;

[0006] The current region to be segmented, containing the region to be anonymized, is divided according to a rectangular grid of the current available size, resulting in multiple anonymized sub-regions of the same size. At least one set of anonymized sub-regions is selected from each of these sub-regions. For each selected set of sub-regions, the current pixel values ​​at the corresponding pixel positions in the two sub-regions within that set are swapped to obtain the anonymized image. Each set of anonymized sub-regions contains two sub-regions. The current available size is positively correlated with the size of the region to be anonymized.

[0007] Record the swap operation information used to deanonymize the anonymized image; wherein, the swap operation information includes: the correspondence between the two sub-regions to be anonymized for which pixel values ​​are swapped.

[0008] Optionally, the current available size is calculated based on the current reference mesh size;

[0009] The process involves dividing the current region to be anonymized into multiple anonymized sub-regions of the same size using a rectangular grid of the current usable size; selecting at least one group of anonymized sub-regions from each of the current anonymized sub-regions; and for each selected group of anonymized sub-regions, swapping the current pixel values ​​at relatively consistent pixel positions in two of the group's anonymized sub-regions to obtain an anonymized image, including:

[0010] According to the rectangular grid of the current size to be utilized, the current region to be divided, which contains the region to be anonymized, is divided to obtain multiple sub-regions to be anonymized with the same size.

[0011] Select at least one set of sub-regions to be anonymized from the current sub-regions to be anonymized; for each set of sub-regions to be anonymized, swap the current pixel values ​​at the pixel positions that are in the same relative position in the two sub-regions to be anonymized in the set to complete this round of anonymization processing;

[0012] Adjust the current reference grid size and return to the step of dividing the current region to be anonymized into multiple anonymized sub-regions of the same size according to the rectangular grid of the current size to be used; until the number of rounds of anonymization processing reaches a first number, an anonymized image is obtained; the exchange operation information also includes the region to be anonymized involved in each round of anonymization processing, and the order between the rounds of anonymization processing.

[0013] Optionally, the step of selecting at least one group of sub-regions to be anonymized from the current sub-regions to be anonymized; and for each currently selected group of sub-regions to be anonymized, swapping the current pixel values ​​at pixel positions with corresponding relative positions in two sub-regions to be anonymized within that group, includes:

[0014] Select at least one set of sub-regions to be anonymized from the current sub-regions to be anonymized;

[0015] For each selected sub-region to be anonymized, the current pixel values ​​at the corresponding pixel positions in the two sub-regions to be anonymized in the group are swapped to complete the current pixel value swap; and the process returns to the step of selecting at least one sub-region to be anonymized from the current sub-regions to be anonymized, until the number of pixel value swaps reaches the second number.

[0016] For each round of anonymization, the exchange operation information also includes the sub-regions to be anonymized involved in each pixel value exchange during that round of anonymization, as well as the order of each pixel value exchange during that round of anonymization.

[0017] Optionally, the current available size is the product of the available size factor and the current reference grid size; the available size factor is the ratio of the smaller of the width and height of the region to be anonymized to the number of reference grids.

[0018] Optionally, determining the rectangular image region to be anonymized in the original image to obtain the region to be anonymized includes:

[0019] The object to be anonymized in the original image is detected, and the rectangular image region where the object to be anonymized is located is obtained as the region to be processed;

[0020] If there are parts in the region to be processed that do not belong to the original image, the parts of the region to be processed that belong to the original image are identified as the region to be anonymized.

[0021] Optionally, if the width of the region to be anonymized is divisible by the width of the rectangular grid of the current size to be utilized, and the height of the region to be anonymized is divisible by the height of the rectangular grid of the current size to be utilized, then the current region to be divided is the region to be anonymized.

[0022] If the width of the region to be anonymized cannot be divided evenly by the width of the rectangular grid of the current size to be utilized, the current region to be divided is obtained by expanding the region to be anonymized in the direction of the width of the region to be anonymized according to the remainder of the width of the region to be anonymized divided by the width of the rectangular grid of the current size to be utilized.

[0023] If the height of the region to be anonymized cannot be divided evenly by the height of the rectangular grid of the current size to be utilized, the current region to be divided is obtained by expanding the region to be anonymized in the direction of the height of the region to be anonymized according to the remainder when the height of the region to be anonymized is divided by the height of the rectangular grid of the current size to be utilized.

[0024] A second aspect of this application also provides an image deanonymization method, the method comprising:

[0025] Obtain an anonymized image and corresponding exchange operation information; wherein, the anonymized image and corresponding exchange operation information are obtained by anonymizing the original image based on any of the methods described in the first aspect above;

[0026] The pixel values ​​at the corresponding pixel positions in the sub-regions to be anonymized, which are recorded in the exchange operation information, are swapped to deanonymize the anonymized image and obtain the original image.

[0027] Optionally, the anonymized image is obtained by performing multiple rounds of anonymization processing on the original image; the exchange operation information further includes: the sub-regions to be anonymized involved in each round of anonymization processing, and the order between each round of anonymization processing;

[0028] The process involves swapping the current pixel values ​​at relatively consistent pixel positions within the anonymized sub-regions recorded in the swap operation information to deanonymize the anonymized image and obtain the original image, including:

[0029] Following the reverse order of the anonymization processes recorded in the exchange operation information, the pixel values ​​at the corresponding pixel positions in the sub-regions to be anonymized, which are involved in each round of anonymization processes recorded in the exchange operation information, are exchanged sequentially to perform multiple rounds of deanonymization processing on the anonymized image, thereby obtaining the original image.

[0030] Optionally, each round of anonymization processing includes multiple pixel value swaps; for each round of anonymization processing, the swap operation information also includes the sub-regions to be anonymized involved in each pixel value swap during that round of anonymization processing, and the order between each pixel value swap during that round of anonymization processing;

[0031] Each round of deanonymization includes:

[0032] According to the reverse order of the pixel value exchanges in the anonymization process corresponding to the round of deanonymization recorded in the exchange operation information, the current pixel values ​​at the corresponding pixel positions in the sub-regions to be anonymized that are in the same relative position are exchanged in turn.

[0033] Optionally, the anonymized image is obtained by performing one round of anonymization processing on the original image, and this round of anonymization processing includes multiple pixel value swaps; the swap operation information also includes the sub-regions to be anonymized involved in each pixel value swap during this round of anonymization processing, and the order between each pixel value swap during this round of anonymization processing;

[0034] The process involves swapping the current pixel values ​​at relatively consistent pixel positions within the anonymized sub-regions recorded in the swap operation information to deanonymize the anonymized image and obtain the original image, including:

[0035] Following the reverse order of the pixel value exchanges recorded in the exchange operation information, the current pixel values ​​at the corresponding pixel positions in the sub-regions to be anonymized are exchanged sequentially to deanonymize the anonymized image and obtain the original image.

[0036] A third aspect of this application also provides an image anonymization apparatus, the apparatus comprising:

[0037] The region determination module is used to determine the rectangular image region to be anonymized in the original image, thereby obtaining the region to be anonymized;

[0038] An anonymization processing module is used to divide the current region to be anonymized into multiple sub-regions of the same size according to a rectangular grid of the current available size; select at least one group of sub-regions to be anonymized from the current sub-regions to be anonymized; for each selected group of sub-regions to be anonymized, swap the current pixel values ​​at the pixel positions that are relatively consistent between the two sub-regions to be anonymized in the group to obtain an anonymized image; wherein, a group of sub-regions to be anonymized contains two sub-regions to be anonymized; the current available size is positively correlated with the size of the region to be anonymized;

[0039] The information recording module is used to record the exchange operation information for deanonymizing the anonymized image; wherein, the exchange operation information includes: the correspondence between the two sub-regions to be anonymized for which pixel values ​​are exchanged.

[0040] Optionally, the current available size is calculated based on the current reference mesh size;

[0041] The anonymization processing module includes:

[0042] The region partitioning submodule is used to partition the current region to be anonymized, which contains the region to be anonymized, according to the rectangular grid of the current size to be utilized, to obtain multiple sub-regions to be anonymized with the same size;

[0043] The anonymization processing submodule is used to select at least one group of sub-regions to be anonymized from the current sub-regions to be anonymized; for each group of sub-regions to be anonymized, the current pixel values ​​at the pixel positions that are in the same relative position in the two sub-regions to be anonymized in the group are swapped to complete the current round of anonymization processing;

[0044] The size adjustment module is used to adjust the size of the current reference grid and trigger the region partitioning submodule; until the number of rounds of anonymization processing reaches a first number, an anonymized image is obtained; the exchange operation information also includes the region to be anonymized involved in each round of anonymization processing, and the order between each round of anonymization processing.

[0045] Optionally, the anonymization processing submodule is specifically configured to select at least one group of sub-regions to be anonymized from the current sub-regions to be anonymized; for each selected group of sub-regions to be anonymized, swap the current pixel values ​​at the pixel positions that are in the same relative position in the two sub-regions to be anonymized in the group to complete the current pixel value swap; and return to execute the step of selecting at least one group of sub-regions to be anonymized from the current sub-regions to be anonymized, until the number of pixel value swaps reaches a second number; for each round of anonymization processing, the swap operation information also includes the sub-regions to be anonymized involved in each pixel value swap in the round of anonymization processing, and the order between each pixel value swap in the round of anonymization processing.

[0046] Optionally, the current available size is the product of the available size factor and the current reference grid size; the available size factor is the ratio of the smaller of the width and height of the region to be anonymized to the number of reference grids.

[0047] Optionally, the region determination module is specifically used to detect the object to be anonymized in the original image and obtain the rectangular image region where the object to be anonymized is located, as the region to be processed; if there is a part in the region to be processed that does not belong to the original image, the part of the region to be processed that belongs to the original image is determined as the region to be anonymized.

[0048] Optionally, if the width of the region to be anonymized is divisible by the width of the rectangular grid of the current size to be utilized, and the height of the region to be anonymized is divisible by the height of the rectangular grid of the current size to be utilized, then the current region to be divided is the region to be anonymized.

[0049] If the width of the region to be anonymized cannot be divided evenly by the width of the rectangular grid of the current size to be utilized, the current region to be divided is obtained by expanding the region to be anonymized in the direction of the width of the region to be anonymized according to the remainder of the width of the region to be anonymized divided by the width of the rectangular grid of the current size to be utilized.

[0050] If the height of the region to be anonymized cannot be divided evenly by the height of the rectangular grid of the current size to be utilized, the current region to be divided is obtained by expanding the region to be anonymized in the direction of the height of the region to be anonymized according to the remainder when the height of the region to be anonymized is divided by the height of the rectangular grid of the current size to be utilized.

[0051] A fourth aspect of this application also provides an image deanonymization apparatus, the apparatus comprising:

[0052] The data acquisition module is used to acquire an anonymized image and corresponding exchange operation information; wherein, the anonymized image and corresponding exchange operation information are obtained by anonymizing the original image based on any of the methods described in the first aspect above;

[0053] The deanonymization processing module is used to exchange the current pixel values ​​at the corresponding pixel positions in the sub-regions to be anonymized that are recorded in the exchange operation information, so as to deanonymize the anonymized image and obtain the original image.

[0054] Optionally, the anonymized image is obtained by performing multiple rounds of anonymization processing on the original image; the exchange operation information further includes: the sub-regions to be anonymized involved in each round of anonymization processing, and the order between each round of anonymization processing;

[0055] The deanonymization processing module is specifically used to exchange the current pixel values ​​of the corresponding pixel positions in the sub-regions to be anonymized that are in the same relative position and have a corresponding relationship in each round of anonymization processing recorded in the exchange operation information, in order of reverse order between the various rounds of anonymization processing recorded in the exchange operation information, so as to perform multiple rounds of deanonymization processing on the anonymized image to obtain the original image.

[0056] Optionally, each round of anonymization processing includes multiple pixel value swaps; for each round of anonymization processing, the swap operation information also includes the sub-regions to be anonymized involved in each pixel value swap during that round of anonymization processing, and the order between each pixel value swap during that round of anonymization processing;

[0057] Each round of deanonymization includes:

[0058] According to the reverse order of the pixel value exchanges in the anonymization process corresponding to the round of deanonymization recorded in the exchange operation information, the current pixel values ​​at the corresponding pixel positions in the sub-regions to be anonymized that are in the same relative position are exchanged in turn.

[0059] Optionally, the anonymized image is obtained by performing one round of anonymization processing on the original image, and this round of anonymization processing includes multiple pixel value swaps; the swap operation information also includes the sub-regions to be anonymized involved in each pixel value swap during this round of anonymization processing, and the order between each pixel value swap during this round of anonymization processing;

[0060] The deanonymization processing module is specifically used to exchange the current pixel values ​​at the corresponding pixel positions in the sub-regions to be anonymized, which are in the reverse order of the pixel value exchanges recorded in the exchange operation information, in order to deanonymize the anonymized image and obtain the original image.

[0061] In another aspect of the embodiments of this application, an electronic device is also provided, comprising:

[0062] Memory, used to store computer programs;

[0063] When a processor executes a program stored in memory, it implements either the method described in the first aspect or the method described in the second aspect.

[0064] In another aspect of the embodiments of this application, a computer-readable storage medium is provided, wherein a computer program is stored therein, and when the computer program is executed by a processor, it implements any of the methods described in the first aspect or any of the methods described in the second aspect.

[0065] This application also provides a computer program product containing instructions that, when run on a computer, cause the computer to perform any of the methods described in the first aspect or any of the methods described in the second aspect.

[0066] Beneficial effects of the embodiments in this application:

[0067] This application provides an image anonymization method that determines a rectangular image region to be anonymized in the original image, obtaining the region to be anonymized; divides the current region to be anonymized according to a rectangular grid of the current available size, obtaining multiple sub-regions of the same size; selects at least one group of sub-regions to be anonymized from each of the current sub-regions; for each selected group of sub-regions, swaps the current pixel values ​​at the corresponding pixel positions in two sub-regions of the group, obtaining an anonymized image; wherein, a group of sub-regions to be anonymized contains two sub-regions; the current available size is positively correlated with the size of the region to be anonymized; and records the swap operation information used for deanonymizing the anonymized image; wherein the swap operation information includes the correspondence between the two sub-regions to be anonymized that have their pixel values ​​swapped.

[0068] Based on the above processing, the rectangular image regions in the original image that need to be anonymized can be identified, resulting in regions to be anonymized. The usable size can be calculated based on the dimensions of these regions, and the region containing the anonymized areas can be divided into multiple sub-regions based on a rectangular grid of this usable size. Pixel values ​​can be swapped between each selected sub-region to scramble the positions of the pixels, making the image information within the anonymized areas unrecognizable. This achieves anonymization of the image, resulting in an anonymized image. Furthermore, the correspondence between the two anonymized sub-regions that underwent pixel value swapping (i.e., swap operation information) can be recorded. Subsequently, the positions of the pixel values ​​in the anonymized image can be restored based on the recorded swap operation information, achieving deanonymization of the anonymized image and obtaining the original image.

[0069] Since swapping pixel values ​​in the sub-region to be anonymized only changes the position of pixel values ​​within that region and does not result in pixel value loss, no image information loss occurs. Therefore, restoring the pixel positions in the anonymized image based on the recorded swap operation information allows for lossless restoration of the anonymized image. Furthermore, the size of the sub-region to be anonymized is positively correlated with the size of the region to be anonymized, and correspondingly, the size of the sub-region to be anonymized is also positively correlated with the size of the region to be anonymized. That is, the size of the sub-region to be anonymized can be adaptively adjusted according to the size of the region to be anonymized. This avoids situations where the sub-region is too small when the region to be anonymized is large, leading to increased anonymization processing time, and conversely, avoids situations where the sub-region is too large when the region to be anonymized is small, resulting in poor anonymization performance. Thus, while performing image anonymization, it ensures accurate subsequent restoration of the anonymized image and effectively balances the processing time and effectiveness of anonymization.

[0070] Of course, implementing any product or method of this application does not necessarily require achieving all of the advantages described above at the same time. Attached Figure Description

[0071] To more clearly illustrate the technical solutions in the embodiments of this application or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of this application. For those skilled in the art, other embodiments can be obtained based on these drawings.

[0072] Figure 1 This is a schematic diagram of a first flowchart of an image anonymization method provided in an embodiment of this application;

[0073] Figure 2 This is a schematic diagram of a second process for the image anonymization method provided in the embodiments of this application;

[0074] Figure 3 This is a schematic diagram of a third process for the image anonymization method provided in the embodiments of this application;

[0075] Figure 4 This is a schematic diagram of the fourth process of the image anonymization method provided in the embodiments of this application;

[0076] Figure 5 This is a schematic diagram of the first process of the image deanonymization method provided in the embodiments of this application;

[0077] Figure 6 This is a schematic diagram of a second process for the image deanonymization method provided in the embodiments of this application;

[0078] Figure 7 This is a schematic diagram of the structure of an image anonymization device provided in an embodiment of this application;

[0079] Figure 8 This is a schematic diagram of the structure of an image deanonymization device provided in an embodiment of this application;

[0080] Figure 9 This is a schematic diagram of the structure of an electronic device provided in an embodiment of this application. Detailed Implementation

[0081] The technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, and not all embodiments. Based on the embodiments of this application, all other embodiments obtained by those skilled in the art based on this application are within the scope of protection of this application.

[0082] To effectively protect privacy, it is often necessary to anonymize specific objects in an image (such as a person's face or a license plate). For example, traditional anonymization methods (such as mosaic or Gaussian blur) can be used, but in this approach, the information of the anonymized image region is completely lost and cannot be restored. Alternatively, deep learning-based anonymization methods (such as generative adversarial networks and diffusion models) can be used. In this approach, the anonymized image region can be restored to some extent, but information loss still occurs, and the restored image still differs from the original image.

[0083] To ensure accurate subsequent restoration of the anonymized image while performing image anonymization processing, this application provides an image anonymization method, see [link to relevant documentation]. Figure 1 , Figure 1 This is a schematic diagram of a first flowchart of an image anonymization method provided in this application embodiment. The image anonymization method provided in this application embodiment is applicable to all algorithms that require anonymization of a specified object in an image as a prerequisite. The image anonymization method provided in this application embodiment can be applied to smart lock terminals or IPC (Internet Protocol Camera) terminals to anonymize images containing specified objects (e.g., a person's face). The image anonymization method may include:

[0084] Step S101: Determine the rectangular image region to be anonymized in the original image to obtain the region to be anonymized.

[0085] Step S102: Divide the current region to be anonymized into multiple sub-regions of the same size according to the rectangular grid of the current size to be utilized; select at least one group of sub-regions to be anonymized from each of the current sub-regions to be anonymized; for each group of sub-regions to be anonymized, swap the current pixel values ​​at the pixel positions of the two sub-regions to be anonymized in the group that are in the same relative position to obtain the anonymized image.

[0086] One set of sub-regions to be anonymized contains two sub-regions to be anonymized; the current size to be utilized is positively correlated with the size of the sub-regions to be anonymized.

[0087] Step S103: Record the exchange operation information used to deanonymize the anonymized image.

[0088] The exchange operation information includes the correspondence between the two sub-regions to be anonymized for which pixel values ​​are exchanged.

[0089] Based on the above processing, the rectangular image regions in the original image that need to be anonymized can be identified, resulting in regions to be anonymized. The usable size can be calculated based on the dimensions of these regions, and the region containing the anonymized areas can be divided into multiple sub-regions based on a rectangular grid of this usable size. Pixel values ​​can be swapped between each selected sub-region to scramble the positions of the pixels, making the image information within the anonymized areas unrecognizable. This achieves anonymization of the image, resulting in an anonymized image. Furthermore, the correspondence between the two anonymized sub-regions that underwent pixel value swapping (i.e., swap operation information) can be recorded. Subsequently, the positions of the pixel values ​​in the anonymized image can be restored based on the recorded swap operation information, achieving deanonymization of the anonymized image and obtaining the original image.

[0090] Since swapping pixel values ​​in the sub-region to be anonymized only changes the position of pixel values ​​within that region and does not result in pixel value loss, no image information loss occurs. Therefore, restoring the pixel positions in the anonymized image based on the recorded swap operation information allows for lossless restoration of the anonymized image. Furthermore, the size of the sub-region to be anonymized is positively correlated with the size of the region to be anonymized, and correspondingly, the size of the sub-region to be anonymized is also positively correlated with the size of the region to be anonymized. That is, the size of the sub-region to be anonymized can be adaptively adjusted according to the size of the region to be anonymized. This avoids situations where the sub-region is too small when the region to be anonymized is large, leading to increased anonymization processing time, and conversely, avoids situations where the sub-region is too large when the region to be anonymized is small, resulting in poor anonymization performance. Thus, while performing image anonymization, it ensures accurate subsequent restoration of the anonymized image and effectively balances the processing time and effectiveness of anonymization.

[0091] As can be seen, the embodiments of this application provide a recoverable image anonymization method that can meet real-time requirements and consumes low resources, and has high feasibility for implementation.

[0092] For step S101, the original image can be the image that needs to be anonymized. For example, the original image can contain a specified object that needs to be anonymized (also called the object to be anonymized), such as a person's face or a license plate. The type of the original image can be set as needed and is not specifically limited. For example, the original image can be an RGB (Red, Green, Blue) image or a NIR (Near Infrared) image. A rectangular image region in the original image to be anonymized can be determined, for example, the rectangular image region where the specified object is located. Then, based on the determined rectangular image region, the region to be anonymized can be obtained.

[0093] In one embodiment, see Figure 2 , Figure 2 This is a schematic diagram of a second flowchart of the image anonymization method provided in an embodiment of this application. Step S101 includes:

[0094] Step S1011: Detect the object to be anonymized in the original image to obtain the rectangular image region where the object to be anonymized is located, which is taken as the region to be processed.

[0095] Step S1012: If there are parts in the region to be processed that do not belong to the original image, the parts in the region to be processed that belong to the original image are identified as the region to be anonymized.

[0096] In this embodiment, the object to be anonymized in the original image can be detected to determine the ROI (Region of Interest) in the original image, which is the rectangular image region where the object to be anonymized is located (i.e., the region to be processed). For example, a target detection algorithm for the object to be anonymized can be used to detect the target in the original image to obtain the coordinate information of the region to be processed. For example, the coordinate information may include the pixel coordinates of the top-left vertex and the bottom-right vertex of the region to be processed. The target detection algorithm can be R-CNN (Region-based Convolutional Neural Networks) or YOLO (an object detection algorithm). For example, if the original image contains a human face, the coordinate information of the rectangular image region where the human face is located can be obtained by using a target detection algorithm for the human face, thus obtaining the human face ROI, i.e., the region to be processed.

[0097] Because the objects to be anonymized in the original image may be incomplete, while the detection process predicts the rectangular image region containing the complete objects to be anonymized as the processing region, the resulting processing region may extend beyond the original image. For example, the pixel coordinates of the detected vertices of the processing region may have negative values ​​or be greater than the image resolution. That is, the processing region contains parts that do not belong to the original image. Since only the objects to be anonymized in the original image need to be anonymized, only the portion of the processing region that belongs to the original image can be identified as the anonymized region. When the processing region consists entirely of elements within the original image, the anonymized region is the processing region.

[0098] In one implementation, the pixel coordinates of the vertices of the region to be processed can be processed to obtain the pixel coordinates of the vertices of the region to be anonymized. For example, the pixel coordinates of the top-left vertex of the region to be processed are... The pixel coordinates of the bottom right corner vertex are The effective values ​​can be processed using the following formula to obtain the pixel coordinates of the top-left vertex of the region to be anonymized. and the pixel coordinates of the bottom right corner vertex :

[0099]

[0100]

[0101]

[0102]

[0103] in, Indicates the width of the original image. This indicates the height of the original image.

[0104] Based on the above processing, it can be guaranteed that the region to be anonymized belongs to the original image, that is, the validity of the region to be anonymized can be guaranteed. Correspondingly, the validity of subsequent anonymization processing based on the region to be anonymized can be guaranteed. In this way, it is further guaranteed that while achieving image anonymization processing, the subsequent accurate restoration of the anonymized image can also be guaranteed.

[0105] For steps S102 and S103, the usable size can be calculated based on the size of the region to be anonymized, and the usable size can be positively correlated with the size of the region to be anonymized. Thus, the size of the resulting sub-regions to be anonymized can be adaptively adjusted according to the size of the region to be anonymized. This avoids situations where the sub-regions to be anonymized are too small when the region to be anonymized is large, leading to increased anonymization processing time, and conversely, avoids situations where the sub-regions to be anonymized are too large when the region to be anonymized is small, leading to poor anonymization results. It effectively balances the time consumption and the effect of anonymization processing. In other words, while achieving effective image anonymization processing, it can reduce the time consumption of anonymization processing and improve the efficiency of anonymization processing.

[0106] For example, the size to be utilized can include the width and height to be utilized. The width to be utilized can be calculated based on the width of the region to be anonymized, and the width to be utilized is positively correlated with the width of the region to be anonymized. Similarly, the height to be utilized can be calculated based on the height of the region to be anonymized, and the height to be utilized can be positively correlated with the height of the region to be anonymized. For instance, the ratio of the width of the region to be anonymized to the number of reference grids can be calculated, and the product of this ratio and the width of the reference grids can be calculated to obtain the width to be utilized. The ratio of the height of the region to be anonymized to the number of reference grids can be calculated, and the product of this ratio and the height of the reference grids can be calculated to obtain the height to be utilized. The number of reference grids, as well as the height and width of the reference grids, can be set as needed. For example, the number of reference grids can be 16 or 25, the height of the reference grids can be 4 or 6, and the width of the reference grids can be 4 or 5.

[0107] The rectangular grid used for partitioning can also be a square grid, in which case the width and height to be utilized are equal. In this case, the usable size can be calculated based on either the width or height of the region to be anonymized, or it can be calculated based on the smaller of the width and height. For example, the ratio of the smaller of the width and height of the region to be anonymized to the number of reference grids can be calculated, and the product of this ratio and the size of the reference grid can be calculated to obtain the usable size. That is, the usable size can be calculated using the following formula:

[0108]

[0109] in, Indicates the dimensions to be utilized. Indicates the reference grid size. Indicates the number of reference grids. Indicates the width of the region to be anonymized. This indicates the high level of the region to be anonymized. and It can be calculated using the following formula:

[0110]

[0111]

[0112] in, Represents the pixel coordinates of the top-left vertex of the region to be anonymized; This represents the pixel coordinates of the bottom right corner vertex of the region to be anonymized.

[0113] After calculating the size to be utilized, the region to be anonymized can be divided according to the rectangular grid of the size to be utilized, resulting in multiple anonymized sub-regions of the same size.

[0114] In one embodiment, the current region to be anonymized is defined as such if the width of the region to be anonymized is divisible by the width of the rectangular grid of the current size to be utilized, and the height of the region to be anonymized is divisible by the height of the rectangular grid of the current size to be utilized.

[0115] If the width of the region to be anonymized is not divisible by the width of the rectangular grid of the current size to be utilized, the current region to be divided is obtained by expanding the region to be anonymized in the direction of the width of the region to be anonymized, based on the remainder when the width of the region to be anonymized is divided by the width of the rectangular grid of the current size to be utilized.

[0116] If the height of the region to be anonymized is not divisible by the height of the rectangular grid of the current size to be utilized, the current region to be divided is obtained by expanding the region to be anonymized in the direction of the height of the region to be anonymized, based on the remainder when the height of the region to be anonymized is divided by the height of the rectangular grid of the current size to be utilized.

[0117] In this embodiment of the application, in order to ensure that multiple anonymized sub-regions of the same size can be obtained by dividing the rectangular grid of the size to be utilized, after calculating the size to be utilized, it can be determined whether the width of the anonymized region can be divided by the width of the rectangular grid of the size to be utilized (i.e., the width to be utilized), and whether the height of the anonymized region can be divided by the height of the rectangular grid of the size to be utilized (i.e., the height to be utilized).

[0118] If the width of the region to be anonymized is divisible by the width to be utilized and the height of the region to be anonymized is divisible by the height to be utilized, it means that the rectangular grid of the size to be utilized can uniformly divide the region to be anonymized. In this case, the region to be anonymized can be used as the region to be divided.

[0119] If the width of the region to be anonymized is not divisible by the width to be utilized, it means that the region cannot be evenly divided along the direction of its width. In this case, the region to be anonymized can be expanded along the direction of its width, based on the remainder when the width is divided by the width to be utilized, so that the width of the expanded region is divisible by the width to be utilized. The specific expansion method is not limited, as long as it ensures that the width of the expanded region is divisible by the width to be utilized. For example, the region to be anonymized can be expanded to the left and / or right within the original image.

[0120] If the height of the region to be anonymized is not divisible by the height to be utilized, it means that the region to be anonymized cannot be evenly divided along the direction of its height. In this case, the region to be anonymized can be expanded along the direction of its height by using the remainder after dividing by the height to be utilized, so that the height of the expanded region is divisible by the height to be utilized. The specific expansion method is not limited, as long as it ensures that the height of the expanded region is divisible by the height to be utilized. For example, the region to be anonymized can be expanded upwards and / or downwards within the original image.

[0121] In this way, the region to be divided can be guaranteed to meet the following requirements:

[0122]

[0123]

[0124] in, Indicates the width of the region to be divided. Indicates the height of the region to be divided. Indicates the dimensions to be utilized. This indicates the remainder after calculation.

[0125] Based on the above processing, the region to be anonymized can be adaptively expanded to obtain the region to be divided, ensuring that multiple sub-regions of the same size can be obtained by dividing the region according to the rectangular grid of the size to be utilized. In this way, it can be further ensured that while performing image anonymization processing, the image can be accurately restored after anonymization processing.

[0126] After obtaining the sub-regions to be anonymized, at least one group of sub-regions can be selected from each group. The number of selected groups can be set as needed and is not specifically limited. Pixel values ​​are swapped in each selected group to shuffle the positions of the pixels, making the image information within the group unrecognizable. This achieves anonymization of the image, resulting in an anonymized image. Pixel value swapping can also be called shuffling, meaning anonymization can be achieved according to a preset shuffle method (also known as a password). For example, for each group of sub-regions to be anonymized, the shuffle process can be performed using the following formula:

[0127]

[0128] in, This represents the storage space used to temporarily store the latest pixel values ​​at each pixel location in a sub-region to be anonymized within this group; This represents the latest pixel value at each pixel position in a sub-region to be anonymized within the group; This represents the latest pixel value at each pixel location in another sub-region to be anonymized within the group.

[0129] Furthermore, the correspondence between the two anonymized sub-regions whose pixel values ​​are swapped can be recorded (i.e., swap operation information). Subsequently, for authorized users (who can be called authorized users), the positions of pixel values ​​in the anonymized image can be restored based on the recorded swap operation information, thereby deanonymizing the anonymized image and obtaining the original image. That is, the anonymized image can be shuffled in reverse order according to a preset shuffle method to obtain the original image. For example, the latest pixel values ​​at the corresponding pixel positions in the anonymized sub-regions recorded in the swap operation information can be swapped to deanonymize the anonymized image and obtain the original image.

[0130] In one embodiment, the exchange operation information can be stored in a different storage space than the anonymized image. This reduces the risk of the anonymized image being stolen and restored, lowers the risk of the anonymized image information being cracked, and effectively protects privacy.

[0131] In this application, the number of rounds of anonymization processing and the number of pixel value swaps in each round can be set. That is, multiple shuffle processes can be performed to achieve multiple layers of encryption, thereby improving the security of privacy information in the original image. Since a higher number of rounds and more pixel value swaps in each round results in better anonymization, but also increases processing time, the number of rounds and the number of pixel value swaps in each round can be determined by considering both processing time and effectiveness to obtain an anonymized image. Specifically, pixel value swaps can be performed in the following ways.

[0132] In Method 1, multiple rounds of anonymization can be performed, each round of anonymization may include one or more pixel value swaps. See one embodiment. Figure 3 , Figure 3 This is a schematic diagram of a third process for an image anonymization method provided in an embodiment of this application. The current size to be utilized is calculated based on the current reference mesh size. Step S102 includes:

[0133] Step S1021: Divide the current region to be anonymized into multiple sub-regions of the same size according to the rectangular grid of the current size to be utilized.

[0134] Step S1022: Select at least one group of sub-regions to be anonymized from the current sub-regions to be anonymized; for each group of sub-regions to be anonymized, swap the current pixel values ​​at the pixel positions that are in the same relative position in the two sub-regions to be anonymized in the group to complete this round of anonymization processing.

[0135] Step S1023: Adjust the current reference mesh size and return to step S1021; until the number of rounds of anonymization processing reaches the first number, an anonymized image is obtained.

[0136] The exchange operation information also includes the regions to be anonymized involved in each round of anonymization, as well as the order between the rounds of anonymization.

[0137] In this embodiment, the latest available size can be calculated based on the latest reference grid size and the size of the region to be anonymized. The latest region to be divided, containing the region to be anonymized, is then divided according to a rectangular grid of the latest available size, resulting in multiple anonymized sub-regions of the same size. After dividing into multiple anonymized sub-regions, at least one group of anonymized sub-regions can be selected from the latest divided sub-regions. For each newly selected group of anonymized sub-regions, the latest pixel values ​​at the corresponding pixel positions in two sub-regions within that group are swapped to complete this round of anonymization processing.

[0138] After completing one round of anonymization, the size of the reference grid can be adjusted to calculate a new usable size. For example, a set of grid sizes containing multiple reference grid sizes can be pre-set. Each time the reference grid size is adjusted, an unselected reference grid size can be chosen from the set as the new reference grid size. Based on the rectangular grid of the latest usable size, the latest region to be divided, containing the area to be anonymized, is divided into multiple newly divided sub-regions of the same size. At least one set of sub-regions to be anonymized can be selected from each of the newly divided sub-regions. For each newly selected set of sub-regions, the latest pixel values ​​at the corresponding pixel positions in the two sub-regions within that set are swapped to complete a new round of anonymization. This process is repeated until the first number of rounds of anonymization is reached.

[0139] A first number can be set, taking into account both the time consumption and the effect of anonymization, without specific limitations. The number of sub-regions to be anonymized selected in each round of anonymization can be the same or different. Correspondingly, the exchanged operation information can also include the regions to be anonymized involved in each round of anonymization, as well as the order of the rounds of anonymization.

[0140] Based on the above processing, the original image can be anonymized through multiple rounds of anonymization. The size of the sub-region to be anonymized, in which pixel values ​​are swapped, is different in different rounds of anonymization. This can further ensure that the position of pixel values ​​in the region to be anonymized is effectively disrupted, so that the image information in the region to be anonymized cannot be identified. In other words, the effect of anonymization can be further guaranteed.

[0141] In one implementation, each round of anonymization may involve multiple pixel value swaps. Step S1022 includes:

[0142] Step 1: Select at least one set of sub-regions to be anonymized from the current sub-regions to be anonymized.

[0143] Step 2: For each selected sub-region to be anonymized, swap the current pixel values ​​at the corresponding pixel positions in the two sub-regions to be anonymized within the group to complete the pixel value swap; then return to Step 1 until the number of pixel value swaps reaches the second number.

[0144] For each round of anonymization, the exchange operation information also includes the sub-regions to be anonymized involved in each pixel value exchange during that round of anonymization, as well as the order of each pixel value exchange during that round of anonymization.

[0145] In this implementation, for each pixel value swap, at least one set of sub-regions to be anonymized can be selected from the most recently divided sub-regions to be anonymized. The selected sub-regions can be one or more sets. For each selected set of sub-regions, the latest pixel values ​​at the corresponding pixel positions in the two sub-regions within that set are swapped to complete the current pixel value swap. After completing one pixel value swap, at least one new set of sub-regions can be selected, and the latest pixel values ​​at the corresponding pixel positions in the two sub-regions within each selected set are swapped to complete a new pixel value swap. This process continues until the number of pixel value swaps reaches a second number. A first number can be set, taking into account both the time consumption and the effect of anonymization processing, without specific limitations. The number of sets of sub-regions to be anonymized selected for each pixel value swap can be the same or different. The sub-regions involved in each pixel value swap can be the same or all different.

[0146] Accordingly, the exchange operation information includes the correspondence between the two sub-regions to be anonymized for pixel value exchange. For each round of anonymization, the exchange operation information also includes the sub-regions to be anonymized involved in each pixel value exchange during that round of anonymization, as well as the order of each pixel value exchange during that round of anonymization.

[0147] In this way, each round of anonymization can involve multiple pixel value swaps, which can further ensure that the positions of pixel values ​​in the area to be anonymized are effectively disrupted, making the image information in the area to be anonymized unrecognizable, thus further ensuring the effectiveness of the anonymization process.

[0148] In another implementation, each round of anonymization may consist of only one pixel value swap. For details regarding this pixel value swap, please refer to the description of each pixel value swap in the above implementation. Accordingly, the swap operation information includes: the correspondence between the two sub-regions to be anonymized during the pixel value swap, the sub-regions to be anonymized involved in each round of anonymization, and the order of the rounds of anonymization.

[0149] In one embodiment, the current available size is the product of the available size factor and the current reference grid size; the available size factor is the ratio of the smaller of the width and height of the region to be anonymized to the number of reference grids.

[0150] In this embodiment, the ratio of the smaller of the width and height of the region to be anonymized to the number of reference grid cells can be calculated to obtain the utilization coefficient. For example, the utilization coefficient can be expressed as:

[0151]

[0152] in, Indicates the number of reference grids. Indicates the width of the region to be anonymized. This indicates the high level of the region to be anonymized.

[0153] The latest usable size can be obtained by multiplying the utilization factor and the latest reference grid size. Correspondingly, the newly sized sub-regions to be anonymized can be divided based on the rectangular grid of the latest usable size. Thus, the sizes of the sub-regions to be anonymized, where pixel values ​​are swapped, differ in different rounds of anonymization processing. This further ensures that the positions of pixel values ​​within the anonymized region are effectively scrambled, making the image information within the anonymized region unrecognizable, thereby further guaranteeing the effectiveness of the anonymization process.

[0154] In Method 2, only one round of anonymization processing can be performed, which may include one or more pixel value swaps. For details of each pixel value swap, please refer to the description of a single pixel value swap in steps 1-2 of the above embodiments. When a round of anonymization processing includes only one pixel value swap, the swap operation information includes the correspondence between the two sub-regions to be anonymized during the pixel value swap. When a round of anonymization processing includes multiple pixel value swaps, the swap operation information includes: the correspondence between the two sub-regions to be anonymized during the pixel value swap, the sub-regions to be anonymized involved in each pixel value swap, and the order of the pixel value swaps.

[0155] In one embodiment, see Figure 4 , Figure 4This is a schematic diagram of a fourth process for an image anonymization method provided in an embodiment of this application. The image anonymization method may include:

[0156] Step S401: Begin.

[0157] Step S402: Is a target detected? If a target is detected, proceed to step S403; if no target is detected, proceed to step S405. That is, perform object detection on the original image to determine whether an object to be anonymized exists. If an anonymized object exists, the rectangular image region where the object to be anonymized is located (i.e., the region to be processed) can be obtained. This part can be called target region detection.

[0158] Step S403: Adaptive expansion and block division based on the target ROI region. That is, step S1012 in the above embodiment, adaptive expansion of the region to be anonymized, and division of the region to be anonymized into multiple sub-regions of the same size based on a rectangular grid of the size to be utilized. This part can be called adaptive block division of the target region.

[0159] Step S404: Perform reversible anonymization processing while preserving the ROI region coordinate information and shuffle (position transformation) method. That is, in step S102 of the above embodiment, at least one group of sub-regions to be anonymized is selected from the current sub-regions to be anonymized; for each group of sub-regions to be anonymized, the current pixel values ​​at the pixel positions with the same relative position in the two sub-regions to be anonymized in the group are swapped to obtain the anonymized image, and step S103. This part can be called target region anonymization processing.

[0160] Step S405: End.

[0161] Based on the same inventive concept, this application also provides an image deanonymization method, see [link to relevant documentation]. Figure 5 , Figure 5 This is a schematic diagram of a first flowchart of an image deanonymization method provided in an embodiment of this application. The image deanonymization method includes:

[0162] Step S501: Obtain the anonymized image and the corresponding swap operation information.

[0163] The anonymized image and the corresponding exchange operation information are obtained by anonymizing the original image based on any of the image anonymization methods described above.

[0164] Step S502: Exchange the current pixel values ​​at the corresponding pixel positions in the sub-regions to be anonymized that are consistent with each other, as recorded in the exchange operation information, in order to deanonymize the anonymized image and obtain the original image.

[0165] In this embodiment, the anonymized image that needs to be deanonymized and the corresponding swap operation information can be obtained. The current pixel values ​​at the corresponding pixel positions in the sub-regions to be anonymized, as recorded in the swap operation information, are swapped to restore the positions of the pixel values ​​in the anonymized image, thereby deanonymizing the anonymized image and obtaining the original image.

[0166] Based on the above processing, since exchanging pixel values ​​in the sub-region to be anonymized during the anonymization process of the original image only changes the position of the pixel values ​​in the region to be anonymized and does not cause pixel value loss, thus avoiding image information loss, the loss of pixel value positions in the anonymized image can be achieved by restoring the pixel values ​​in the anonymized image according to the recorded exchange operation information. Furthermore, during the anonymization process of the original image, the size to be utilized is positively correlated with the size of the region to be anonymized, and correspondingly, the size of the sub-region to be anonymized is also positively correlated with the size of the region to be anonymized. That is, the size of the sub-region to be anonymized can be adaptively adjusted according to the size of the region to be anonymized, thus avoiding the situation where the sub-region size is too small when the region to be anonymized is large, leading to increased anonymization time, and avoiding the situation where the sub-region size is too large when the region to be anonymized is small, leading to poor anonymization results. This effectively balances the time consumption and the effect of anonymization processing. In this way, while ensuring accurate and lossless restoration of the anonymized image, the time spent on deanonymization can be reduced and the efficiency of deanonymization can be improved.

[0167] In one embodiment, see Figure 6 , Figure 6 This is a schematic diagram of a second flowchart of an image deanonymization method provided in an embodiment of this application. This part can also be referred to as deanonymization processing. The image deanonymization method may include:

[0168] Step S601: Begin.

[0169] Step S602: Obtain the anonymized image, anonymized region coordinates, and shuffle information. That is, step S501 in the above embodiment.

[0170] Step S603: Perform deanonymization processing. That is, step S502 in the above embodiment.

[0171] Step S604: Obtain the deanonymized image. That is, obtain the original image.

[0172] Step S605: End.

[0173] In one embodiment, the anonymized image is obtained by performing multiple rounds of anonymization processing on the original image; the exchange operation information further includes: the sub-regions to be anonymized involved in each round of anonymization processing, and the order between the rounds of anonymization processing.

[0174] Step S502 includes: according to the reverse order of the anonymization processes recorded in the exchange operation information, sequentially exchanging the current pixel values ​​at the corresponding pixel positions in the sub-regions to be anonymized that are in the same relative position in each round of anonymization processes recorded in the exchange operation information, so as to perform multiple rounds of deanonymization processing on the anonymized image to obtain the original image.

[0175] In this embodiment, the anonymized image can be obtained by performing multiple rounds of anonymization processing on the original image. The specific method for performing these multiple rounds of anonymization processing can be found in the description of Method 1 in the above-described image anonymization method embodiments. Accordingly, the positions of pixel values ​​in the sub-regions to be anonymized, recorded in each round of anonymization processing in the exchange operation information, can be restored sequentially in reverse order of the sequence of anonymization processing recorded in the exchange operation information. This allows for multiple rounds of deanonymization processing of the anonymized image to obtain the original image. In this way, lossless restoration of the anonymized image can be achieved.

[0176] In one embodiment, each round of anonymization processing includes multiple pixel value swaps; for each round of anonymization processing, the swap operation information also includes the sub-regions to be anonymized involved in each pixel value swap during that round of anonymization processing, and the order of each pixel value swap during that round of anonymization processing.

[0177] Each round of deanonymization includes:

[0178] According to the reverse order of the pixel value exchanges in the anonymization process corresponding to this round of deanonymization processing recorded in the exchange operation information, the current pixel values ​​at the corresponding pixel positions in the sub-regions to be anonymized that are in the same relative position are exchanged in turn.

[0179] In this embodiment, the anonymized image can be obtained by performing multiple rounds of anonymization processing on the original image, with each round of anonymization processing involving multiple pixel value swaps. The specific method for performing multiple rounds of anonymization processing can be referred to the relevant description of Method 1 in the above-described image anonymization method embodiments, and the specific method for the multiple pixel value swaps included in each round of anonymization processing can be referred to the relevant descriptions of Steps 1 and 2 in the above-described image anonymization method embodiments. Accordingly, the positions of pixel values ​​in the sub-regions to be anonymized involved in each round of anonymization processing recorded in the exchange operation information can be restored sequentially in reverse order of the order of each round of anonymization processing recorded in the exchange operation information, so as to perform multiple rounds of deanonymization processing on the anonymized image to obtain the original image. Furthermore, during each round of deanonymization processing, the positions of pixel values ​​in the sub-regions to be anonymized involved in each pixel value swap in the anonymization processing process can be restored sequentially in reverse order of the order of each pixel value swap in the corresponding anonymization processing process recorded in the exchange operation information. In this way, lossless restoration of the anonymized image can be guaranteed.

[0180] For ease of understanding, let's take a three-round anonymization process on the original image as an example, with each round involving two pixel value swaps. The sub-regions to be anonymized can include sub-regions 1 through 9. In the first round of anonymization, the sub-regions to be anonymized involved in the first pixel value swap can be sub-regions 1 and 2, and the sub-regions to be anonymized involved in the second pixel value swap can be sub-regions 4 and 6. In the second round of anonymization, the sub-regions to be anonymized involved in the first pixel value swap can be sub-regions 3 and 5, and the sub-regions to be anonymized involved in the second pixel value swap can be sub-regions 4 and 7. In the third round of anonymization, the sub-regions to be anonymized involved in the first pixel value swap can be sub-regions 1 and 8, and the sub-regions to be anonymized involved in the second pixel value swap can be sub-regions 6 and 9.

[0181] Accordingly, in the first round of deanonymization, the pixel values ​​of the sub-regions to be anonymized involved in the second pixel value swap during the third round of anonymization can be swapped first. That is, the current pixel values ​​at the pixel positions with the same relative position in sub-regions 6 and 9 are swapped. Then, the pixel values ​​of the sub-regions to be anonymized involved in the first pixel value swap during the third round of anonymization can be swapped again. That is, the current pixel values ​​at the pixel positions with the same relative position in sub-regions 1 and 8 are swapped. This completes the first round of deanonymization.

[0182] In the second round of deanonymization, the pixel values ​​of the sub-regions to be anonymized involved in the second pixel value swap during the second round of anonymization are swapped first. Specifically, the current pixel values ​​at the corresponding pixel positions in sub-regions 4 and 7 are swapped. Then, the pixel values ​​of the sub-regions to be anonymized involved in the first pixel value swap during the second round of anonymization are swapped again. This completes the second round of deanonymization.

[0183] In the third round of deanonymization, the pixel values ​​of the sub-regions to be anonymized involved in the second pixel value swap during the first round of anonymization are swapped first. Specifically, the current pixel values ​​at the corresponding pixel positions in sub-regions 4 and 6 are swapped. Then, the pixel values ​​of the sub-regions to be anonymized involved in the first pixel value swap during the first round of anonymization are swapped again. This swaps the current pixel values ​​at the corresponding pixel positions in sub-regions 1 and 2. This completes the third round of deanonymization, yielding the original image.

[0184] In one embodiment, the anonymized image is obtained by performing one round of anonymization processing on the original image, and the round of anonymization processing includes multiple pixel value swaps; the swap operation information also includes the sub-regions to be anonymized involved in each pixel value swap during the round of anonymization processing, and the order between each pixel value swap during the round of anonymization processing.

[0185] Step S502 includes: according to the reverse order of the pixel value exchanges recorded in the exchange operation information, sequentially exchanging the current pixel values ​​at the corresponding pixel positions in the sub-regions to be anonymized that are in the same relative position for each pixel value exchange recorded in the exchange operation information, so as to deanonymize the anonymized image and obtain the original image.

[0186] For details, please refer to the description of each round of deanonymization process in the above embodiments.

[0187] Based on the same inventive concept, this application also provides an image anonymization device, see [link to relevant documentation]. Figure 7 , Figure 7 This is a schematic diagram of an image anonymization device provided in an embodiment of this application. The device includes:

[0188] The region determination module 701 is used to determine the rectangular image region to be anonymized in the original image, thereby obtaining the region to be anonymized;

[0189] Anonymization processing module 702 is used to divide the current region to be anonymized into multiple sub-regions of the same size according to a rectangular grid of the current available size; select at least one group of sub-regions to be anonymized from the current sub-regions to be anonymized; for each selected group of sub-regions to be anonymized, swap the current pixel values ​​at the pixel positions of two sub-regions in the group that are in the same relative position to obtain an anonymized image; wherein, a group of sub-regions to be anonymized contains two sub-regions to be anonymized; the current available size is positively correlated with the size of the region to be anonymized;

[0190] The information recording module 703 is used to record exchange operation information for deanonymizing the anonymized image; wherein, the exchange operation information includes: the correspondence between two sub-regions to be anonymized for which pixel values ​​are exchanged.

[0191] Based on the image anonymization apparatus provided in this application, a rectangular image region in the original image that needs to be anonymized can be determined, thus obtaining a region to be anonymized. A usable size can be calculated based on the size of the region to be anonymized, and the region to be divided, containing the region to be anonymized, can be divided according to a rectangular grid of the usable size, resulting in multiple sub-regions to be anonymized. Pixel values ​​can be swapped for each group of sub-regions selected from each sub-region to be anonymized, thereby scrambling the positions of the pixel values ​​in the region to be anonymized, making the image information in the region to be anonymized unrecognizable, i.e., achieving anonymization processing of the image to be anonymized, and obtaining an anonymized image. Furthermore, the correspondence between the two sub-regions to be anonymized (i.e., swap operation information) can be recorded. Subsequently, the positions of the pixel values ​​in the anonymized image can be restored based on the recorded swap operation information, achieving deanonymization of the anonymized image and obtaining the original image.

[0192] Since swapping pixel values ​​in the sub-region to be anonymized only changes the position of pixel values ​​within that region and does not result in pixel value loss, no image information loss occurs. Therefore, restoring the pixel positions in the anonymized image based on the recorded swap operation information allows for lossless restoration of the anonymized image. Furthermore, the size of the sub-region to be anonymized is positively correlated with the size of the region to be anonymized, and correspondingly, the size of the sub-region to be anonymized is also positively correlated with the size of the region to be anonymized. That is, the size of the sub-region to be anonymized can be adaptively adjusted according to the size of the region to be anonymized. This avoids situations where the sub-region is too small when the region to be anonymized is large, leading to increased anonymization processing time, and conversely, avoids situations where the sub-region is too large when the region to be anonymized is small, resulting in poor anonymization performance. Thus, while performing image anonymization, it ensures accurate subsequent restoration of the anonymized image and effectively balances the processing time and effectiveness of anonymization.

[0193] In one embodiment, the current available size is calculated based on the current reference mesh size;

[0194] The anonymization processing module 702 includes:

[0195] The region partitioning submodule is used to partition the current region to be anonymized, which contains the region to be anonymized, according to the rectangular grid of the current size to be utilized, to obtain multiple sub-regions to be anonymized with the same size;

[0196] The anonymization processing submodule is used to select at least one group of sub-regions to be anonymized from the current sub-regions to be anonymized; for each group of sub-regions to be anonymized, the current pixel values ​​at the pixel positions that are in the same relative position in the two sub-regions to be anonymized in the group are swapped to complete the current round of anonymization processing;

[0197] The size adjustment module is used to adjust the size of the current reference grid and trigger the region partitioning submodule; until the number of rounds of anonymization processing reaches a first number, an anonymized image is obtained; the exchange operation information also includes the region to be anonymized involved in each round of anonymization processing, and the order between each round of anonymization processing.

[0198] In one embodiment, the anonymization processing submodule is specifically configured to: select at least one group of sub-regions to be anonymized from the current sub-regions to be anonymized; for each currently selected group of sub-regions to be anonymized, swap the current pixel values ​​at pixel positions that are relatively consistent between two sub-regions to be anonymized in the group to complete the current pixel value swap; and return to execute the step of selecting at least one group of sub-regions to be anonymized from the current sub-regions to be anonymized until the number of pixel value swaps reaches a second number; for each round of anonymization processing, the swap operation information also includes the sub-regions to be anonymized involved in each pixel value swap during the round of anonymization processing, and the order between each pixel value swap during the round of anonymization processing.

[0199] In one embodiment, the current available size is the product of the available size factor and the current reference grid size; the available size factor is the ratio of the smaller of the width and height of the region to be anonymized to the number of reference grids.

[0200] In one embodiment, the region determination module 701 is specifically used to detect the object to be anonymized in the original image and obtain the rectangular image region where the object to be anonymized is located, as the region to be processed; if there is a part in the region to be processed that does not belong to the original image, the part of the region to be processed that belongs to the original image is determined as the region to be anonymized.

[0201] In one embodiment, if the width of the region to be anonymized is divisible by the width of the rectangular grid of the current size to be utilized, and the height of the region to be anonymized is divisible by the height of the rectangular grid of the current size to be utilized, then the current region to be divided is the region to be anonymized.

[0202] If the width of the region to be anonymized cannot be divided evenly by the width of the rectangular grid of the current size to be utilized, the current region to be divided is obtained by expanding the region to be anonymized in the direction of the width of the region to be anonymized according to the remainder of the width of the region to be anonymized divided by the width of the rectangular grid of the current size to be utilized.

[0203] If the height of the region to be anonymized cannot be divided evenly by the height of the rectangular grid of the current size to be utilized, the current region to be divided is obtained by expanding the region to be anonymized in the direction of the height of the region to be anonymized according to the remainder when the height of the region to be anonymized is divided by the height of the rectangular grid of the current size to be utilized.

[0204] Based on the same inventive concept, this application also provides an image deanonymization device, see [link to relevant documentation]. Figure 8 , Figure 8This is a schematic diagram of an image deanonymization device provided in an embodiment of this application. The device includes:

[0205] The data acquisition module 801 is used to acquire the anonymized image and the corresponding exchange operation information; wherein, the anonymized image and the corresponding exchange operation information are obtained by anonymizing the original image using any of the above-mentioned image anonymization methods;

[0206] The deanonymization processing module 802 is used to exchange the current pixel values ​​at the corresponding pixel positions in the sub-regions to be anonymized that are recorded in the exchange operation information, so as to deanonymize the anonymized image and obtain the original image.

[0207] Based on the image deanonymization apparatus provided in this application embodiment, since the pixel value exchange of the sub-region to be anonymized during the anonymization process of the original image only changes the position of the pixel values ​​in the region to be anonymized and does not cause pixel value loss, thus avoiding image information loss, the loss of pixel value position in the anonymized image can be achieved by restoring the pixel value position according to the recorded exchange operation information. Furthermore, during the anonymization process of the original image, the size to be utilized is positively correlated with the size of the region to be anonymized, and correspondingly, the size of the sub-region to be anonymized is also positively correlated with the size of the region to be anonymized. That is, the size of the divided sub-region to be anonymized can be adaptively adjusted according to the size of the region to be anonymized, thus avoiding the situation where the sub-region to be anonymized is too small when the region to be anonymized is large, leading to increased anonymization processing time, and avoiding the situation where the sub-region to be anonymized is too large when the region to be anonymized is small, leading to poor anonymization processing effect. This effectively balances the time consumption and the effect of anonymization processing. In this way, while ensuring accurate and lossless restoration of the anonymized image, the time spent on deanonymization can be reduced and the efficiency of deanonymization can be improved.

[0208] In one embodiment, the anonymized image is obtained by performing multiple rounds of anonymization processing on the original image; the exchange operation information further includes: the sub-regions to be anonymized involved in each round of anonymization processing, and the order between each round of anonymization processing;

[0209] The deanonymization processing module 802 is specifically used to exchange the current pixel values ​​of the corresponding pixel positions in the sub-regions to be anonymized that are in the same relative position and have a corresponding relationship in each round of anonymization processing recorded in the exchange operation information, in order to perform multiple rounds of deanonymization processing on the anonymized image to obtain the original image.

[0210] In one embodiment, each round of anonymization processing includes multiple pixel value swaps; for each round of anonymization processing, the swap operation information also includes the sub-regions to be anonymized involved in each pixel value swap during that round of anonymization processing, and the order between each pixel value swap during that round of anonymization processing;

[0211] Each round of deanonymization includes:

[0212] According to the reverse order of the pixel value exchanges in the anonymization process corresponding to the round of deanonymization recorded in the exchange operation information, the current pixel values ​​at the corresponding pixel positions in the sub-regions to be anonymized that are in the same relative position are exchanged in turn.

[0213] In one embodiment, the anonymized image is obtained by performing one round of anonymization processing on the original image, and the round of anonymization processing includes multiple pixel value swaps; the swap operation information also includes the sub-regions to be anonymized involved in each pixel value swap during the round of anonymization processing, and the order between each pixel value swap during the round of anonymization processing;

[0214] The deanonymization processing module 802 is specifically used to exchange the current pixel values ​​at the corresponding pixel positions in the sub-regions to be anonymized, which are in the reverse order of the pixel value exchanges recorded in the exchange operation information, in order to deanonymize the anonymized image and obtain the original image.

[0215] This application also provides an electronic device, such as... Figure 9 As shown, it includes:

[0216] Memory 901 is used to store computer programs;

[0217] The processor 902, when executing the program stored in the memory 901, implements any of the above-mentioned image anonymization methods or any of the image deanonymization methods.

[0218] Furthermore, the aforementioned electronic device may also include a communication bus and / or a communication interface, with the processor 902, communication interface, and memory 901 communicating with each other via the communication bus.

[0219] The communication bus mentioned in the above electronic devices can be a Peripheral Component Interconnect (PCI) bus or an Extended Industry Standard Architecture (EISA) bus, etc. This communication bus can be divided into address bus, data bus, control bus, etc. For ease of illustration, only one thick line is used to represent it in the diagram, but this does not mean that there is only one bus or one type of bus.

[0220] The communication interface is used for communication between the aforementioned electronic devices and other devices.

[0221] The memory may include random access memory (RAM) or non-volatile memory (NVM), such as at least one disk storage device. Optionally, the memory may also be at least one storage device located remotely from the aforementioned processor.

[0222] The processors mentioned above can be general-purpose processors, including central processing units (CPUs), network processors (NPs), etc.; they can also be digital signal processors (DSPs), application-specific integrated circuits (ASICs), field-programmable gate arrays (FPGAs), or other programmable logic devices, discrete gate or transistor logic devices, or discrete hardware components.

[0223] In another embodiment provided in this application, a computer-readable storage medium is also provided, which stores a computer program that, when executed by a processor, implements the steps of any of the above-described image anonymization methods or image deanonymization methods.

[0224] In another embodiment provided in this application, a computer program product containing instructions is also provided, which, when run on a computer, causes the computer to execute any of the image anonymization methods or any of the image deanonymization methods described above.

[0225] In the above embodiments, implementation can be achieved entirely or partially through software, hardware, firmware, or any combination thereof. When implemented using software, it can be implemented entirely or partially in the form of a computer program product. The computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on a computer, all or part of the processes or functions described in the embodiments of this application are generated. The computer can be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device. The computer instructions can be stored in a computer-readable storage medium or transmitted from one computer-readable storage medium to another. For example, the computer instructions can be transmitted from one website, computer, server, or data center to another website, computer, server, or data center via wired (e.g., coaxial cable, fiber optic, digital subscriber line (DSL)) or wireless (e.g., infrared, wireless, microwave, etc.) means. The computer-readable storage medium can be any available medium that a computer can access or a data storage device such as a server or data center that integrates one or more available media. The available medium can be a magnetic medium (e.g., floppy disk, hard disk, magnetic tape), an optical medium (e.g., DVD), or a solid-state drive (SSD), etc.

[0226] It should be noted that, in this document, relational terms such as "first" and "second" are used only to distinguish one entity or operation from another, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Furthermore, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. Without further limitations, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes said element.

[0227] The various embodiments in this specification are described in a related manner. Similar or identical parts between embodiments can be referred to mutually. Each embodiment focuses on describing the differences from other embodiments. In particular, the embodiments of image deanonymization methods, apparatuses, electronic devices, computer-readable storage media, and computer program products are basically similar to the image deanonymization method embodiments, so the descriptions are relatively simple; relevant parts can be referred to the descriptions of the method embodiments.

[0228] The above description is merely a preferred embodiment of this application and is not intended to limit the scope of protection of this application. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of this application are included within the scope of protection of this application.

Claims

1. An image anonymization method characterized by, The method comprises: determining a rectangular image region to be anonymized in an original image to obtain a region to be anonymized; dividing a current region to be divided containing the region to be anonymized according to a rectangular grid of a current size to be used to obtain a plurality of sub-regions to be anonymized of a uniform size; selecting at least one group of sub-regions to be anonymized from the current sub-regions to be anonymized; and exchanging current pixel values at pixel positions of consistent relative positions in two sub-regions to be anonymized in each selected group to obtain an anonymized image; wherein a group of sub-regions to be anonymized contains two sub-regions to be anonymized; the current size to be used is positively correlated with the size of the region to be anonymized; and the current size to be used is obtained by calculating a ratio of the size of the region to be anonymized to a reference grid number and multiplying the obtained ratio with a reference grid size. record exchange operation information for de-anonymizing the anonymized image; wherein the exchange operation information comprises a corresponding relationship of two sub-regions to be anonymized in which pixel value exchange is performed.

2. The method of claim 1, wherein, The current size to be used is obtained based on a current reference grid size. The dividing a current region to be divided containing the region to be anonymized according to a rectangular grid of a current size to be used to obtain a plurality of sub-regions to be anonymized of a uniform size; selecting at least one group of sub-regions to be anonymized from the current sub-regions to be anonymized; The exchanging current pixel values at pixel positions of consistent relative positions in two sub-regions to be anonymized in each selected group to obtain an anonymized image comprises: dividing a current region to be divided containing the region to be anonymized according to a rectangular grid of a current size to be used to obtain a plurality of sub-regions to be anonymized of a uniform size; selecting at least one group of sub-regions to be anonymized from the current sub-regions to be anonymized; and exchanging current pixel values at pixel positions of consistent relative positions in two sub-regions to be anonymized in each selected group to complete the current round of anonymization processing; adjusting the size of the current reference grid size and returning to execute the step of dividing a current region to be divided containing the region to be anonymized according to a rectangular grid of a current size to be used to obtain a plurality of sub-regions to be anonymized of a uniform size until the number of rounds of anonymization processing reaches a first number to obtain an anonymized image; and the exchange operation information further comprises the region to be anonymized involved in each round of anonymization processing and the order between the rounds of anonymization processing.

3. The method according to claim 1 or 2, characterized in that, The selecting at least one group of sub-regions to be anonymized from the current sub-regions to be anonymized; and exchanging current pixel values at pixel positions of consistent relative positions in two sub-regions to be anonymized in each selected group comprises: selecting at least one group of sub-regions to be anonymized from the current sub-regions to be anonymized; For each selected group of sub-regions to be anonymized, the pixel values at the pixel positions with consistent relative positions in the two sub-regions to be anonymized in the selected group are exchanged to complete the pixel value exchange in this round; and the method of selecting at least one group of sub-regions to be anonymized from the current sub-regions to be anonymized is returned until the number of pixel value exchanges reaches the second number. For each round of anonymization processing, the exchange operation information further includes the sub-regions to be anonymized involved in each pixel value exchange in the round of anonymization processing, and the order between each pixel value exchange in the round of anonymization processing.

4. The method of claim 2, wherein, The current to-be-utilized size is the product of a to-be-utilized coefficient and the current reference grid size; the to-be-utilized coefficient is the ratio of the smaller one of the width and height of the sub-region to be anonymized to the number of reference grids.

5. The method of claim 1, wherein, The method comprises: detecting the object to be anonymized in the original image to obtain a rectangular image region where the object to be anonymized is located as a region to be processed; in the case that the region to be processed contains a part not belonging to the original image, determining the part belonging to the original image in the region to be processed as the sub-region to be anonymized.

6. The method of claim 1, wherein, in the case that the width of the sub-region to be anonymized can be evenly divided by the width of the rectangular grid of the current to-be-utilized size, and the height of the sub-region to be anonymized can be evenly divided by the height of the rectangular grid of the current to-be-utilized size, the current to-be-divided region is the sub-region to be anonymized; in the case that the width of the sub-region to be anonymized cannot be evenly divided by the width of the rectangular grid of the current to-be-utilized size, the current to-be-divided region is obtained by expanding the sub-region to be anonymized in the direction where the width of the sub-region to be anonymized is located according to the remainder of the division of the width of the sub-region to be anonymized by the width of the rectangular grid of the current to-be-utilized size; in the case that the height of the sub-region to be anonymized cannot be evenly divided by the height of the rectangular grid of the current to-be-utilized size, the current to-be-divided region is obtained by expanding the sub-region to be anonymized in the direction where the height of the sub-region to be anonymized is located according to the remainder of the division of the height of the sub-region to be anonymized by the height of the rectangular grid of the current to-be-utilized size.

7. An image de-anonymization method characterized by, The method comprises: obtaining an anonymized image and corresponding exchange operation information; wherein the anonymized image and the corresponding exchange operation information are obtained by anonymizing an original image based on any one of the methods of claims 1-6; exchanging the current pixel values at the pixel positions with consistent relative positions in the sub-regions to be anonymized recorded in the exchange operation information that have a corresponding relationship to de-anonymize the anonymized image and obtain the original image.

8. The method of claim 7, wherein, The anonymized image is obtained by performing multiple rounds of anonymization processing on the original image; the exchange operation information further includes the sub-regions to be anonymized involved in each round of anonymization processing, and the order between each round of anonymization processing; The current pixel values at the pixel positions with consistent relative positions in the sub-regions to be anonymized having the corresponding relationship recorded in the exchange operation information are exchanged to de-anonymize the anonymized image to obtain the original image, including: The current pixel values at the pixel positions with consistent relative positions in the sub-regions to be anonymized having the corresponding relationship recorded in the exchange operation information are exchanged to de-anonymize the anonymized image to obtain the original image, including:

9. The method of claim 8, wherein, Each round of anonymization processing includes multiple pixel value exchanges; for each round of anonymization processing, the exchange operation information further includes the sub-regions to be anonymized involved in each pixel value exchange in the round of anonymization processing, and the order between the pixel value exchanges in the round of anonymization processing; The process of each round of de-anonymization processing includes: The current pixel values at the pixel positions with consistent relative positions in the sub-regions to be anonymized having the corresponding relationship recorded in the exchange operation information are exchanged to de-anonymize the anonymized image to obtain the original image, including:

10. The method of claim 7, wherein, The anonymized image is obtained by performing one round of anonymization processing on the original image, and the round of anonymization processing includes multiple pixel value exchanges; the exchange operation information further includes the sub-regions to be anonymized involved in each pixel value exchange in the round of anonymization processing, and the order between the pixel value exchanges in the round of anonymization processing; The current pixel values at the pixel positions with consistent relative positions in the sub-regions to be anonymized having the corresponding relationship recorded in the exchange operation information are exchanged to de-anonymize the anonymized image to obtain the original image, including: The current pixel values at the pixel positions with consistent relative positions in the sub-regions to be anonymized having the corresponding relationship recorded in the exchange operation information are exchanged to de-anonymize the anonymized image to obtain the original image, including:

11. An image anonymization apparatus characterized by comprising: The device includes: A region determination module configured to determine a rectangular image region to be anonymized in the original image to obtain a sub-region to be anonymized; A region determination module configured to determine a rectangular image region to be anonymized in the original image to obtain a sub-region to be anonymized; The anonymization processing module is configured to: divide a current to-be-divided region containing the to-be-anonymized region according to a rectangular grid of a current to-be-utilized size, to obtain a plurality of to-be-anonymized sub-regions of a uniform size; select at least one group of to-be-anonymized sub-regions from the current to-be-anonymized sub-regions; and exchange current pixel values at pixel positions of consistent relative positions in two to-be-anonymized sub-regions in each selected group of to-be-anonymized sub-regions, to obtain an anonymized image; the group of to-be-anonymized sub-regions contains two to-be-anonymized sub-regions; the current to-be-utilized size is positively correlated with the size of the to-be-anonymized region; and the current to-be-utilized size is obtained by: calculating a ratio of the size of the to-be-anonymized region to a reference grid number, and multiplying the obtained ratio with a reference grid size. The information recording module is configured to record exchange operation information for de-anonymizing the anonymized image; the exchange operation information includes a corresponding relationship between the two to-be-anonymized sub-regions in which the pixel values are exchanged.

12. The apparatus of claim 11, wherein, The current to-be-utilized size is obtained based on the current reference grid size. The anonymization processing module includes: The region division sub-module is configured to divide a current to-be-divided region containing the to-be-anonymized region according to a rectangular grid of a current to-be-utilized size, to obtain a plurality of to-be-anonymized sub-regions of a uniform size. The anonymization processing sub-module is configured to: select at least one group of to-be-anonymized sub-regions from the current to-be-anonymized sub-regions; and exchange current pixel values at pixel positions of consistent relative positions in two to-be-anonymized sub-regions in each selected group of to-be-anonymized sub-regions, to complete the current round of anonymization processing. The size adjustment module is configured to adjust the size of the current reference grid size, and trigger the region division sub-module; until the number of rounds of anonymization processing reaches a first number, to obtain the anonymized image; the exchange operation information further includes the to-be-anonymized region involved in each round of anonymization processing, and the sequence between the rounds of anonymization processing. And / or The anonymization processing sub-module is specifically configured to: select at least one group of to-be-anonymized sub-regions from the current to-be-anonymized sub-regions; exchange current pixel values at pixel positions of consistent relative positions in two to-be-anonymized sub-regions in each selected group of to-be-anonymized sub-regions, to complete the current pixel value exchange; and return to the step of selecting at least one group of to-be-anonymized sub-regions from the current to-be-anonymized sub-regions, until the number of pixel value exchanges reaches a second number; for each round of anonymization processing, the exchange operation information further includes the to-be-anonymized sub-regions involved in each pixel value exchange in the round of anonymization processing, and the sequence between the pixel value exchanges in the round of anonymization processing. And / or The current to-be-utilized size is a product of a to-be-utilized coefficient and the current reference grid size; the to-be-utilized coefficient is a ratio of a smaller value of width and height of the to-be-anonymized region to a reference grid number. And / or The region determining module is specifically configured to detect a to-be-anonymized object in an original image to obtain a rectangular image region where the to-be-anonymized object is located, as a to-be-processed region; and in a case where a part not belonging to the original image exists in the to-be-processed region, determine a part belonging to the original image contained in the to-be-processed region as a to-be-anonymized region; and / or, in a case where the width of the to-be-anonymized region can be evenly divided by the width of the current rectangular grid of the to-be-utilized size and the height of the to-be-anonymized region can be evenly divided by the height of the current rectangular grid of the to-be-utilized size, the current to-be-divided region is the to-be-anonymized region; in a case where the width of the to-be-anonymized region cannot be evenly divided by the width of the current rectangular grid of the to-be-utilized size, the current to-be-divided region is obtained by expanding the to-be-anonymized region in a direction where the width of the to-be-anonymized region is located, according to a remainder of the width of the to-be-anonymized region divided by the width of the current rectangular grid of the to-be-utilized size; in a case where the height of the to-be-anonymized region cannot be evenly divided by the height of the current rectangular grid of the to-be-utilized size, the current to-be-divided region is obtained by expanding the to-be-anonymized region in a direction where the height of the to-be-anonymized region is located, according to a remainder of the height of the to-be-anonymized region divided by the height of the current rectangular grid of the to-be-utilized size.

13. An image de-anonymization apparatus, characterized by comprising: The apparatus comprises: a data obtaining module configured to obtain an anonymized image and corresponding exchange operation information, wherein the anonymized image and the corresponding exchange operation information are obtained by performing anonymization processing on an original image based on any one of the methods in claims 1-6; a de-anonymization processing module configured to exchange current pixel values at pixel positions with consistent relative positions in to-be-anonymized sub-regions with a corresponding relationship recorded in the exchange operation information, to de-anonymize the anonymized image, and obtain the original image.

14. The apparatus of claim 13, wherein, The anonymized image is obtained by performing multiple rounds of anonymization processing on the original image; and the exchange operation information further comprises to-be-anonymized sub-regions involved in each round of anonymization processing and an order between rounds of anonymization processing; The de-anonymization processing module is specifically configured to exchange current pixel values at pixel positions with consistent relative positions in to-be-anonymized sub-regions with a corresponding relationship recorded in each round of anonymization processing and an inverse order of the order between rounds of anonymization processing recorded in the exchange operation information, to perform multiple rounds of de-anonymization processing on the anonymized image, and obtain the original image; and / or, Each round of anonymization processing comprises multiple times of pixel value exchange; and for each round of anonymization processing, the exchange operation information further comprises to-be-anonymized sub-regions involved in each time of pixel value exchange in the round of anonymization processing and an order between times of pixel value exchange in the round of anonymization processing; The process of each round of de-anonymization processing comprises: According to the inverse order of the order of the pixel value exchanges in the de-anonymization process corresponding to the round of the anonymization process recorded in the exchange operation information, the current pixel values at the pixel positions with consistent relative positions in the to-be-anonymized sub-regions involved in each of the pixel value exchanges in the anonymization process and having a corresponding relationship are exchanged in sequence; And / or, The anonymized image is obtained by performing a round of anonymization processing on the original image, and the round of the anonymization processing includes multiple pixel value exchanges; the exchange operation information further includes the to-be-anonymized sub-regions involved in each of the pixel value exchanges in the round of the anonymization processing, and the order of the pixel value exchanges in the round of the anonymization processing; The de-anonymization processing module is specifically configured to exchange, according to the inverse order of the order of the pixel value exchanges recorded in the exchange operation information, the current pixel values at the pixel positions with consistent relative positions in the to-be-anonymized sub-regions involved in each of the pixel value exchanges recorded in the exchange operation information and having a corresponding relationship, so as to de-anonymize the anonymized image and obtain the original image.

15. An electronic device, comprising: Including: A memory for storing a computer program; A processor for executing the program stored in the memory, realizing any one of the methods in claims 1-6 or any one of the methods in claims 7-10.

16. A computer-readable storage medium, characterized in that, The computer program is stored in the computer readable storage medium, and when the computer program is executed by the processor, any one of the methods in claims 1-6 or any one of the methods in claims 7-10 is realized.

17. A computer program product, characterised in that, When the computer program product runs on the computer, the computer executes any one of the methods in claims 1-6 or any one of the methods in claims 7-10.

Citation Information

Patent Citations

  • PRNU anonymous method and device based on image segmentation

    CN114881897A

  • Method and apparatus for providing image data

    CN117892334A