Privacy shielding method and device
By obtaining and calculating the position of the new privacy target in the image, and blocking the new privacy target in the predetermined frame image, it solves the problem of untimely privacy blocking, ensures the details and granularity of privacy protection, and achieves timely blocking of the new privacy target. Occlusion.
Patent Information
- Application Number
- CN202210515501.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-05-11
- Publication Date
- 2024-09-06
- Estimated Expiration
- 2042-05-11
AI Technical Summary
Existing privacy masking methods have the problem that privacy masking is not timely, especially when the new privacy target cannot be recognized in the first few frames of images before the new privacy target appears, it cannot be blocked in time, resulting in privacy leakage.
By obtaining the position of the new privacy target in the current frame image and the preset frame image, calculate the position of the new privacy target in a predetermined number of frame images before the current frame image, and use this position to block the new privacy target to ensure that the new privacy target is in the new privacy frame. Complementary blocking is performed before the target appears to solve the problem of untimely privacy blocking.
It effectively solves the problem of untimely privacy blocking, ensuring that new privacy targets are blocked before they appear, protecting user privacy and reducing information leakage.
Smart Images

Figure CN115147318B
Abstract
Description
Technical Field
[0001] The present application relates to the field of image processing technology, and in particular to a privacy shielding method and device. Background Art
[0002] With the development and progress of society, people have higher and higher requirements for privacy protection. Not only the scope of protection is constantly expanding, but also the requirements for the details and granularity of protection are getting higher and higher. Various sub-industries and scenarios have brought greater and greater challenges to the monitoring industry. However, the current privacy masking methods have the problem of untimely privacy masking. Summary of the invention
[0003] The present application provides a privacy shielding method and device, which can effectively solve the problem of untimely privacy shielding.
[0004] To achieve the above object, the present application provides a privacy shielding method, which includes:
[0005] When a new privacy target is identified from the current frame image, a position of the new privacy target in the current frame image and a preset frame image is obtained, where the preset frame image is an image of a preset frame after the current frame image where the new privacy target exists;
[0006] Based on the position of the new privacy target in the current frame image and the preset frame image, the new privacy target in a predetermined number of frame images before the current frame image is blocked;
[0007] The predetermined number is an integer value obtained by subtracting the time when the new privacy target first appears from the time of the current frame image and multiplying it by the image acquisition frame rate.
[0008] Wherein, based on the position of the new privacy target in the current frame image and the preset frame image, the new privacy target in a predetermined number of frame images before the current frame image is shielded, including:
[0009] Based on the positions of the new privacy target in the current frame image and the preset frame image, calculating the positions of the new privacy target in a predetermined number of frame images before the current frame image;
[0010] Based on the position of the new privacy target in the predetermined number of frame images, the new privacy target in the predetermined number of frame images is shielded.
[0011] The step of calculating the position of the new privacy target in a predetermined number of frame images before the current frame image based on the position of the new privacy target in the current frame image and the preset frame image includes:
[0012] Based on the position difference between the new privacy target in the current frame image and the preset frame image, the position change speed of the new privacy target is calculated;
[0013] The position of the new privacy target in a predetermined number of frame images before the current frame image is calculated based on the position change speed of the new privacy target.
[0014] Wherein, the device to which the method is applied includes a buffer for storing an image to be encoded;
[0015] In the case of recognizing a new privacy target from the current frame image, obtaining the position of the new privacy target in the current frame image and the preset frame image, which includes: recognizing the privacy target on the current frame image to obtain the privacy target recognition result of the current frame image;
[0016] The privacy target is identified on the current frame image, and then the following steps are included: based on the privacy target identification result of the current frame image, the privacy target is masked on the current frame image; the current frame image masked with the privacy target is sent to a buffer, and the head of the queue in the buffer is sent to an encoder;
[0017] The new privacy target in a predetermined number of image frames is shielded, including: shielding the new privacy target in a predetermined number of image frames before a current image frame in a buffer.
[0018] The method further comprises:
[0019] If it is confirmed based on the privacy target recognition result of the current frame image that no new privacy target is recognized from the current frame image, the next frame of the current frame image is used as the current frame image, and the step of performing privacy target recognition on the current frame image is returned to be executed.
[0020] The process of obtaining the position of the new privacy target in the current frame image and the preset frame image includes:
[0021] The privacy target is identified on the preset frame image to obtain the privacy target identification result of the preset frame image.
[0022] The preset frame image is the next frame of the current frame image;
[0023] The new privacy target in a predetermined number of frames is masked, and then includes:
[0024] The next frame is used as the current frame image, and the step of performing privacy target masking on the current frame image based on the privacy target recognition result of the current frame image is returned.
[0025] Among them, privacy targets include display screens.
[0026] Among them, privacy target identification includes:
[0027] Identify the display screen in the image;
[0028] Check whether the brightness of each display area in the image exceeds a threshold;
[0029] Display screens with brightness exceeding a threshold are regarded as privacy targets in the image, while display screens with brightness below the threshold are not regarded as privacy targets in the image.
[0030] To achieve the above objectives, the present application also provides an electronic device, which includes a processor; the processor is used to execute instructions to implement the above method.
[0031] To achieve the above objectives, the present application also provides a computer-readable storage medium, which is used to store instructions / program data, and the instructions / program data can be executed to implement the above method.
[0032] In the privacy masking method of the present application, when a new privacy target is identified from a current frame image, the position of the new privacy target in the current frame image and the preset frame image is obtained, and then the position of the new privacy target in the current frame image and the preset frame image is used to mask the new privacy target in a predetermined number of frame images before the current frame image; in this way, when the new privacy target cannot be identified from the first few frame images where the new privacy target appears, the method of the present application can be used to mask the new privacy target in a predetermined number of frame images before the current frame image, and the new privacy target can be supplemented with masking for the image where the new privacy target is missed, so as to solve the problem of untimely privacy masking. BRIEF DESCRIPTION OF THE DRAWINGS
[0033] The drawings described herein are used to provide a further understanding of the present application and constitute a part of the present application. The illustrative embodiments of the present application and their descriptions are used to explain the present application and do not constitute an improper limitation on the present application. In the drawings:
[0034] Figure 1 It is a flowchart of an implementation method of the privacy shielding method of the present application;
[0035] Figure 2 It is a structural diagram of an implementation method of a privacy target identification model of the present application;
[0036] Figure 3 It is a flowchart of another implementation method of the privacy shielding method of the present application;
[0037] Figure 4 It is a flowchart of the execution of the privacy shielding method of this application;
[0038] Figure 5 This is a flowchart of another implementation method of the privacy shielding method of the present application;
[0039] Figure 6 It is a schematic diagram of a buffer zone set in the execution subject of the privacy shielding method of the present application;
[0040] Figure 7It is a structural schematic diagram of an embodiment of the electronic device of the present application;
[0041] Figure 8 It is a structural schematic diagram of an implementation method of a computer-readable storage medium of the present application. DETAILED DESCRIPTION
[0042] The technical solutions in the embodiments of the present application will be clearly and completely described below in conjunction with the accompanying drawings in the embodiments of the present application. Obviously, the described embodiments are only a part of the embodiments of the present application, rather than all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by those of ordinary skill in the art without making creative work are within the scope of protection of the present application. In addition, unless otherwise specified (for example, "or in addition" or "or in an alternative"), the term "or" as used herein refers to a non-exclusive "or" (that is, "and / or"). Moreover, the various embodiments described herein are not necessarily mutually exclusive, because some embodiments can be combined with one or more other embodiments to form new embodiments.
[0043] When using a privacy target recognition algorithm to identify privacy targets in an image, there may be a problem that "the new privacy target cannot be recognized from the first predetermined number (also called N) frames of images after the new privacy target appears, and the new privacy target can only be recognized normally from the N+1th frame after the new privacy target appears." In this case, if privacy masking is performed on each frame of the image directly based on the privacy target recognition result of each frame of the image, the new privacy target in the first N frames of the image after the new privacy target appears cannot be masked, which will lead to untimely privacy masking.
[0044] Based on this, the present application also masks the new privacy target in a predetermined number of frames before the first frame in which the new privacy target is identified, so as to solve the problem that the new privacy target in the first N frames cannot be masked. Specifically, the present application uses the position of the new privacy target in the first frame and the frame after which the new privacy target is identified to calculate the position of the new privacy target in the predetermined number of frames before the first frame, so that the calculated position of the new privacy target in the predetermined number of frames before the first frame can be used to mask the new privacy target in the predetermined number of frames before the first frame.
[0045] Specifically, Figure 1 As shown, the privacy shielding method of the present application includes the following steps. It should be noted that the following step numbers are only used to simplify the description and are not intended to limit the execution order of the steps. The steps of this embodiment can be arbitrarily changed in execution order without violating the technical idea of the present application.
[0046] S101: When a new privacy target is identified from a current frame image, a position of the new privacy target in the current frame image and a preset frame image is obtained.
[0047] When a new privacy target is identified from the current frame image, the position of the new privacy target in the current frame image and the preset frame image is obtained, so that the position of the new privacy target in the current frame image and the preset frame image can be used to subsequently mask the new privacy target in a predetermined number of frame images before the current frame image, thereby solving the problem of untimely privacy masking.
[0048] Optionally, the new privacy target may refer to a privacy target that has never been identified before the current frame image, that is, the current frame image is the first frame image in which the new privacy target is identified.
[0049] Optionally, when a new privacy target is identified from the current frame image, the position of the new privacy target of the current frame image can be determined from the identification information of the new privacy target of the current frame image, and the position of the new privacy target of the preset frame image can be determined from the identification information of the new privacy target in the preset frame image.
[0050] The preset frame image of the present application is an image with a new privacy target after the current frame image. Preferably, the preset frame image is the a-th frame image after the current frame image, where a can be an integer greater than or equal to 1 and less than or equal to 300. For example, the preset frame image can be the next frame image of the current frame image.
[0051] There is no restriction on the types of privacy targets, such as display screens, windows, balconies, etc.
[0052] For example, the privacy target can be a display screen that is being displayed. In this way, when the display screen is recognized from the image, it can be confirmed whether the recognized display screen is being displayed; if the recognized display screen is in a display state, it can be confirmed that the recognized display screen is a privacy target, otherwise it is not a privacy target. In this way, it is possible to avoid blocking the display screen that is not in a display state, reduce the blocking range, and retain more information as much as possible. Optionally, it is possible to confirm whether the recognized display screen is in a display state through the brightness information of the display screen area in the image. Specifically, when the average brightness of the display screen area in the image exceeds a threshold, it can be confirmed that the recognized display screen is in a display state; when the average brightness of the display screen area in the image is less than a threshold, it is confirmed that the recognized display screen is not in a display state. In this way, the brightness of the display screen area can be used to filter out screens with low brightness or no display, so that only the display screen with high brightness (that is, the display screen that is sufficient for people to obtain the display content of the display screen through the image) can be blocked, and more information can be retained as much as possible while protecting the user's privacy.
[0053] For example, if the image is an RGB image, the brightness of each pixel in each display screen area in the image can be calculated by the formula Gray(i,j)=0.299*R(i,j)+0.578*G(i,j)+0.114*B(i,j), and then the average brightness of the display screen area in the image can be calculated. Then, based on the average brightness of each display screen area in the image, it can be confirmed whether each display screen in the image is displaying.
[0054] Optionally, the privacy target recognition model can be used to recognize the image, so that the recognition result of the privacy target recognition model can be used to block the privacy target in the image. The above recognition result may include information such as the privacy target, the category of the privacy target, the position of the recognition frame of the privacy target and / or the size of the recognition frame of the privacy target. Specifically, in step S101, the current frame image can be input into the privacy target recognition model. After the privacy target recognition model, the output classifier can be used to determine whether there are privacy targets in each area of the current frame image, and the frame regression can be used to obtain the precise position of the privacy target in the current frame image.
[0055] The type of privacy target recognition model is not limited, for example, it can be a convolutional neural network based on deep learning, specifically a YOLO model or Figure 2 The Faster-RCNN model shown.
[0056] Before step S101, the privacy object recognition model may be trained using a training image set to update model parameters of the privacy object recognition model so that the privacy object recognition model has the ability to recognize privacy objects.
[0057] The training image set may include training images at different pitch angles, shapes, sizes, types, and light intensities, so as to improve the privacy target recognition capability of the trained privacy target recognition model through the training image set. For example, assuming that the privacy target includes a display screen, the training image set includes screen photos of different electronic devices such as mobile phones and computers.
[0058] Before training, you can perform data enhancement operations such as random rotation, mirroring, translation, and noise addition on the training images. After the data enhancement operation, the size of the data set can be expanded to a certain extent, reducing the possibility of model overfitting.
[0059] In addition, the image format of the present application is not limited, for example, it can be a YUV image, an RGB image, etc.
[0060] S102: Based on the position of the new privacy target in the current frame image and the preset frame image, the new privacy target in a predetermined number of frame images before the current frame image is shielded.
[0061] The predetermined number is the integer value obtained by subtracting the time t1 when the new privacy target first appears from the time t2 of the current frame image and multiplying it by the image acquisition frame rate fps, that is, N = (t2-t1)*fps. That is, the predetermined number of frame images before the current frame image are images in which the new privacy target exists but is not blocked due to the delay in recognition time difference.
[0062] The time of the current frame image may refer to the acquisition time of the current frame image, or may refer to the time when the recognition result of the current frame image comes out.
[0063] In this embodiment, when a new privacy target is recognized from the current frame image, the position of the new privacy target in the current frame image and the preset frame image is obtained, and then the position of the new privacy target in the current frame image and the preset frame image is used to block the new privacy target in a predetermined number of frame images before the current frame image; in this way, when the new privacy target cannot be recognized from the first few frame images where the new privacy target appears, the method of the present application can be used to block the new privacy target in the image before the current frame image where the new privacy target exists but is not blocked due to the delay in recognition time difference, and the new privacy target can be supplemented for the image where the new privacy target is missed to solve the problem of untimely privacy blocking.
[0064] This application also provides another implementation of the privacy shielding method. Specifically, Figure 3 As shown, another implementation of the privacy shielding method of the present application includes the following steps. It should be noted that the following step numbers are only used to simplify the description and are not intended to limit the execution order of the steps. The steps of this implementation can be arbitrarily changed in execution order without violating the technical idea of the present application.
[0065] S201: When a new privacy target is identified from a current frame image, a position of the new privacy target in the current frame image and a preset frame image is obtained.
[0066] When a new privacy target is identified from the current frame image, the position of the new privacy target in the current frame image and the preset frame image is obtained, so that the position of the new privacy target in the current frame image and the preset frame image can be subsequently calculated to calculate the position of the new privacy target in a predetermined number of frame images before the current frame image. In this way, the position of the new privacy target in the predetermined number of frame images before the current frame image can be used to block the new privacy target in the predetermined number of frame images before the current frame image, thereby solving the problem of untimely privacy blocking.
[0067] S202: Calculate the position of the new privacy target in a predetermined number of frame images before the current frame image based on the position of the new privacy target in the current frame image and the preset frame image.
[0068] After the position of the new privacy target in the current frame image and the preset frame image is determined based on the above steps, the position of the new privacy target in a predetermined number of frame images before the current frame image can be calculated based on the position of the new privacy target in the current frame image and the preset frame image.
[0069] Optionally, the position change speed of the new privacy target is calculated based on the position difference between the new privacy target in the current frame image and the preset frame image, so as to infer the position of the new privacy target in a predetermined number of frame images before the current frame image based on the position change speed of the new privacy target.
[0070] Specifically, the position change speed of the new privacy target can be calculated using the position difference between the current frame image and the preset frame image and the time interval between the current frame image and the preset frame image, and then the position of the new privacy target in the predetermined number of frame images before the current frame image can be inferred based on the position change speed of the new privacy target. For example, assuming that the preset frame image is the next frame of the current frame image, the coordinates of the fixed points (such as the upper left coordinate point and / or the lower right coordinate point, etc.) on the new privacy target identification frame in the current frame image and the preset frame image are recorded as A (X1, Y1) and B (X2, Y2) respectively, and the difference between the X and Y axis components of point A and point B is calculated as (X2-X1) and (Y2-Y1). The frame rate at this time is recorded as FPS, then the time interval between the two frames is equal to (1 / FPS) seconds, and then the X axis position of the fixed point can be calculated. The position change speeds in the X and Y directions are Vx=(X2-X1)*FPS, and Vy=(Y2-Y1)*FPS respectively. After obtaining the position change speeds of the fixed point in the new privacy target identification frame in the X and Y directions, the coordinates of the fixed point in the new privacy target identification frame in a predetermined number of frame images before the current frame image can be inferred through a linear model. For example, the coordinates of the fixed point in the previous frame are (X1-δx, Y1-δy), where δx=Vx / FPS and δy=Vy / FPS.
[0071] S203: Based on the positions of the new privacy objects in the predetermined number of image frames, the new privacy objects in the predetermined number of image frames are shielded.
[0072] After determining the position of the new privacy target in a predetermined number of image frames before the current image frame based on the above steps, the new privacy target in a predetermined number of image frames before the current image frame can be shielded based on the position of the new privacy target in the predetermined number of image frames before the current image frame.
[0073] Optionally, a Copy operator may be used to mask the new privacy target in each of a predetermined number of image frames before the current image frame, that is, a masking bar may be superimposed on the privacy target area in the image to mask the new privacy target in each of a predetermined number of image frames before the current image frame.
[0074] Specifically, the main function of the Copy operator is to read preset image data of a certain area size from a preset image, write it into the privacy target area, and use the read preset image data to cover the image data in the privacy target area to achieve the privacy shielding effect on the privacy target area.
[0075] In another alternative embodiment, an erasing method may be used to block the new privacy target in each of a predetermined number of image frames before the current image frame.
[0076] In another alternative embodiment, the pixel values in the privacy target area in the image may all be set to fixed values, so as to shield the new privacy target in each of the predetermined number of image frames before the current image frame.
[0077] Optionally, the privacy shielding method of the present application can be applied to a device with an image acquisition function. The image acquisition function may refer to functions such as taking images, taking screenshots, or recording screens, and the device with an image acquisition function may refer to a camera device or a mobile phone, computer, or other device with the above-mentioned image acquisition function.
[0078] like Figure 4 As shown, these devices with image acquisition functions (i.e., the execution subject of the present application) can continuously acquire images using their own image acquisition functions, and perform privacy target identification on each frame of acquired images, perform privacy masking on each frame of acquired images based on the privacy target identification results of each frame of acquired images, and then send each frame of acquired images that have been privacy masked to the encoder to encode each frame of acquired images that have been privacy masked. However, since there may be a problem that "the new privacy target cannot be identified from the first N frames of images where the new privacy target appears, and the privacy target can only be normally identified from the N+1th frame where the new privacy target appears", if privacy masking is performed on each frame of images directly based on the privacy target identification results of each frame of images, there will be a problem that the new privacy target in the first N frames of images where the new privacy target appears cannot be masked, which will cause the first N frames of images where the new privacy target appears to enter the encoder when the new privacy target is not masked, i.e., the privacy masking is not timely.
[0079] Based on this, the execution body of the present application is provided with a buffer for storing the collected images to be encoded, so that when a new privacy target is identified from the current frame image, the new privacy target in the predetermined number of frame images before the current frame image that is not encoded in the buffer can be blocked based on the position of the new privacy target in the current frame image. In this way, the new privacy target can be supplemented before encoding the image that at least part of the new privacy target is not blocked, so as to solve the problem of untimely privacy blocking. Figure 5As shown, the privacy shielding method using the buffer includes the following steps. It should be noted that the following step numbers are only used to simplify the description and are not intended to limit the execution order of the steps. The steps of this embodiment can be arbitrarily changed in execution order without violating the technical idea of the present application.
[0080] S301: performing privacy target recognition on the current frame image to obtain a privacy target recognition result of the current frame image.
[0081] S302: performing privacy object masking on the current frame image based on the privacy object recognition result of the current frame image.
[0082] Optionally, in step S302, a masking bar (such as an OSD masking bar) can be superimposed on the image, that is, a new privacy target masking layer is added on the basis of the original layer of the image, and the area corresponding to the privacy target of the image in the privacy target masking layer is a preset image. In this way, the original image can be retained by adding a new privacy target masking layer, and the original image can be extracted from the privacy target masking image when needed. And compared with the encoding result of the original image, the encoding result of the privacy target masking image will have an additional encoding result of the privacy target masking layer, that is, when encoding the privacy target masking image in this embodiment, the privacy target masking bar will be accurately superimposed on the image code stream, so that the privacy target masking image containing the original layer information and the privacy target masking layer information can be decoded from the image code stream.
[0083] In other alternative embodiments, in step S302, the privacy target of the image may be shielded by directly modifying the pixels of the privacy target area in the image, that is, by modifying the original image.
[0084] S303: Send the current frame image blocked by the privacy target into the buffer, and send the head of the queue in the buffer to the encoder.
[0085] The encoding method is not limited, and the type of the encoding result is not limited, for example, it can be an H.264 or H265 code stream.
[0086] After the privacy target is masked for the current frame image, the current frame image masked by the privacy target can be sent to the buffer, and the head of the buffer can be sent to the encoder, so that the encoder can encode the head of the buffer. Figure 6 As shown, after the privacy target is occluded for the current frame image (ie, frame X), the frame X occluded by the privacy target is sent to the buffer, and the head of the buffer [ie, frame (XM)] is sent to the encoder.
[0087] After completing step S301, it can be determined which step to enter based on the judgment result of whether a new privacy target is recognized from the current frame image. Specifically, if a new privacy target is recognized from the current frame image, step S304 can be entered to perform complementary occlusion on the new privacy target in a predetermined number of frame images before the current frame image in the buffer based on steps S304, S305 and S306. If a new privacy target is not recognized from the current frame image, step S308 can be entered to perform steps S308, S301, S302 and S303 in sequence to perform privacy occlusion on the next frame image based on the privacy target recognition result of the next frame image.
[0088] It is understandable that when a new privacy target is identified from the current frame image, steps S302, S303, S304, S305, and S306 are not necessarily performed in accordance with the above steps. Figure 5 The order shown is executed in sequence, and the execution order can be changed arbitrarily without violating the technical concept of the present application. For example, after executing step 301, and in the case of identifying a new privacy target from the current frame image, step S304 can be executed first, then step S302 and step S303, and then step S305 and step S306.
[0089] Accordingly, if no new privacy target is identified from the current frame image, steps S301, S302, S303, and S308 are not necessarily performed according to the above steps. Figure 5 The order shown is executed in sequence, and the execution order can be changed arbitrarily without violating the technical ideas of the present application. For example, while the privacy target is identified in the current frame image, the privacy target is shielded in the previous frame using the privacy target identification result of the previous frame of the current frame image; then the previous frame with the privacy target shielded is sent to the buffer, and the head of the queue in the buffer is sent to the encoder; then the next frame of the current frame image is used as the current frame image, and returns to "while the privacy target is identified in the current frame image, the privacy target is shielded in the previous frame using the privacy target identification result of the previous frame of the current frame image", so that the collected image can be identified, shielded and encoded in sequence.
[0090] S304: performing privacy target recognition on the next frame image of the current frame image to obtain a privacy target recognition result of the next frame image.
[0091] When a new privacy target is identified from the current frame image, the privacy target is identified on the next frame image of the current frame image to obtain the privacy target identification result of the next frame image, and then steps S305 and S306 are executed in sequence to use the privacy target identification results of the current frame image and the next frame image to perform new privacy target supplementary occlusion on a predetermined number of frame images before the current frame image.
[0092] S305: Based on the privacy target recognition results of the current frame image and the next frame image, calculate the position of the new privacy target in a predetermined number of frame images before the current frame image.
[0093] Optionally, based on the position of the new privacy target in the privacy target identification results of the current frame image and the next frame image, the position of the new privacy target in a predetermined number of frame images before the current frame image is calculated.
[0094] S306: Based on the position of the new privacy target in the predetermined number of frame images, the new privacy target in the predetermined number of frame images before the current frame image in the buffer is covered.
[0095] Optionally, when the total length of the cache queue of the buffer is M frames, in step S305, the position of the new privacy target in the (M-1) frame before the current frame image may be calculated based on the privacy target recognition results of the current frame image and the next frame image; then, based on the position of the new privacy target in the M-1 frame before the current frame image, the new privacy target in the M-1 frame image before the current frame image in the buffer is covered. Wherein, (M-1) may be equal to the predetermined number (i.e., N) in step S102.
[0096] In other alternative embodiments, when the total length of the cache queue of the buffer is M frames, and (M-1) may be greater than N in step S302, in step S305, the position of the new privacy target in the N frames before the current frame image may be calculated based on the privacy target recognition results of the current frame image and the next frame image; then, based on the position of the new privacy target in the N frames before the current frame image, the new privacy target in the N frames before the current frame image in the buffer may be supplemented and blocked. For example, assuming that M is 5, N is 2, and the current frame image is frame 10, after the current frame image is recognized and blocked, frames 6 to 10 are stored in the buffer, and the position of the new privacy target in frames 8 and 9 may be calculated based on the privacy target recognition results of frames 10 and 11 in step S305; then, based on the position of the new privacy target in frame 8, the new privacy target in frame 8 may be supplemented and blocked, and based on the position of the new privacy target in frame 9, the new privacy target in frame 9 may be supplemented and blocked.
[0097] S307: Taking the next frame image as the current frame image.
[0098] After the new privacy targets in the predetermined number of frame images before the current frame image are covered based on steps S304, S305, and S306, the next frame image may be used as the current frame image, and the process returns to step S302.
[0099] S308: Taking the next frame image as the current frame image.
[0100] When no new privacy target is identified from the current frame image, the process proceeds to step S308 to sequentially execute steps S308, S301, S302 and S303, so as to perform privacy masking on the next frame image based on the privacy target identification result of the next frame image.
[0101] See also Figure 7 , Figure 7 The electronic device 20 of the present application includes a processor 22, which is used to execute instructions to implement the method of any of the above embodiments of the present application and any non-conflicting combination thereof.
[0102] The electronic device 20 may be a camera device, a server or other device, which is not limited here.
[0103] The processor 22 may also be referred to as a CPU (Central Processing Unit). The processor 22 may be an integrated circuit chip having signal processing capabilities. The processor 22 may also be a general-purpose processor, a digital signal processor (DSP), an application-specific integrated circuit (ASIC), a field programmable gate array (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components. The general-purpose processor may be a microprocessor, or the processor 22 may also be any conventional processor, etc.
[0104] The electronic device 20 may further include a memory 21 for storing instructions and data required for the processor 22 to run.
[0105] See also Figure 8 , Figure 8It is a schematic diagram of the structure of the computer-readable storage medium in the embodiment of the present application. The computer-readable storage medium 30 of the embodiment of the present application stores instructions and / or program data 31, and when the instructions / program data 31 are executed, the method provided by any embodiment of the above-mentioned method of the present application and any non-conflicting combination is implemented. Among them, the instructions / program data 31 can form a program file and be stored in the above-mentioned storage medium 30 in the form of a software product, so that a computer device (which can be a personal computer, a server, or a network device, etc.) or a processor (processor) executes all or part of the steps of each embodiment method of the present application. The aforementioned storage medium 30 includes: various media that can store program codes, such as a USB flash drive, a mobile hard disk, a read-only memory (ROM, Read-Only Memory), a random access memory (RAM, Random Access Memory), a disk or an optical disk, or a computer, a server, a mobile phone, a tablet and other devices.
[0106] In the several embodiments provided in the present application, it should be understood that the disclosed systems, devices and methods can be implemented in other ways. For example, the device embodiments described above are only schematic. For example, the division of units is only a logical function division. There may be other division methods in actual implementation. For example, multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be an indirect coupling or communication connection through some interfaces, devices or units, which can be electrical, mechanical or other forms.
[0107] In addition, each functional unit in each embodiment of the present application may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit. The above-mentioned integrated unit may be implemented in the form of hardware or in the form of software functional units.
[0108] It should also be noted that the terms "include", "comprises" or any other variations thereof are intended to cover non-exclusive inclusion, so that a process, method, commodity or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, commodity or device. In the absence of more restrictions, the elements defined by the sentence "comprises a ..." do not exclude the existence of other identical elements in the process, method, commodity or device including the elements.
[0109] The above are only implementation methods of the present application, and are not intended to limit the patent scope of the present application. Any equivalent structure or equivalent process transformation made using the contents of the present application specification and drawings, or directly or indirectly applied in other related technical fields, are also included in the patent protection scope of the present application.
Claims
1. An image privacy masking method, characterized in that: The method comprises: In the case where a new privacy target is identified from the current frame image, obtaining a position of the new privacy target in the current frame image and a preset frame image, wherein the preset frame image is an image of a preset frame after the current frame image where the new privacy target exists; Based on the positions of the new privacy target in the current frame image and the preset frame image, shielding the new privacy target in a predetermined number of frame images before the current frame image; The predetermined number is an integer value obtained by subtracting the time when the new privacy target first appears from the time of the current frame image and multiplying it by the image acquisition frame rate; The step of shielding the new privacy target in a predetermined number of frame images before the current frame image based on the position of the new privacy target in the current frame image and the preset frame image includes: Based on the positions of the new privacy target in the current frame image and the preset frame image, calculating the positions of the new privacy target in a predetermined number of frame images before the current frame image; Based on the position of the new privacy object in the predetermined number of image frames, the new privacy object in the predetermined number of image frames is shielded.
2. The method according to claim 1, characterized in that: The calculating, based on the position of the new privacy target in the current frame image and the preset frame image, the position of the new privacy target in a predetermined number of frame images before the current frame image comprises: Calculating a position change speed of the new privacy target based on a position difference between the current frame image and the preset frame image of the new privacy target; The position of the new privacy target in a predetermined number of frame images before the current frame image is calculated based on the position change speed of the new privacy target.
3. The method according to claim 1, characterized in that: The device to which the method is applied includes a buffer for storing an image to be encoded; In the case where a new privacy target is identified from the current frame image, obtaining the position of the new privacy target in the current frame image and the preset frame image, the method includes: performing privacy target identification on the current frame image to obtain a privacy target identification result of the current frame image; The step of identifying the privacy target on the current frame image further includes: shielding the privacy target on the current frame image based on the privacy target identification result of the current frame image; sending the current frame image shielded by the privacy target into the buffer, and sending the head of the queue in the buffer to the encoder; The shielding of the new privacy target in the predetermined number of frame images includes: shielding the new privacy target in a predetermined number of frame images before the current frame image in the buffer.
4. The method according to claim 3, characterized in that The method further comprises: If it is confirmed based on the privacy target recognition result of the current frame image that the new privacy target is not recognized from the current frame image, the next frame of the current frame image is used as the current frame image, and the step of performing privacy target recognition on the current frame image is returned to be executed.
5. The method according to claim 3, characterized in that: The obtaining the position of the new privacy target in the current frame image and the preset frame image includes: The privacy target is identified on the preset frame image to obtain the privacy target identification result of the preset frame image.
6. The method according to claim 5, characterized in that The preset frame image is the next frame of the current frame image; The step of masking the new privacy target in the predetermined number of frames of images comprises: The next frame is used as the current frame image, and the step of performing privacy object shielding on the current frame image based on the privacy object recognition result of the current frame image is returned.
7. The method according to any one of claims 3 to 6, characterized in that: Privacy targets include display screens.
8. The method according to claim 7, characterized in that The privacy target identification includes: Identify the display screen in the image; Check whether the brightness of each display area in the image exceeds a threshold; Display screens with brightness exceeding a threshold are regarded as privacy targets in the image, while display screens with brightness below the threshold are not regarded as privacy targets in the image.
9. An electronic device, characterized in that: The electronic device comprises a processor, and the processor is used to execute instructions to implement the steps of the method according to any one of claims 1-8.
10. A computer-readable storage medium having instructions and / or program data stored thereon, characterized in that: When the instructions and / or program data are executed, the steps of the method according to any one of claims 1 to 8 are implemented.
