Privacy masking method and apparatus, and readable storage medium
By calculating the camera's field of view and the coordinates of the privacy area selected by the user, the privacy area in video surveillance is masked in real time using a masking method. This solves the problems of incomplete privacy protection and the inability of users to selectively mask areas in existing technologies, achieving efficient and secure privacy protection.
Patent Information
- Application Number
- PCT/CN2024/143315
- Authority / Receiving Office
- WO · WO
- Patent Type
- Applications
- Current Assignee / Owner
- Priority Date
- 2024-08-08
- Filing Date
- 2024-12-27
- Publication Date
- 2026-02-12
AI Technical Summary
Existing video surveillance technology has several shortcomings in protecting personal privacy, including incomplete coverage of private areas, limited versatility of automated masking, and the inability of users to selectively mask areas.
By acquiring real-time video data streams from cameras, calculating the horizontal and vertical field of view of the cameras, determining the imaging area, and calculating the actual coordinates of the privacy areas selected by the user within the imaging area, masking is performed, and the processed video data stream is uploaded to the cloud.
It enables real-time privacy protection during video capture, prevents privacy leaks, improves data storage security, saves computing resources and costs, and enhances users' autonomy, choice, and flexibility.
Smart Images

Figure CN2024143315_12022026_PF_FP_ABST
Abstract
Description
Privacy shielding method and device and readable storage medium
[0001] The present disclosure claims priority to Chinese Patent Application No. 202411087789.9, filed on August 8, 2024, the entire contents of which are incorporated herein by reference. TECHNICAL FIELD
[0002] The present disclosure relates to the technical field of video monitoring, and in particular to a privacy shielding method and device and readable storage medium. BACKGROUND
[0003] With the rapid development and wide application of video monitoring technology, it plays an increasingly important role in public safety, urban management, traffic monitoring and other fields. However, when video monitoring equipment collects and transmits video images, it inevitably involves the protection of personal privacy. Therefore, how to effectively shield the privacy area in the video while ensuring the monitoring effect has become a technical problem to be solved in the field of video monitoring. SUMMARY
[0004] In a first aspect, the present disclosure provides a privacy shielding method, which comprises:
[0005] collecting a video data stream of a camera in real time;
[0006] determining an imaging area of the camera according to a horizontal field of view angle and a vertical field of view angle of the camera;
[0007] calculating actual coordinates of a privacy area to be shielded in the imaging area according to a user's frame selection;
[0008] for each frame of image in the video data stream, shielding the privacy area by using a mask method according to the actual coordinates of the privacy area in the imaging area;
[0009] uploading the video data stream after shielding to the cloud.
[0010] Further, before the step of determining the imaging area of the camera according to the horizontal field of view angle and the vertical field of view angle of the camera, the method further comprises:
[0011] calculating the horizontal field of view angle and the vertical field of view angle of the camera according to the width and height of an image sensor in the camera and the focal length of a lens.
[0012] Further, the step of calculating the horizontal field of view angle and the vertical field of view angle of the camera according to the width and height of the image sensor in the camera and the focal length of the lens can comprise:
[0013] The horizontal field of view angle of the camera is calculated according to the following formula:
[0014] In the formula, W is the horizontal field of view angle of the camera, ω is the width of the image sensor, and f is the focal length of the lens.
[0015] The vertical field of view angle of the camera is calculated according to the following formula:
[0016] In the formula, H is the vertical field of view angle of the camera, and h is the height of the image sensor.
[0017] Further, the determination of the imaging area of the camera according to the horizontal field of view angle and the vertical field of view angle of the camera can include:
[0018] determination of the coordinate range of the imaging area of the camera in the horizontal direction according to the X-axis coordinate of the position of the camera on the plane and the horizontal field of view angle of the camera; and
[0019] determination of the coordinate range of the imaging area of the camera in the vertical direction according to the Y-axis coordinate of the position of the camera on the plane and the vertical field of view angle of the camera.
[0020] Further, the calculation of the actual coordinates of the privacy area in the imaging area according to the privacy area that needs to be occluded by the user's box selection can include:
[0021] obtaining a rectangular privacy area that needs to be occluded by the user's box selection;
[0022] determination of the coordinates of the two vertices of the rectangular privacy area corresponding to the line;
[0023] normalization of the coordinates of the two vertices according to the resolution of the video image in the camera;
[0024] obtaining the actual coordinates of the normalized two vertices in the imaging area according to the normalized coordinates of the two vertices and the width and height of the image sensor;
[0025] calculation of the actual coordinates of the privacy area in the imaging area according to the actual coordinates of the normalized two vertices in the imaging area.
[0026] Further, the method further includes:
[0027] obtaining the offset angle of the camera adjusted by the user;
[0028] determination of the new imaging area of the camera according to the offset angle of the adjusted camera;
[0029] determining whether the new imaging area contains the privacy area;
[0030] in response to the new imaging area containing the privacy area, obtaining relative coordinates of the privacy area in the new imaging area;
[0031] masking the privacy area according to the relative coordinates of the privacy area in the new imaging area.
[0032] Further, the determination of whether the new imaging area contains the privacy area can include:
[0033] obtaining a coordinate correspondence relationship between the original imaging area and the new imaging area;
[0034] determining whether the privacy area is contained in the new imaging area according to the coordinate correspondence relationship.
[0035] In a second aspect, the present disclosure provides a privacy masking device, which includes:
[0036] a data stream acquisition module, configured to acquire a video data stream of a camera in real time;
[0037] an imaging area acquisition module, connected to the data stream acquisition module, configured to determine an imaging area of the camera according to a horizontal field of view and a vertical field of view of the camera;
[0038] a privacy coordinate calculation module, connected to the imaging area acquisition module, configured to calculate actual coordinates of a privacy area in the imaging area according to the privacy area selected by a user for masking;
[0039] a privacy area masking module, connected to the privacy coordinate calculation module, configured to mask the privacy area according to the actual coordinates of the privacy area in the imaging area by using a mask method for each frame of image in the video data stream;
[0040] a data stream uploading module, connected to the privacy area masking module, configured to upload the video data stream after masking to a cloud.
[0041] In a third aspect, the present disclosure provides a privacy masking device, which includes a memory and a processor, the memory stores a computer program, and the processor is configured to run the computer program to implement the privacy masking method of the first aspect.
[0042] In a fourth aspect, the present disclosure provides a computer readable storage medium, which stores a computer program, and the computer program is executed by a processor to implement the privacy masking method of the first aspect.
[0043] In a fifth aspect, the present disclosure provides a computer program product comprising computer program instructions which, when executed by a processor, implement the privacy shielding method of the first aspect.
[0044] In a sixth aspect, the present disclosure provides a computer program comprising computer program instructions which, when executed by a processor, implement the privacy shielding method of the first aspect. BRIEF DESCRIPTION OF DRAWINGS
[0045] Fig. 1 is a flow chart of a privacy shielding method according to an embodiment of the present disclosure.
[0046] Fig. 2 is a flow chart of another privacy shielding method according to an embodiment of the present disclosure.
[0047] Fig. 3 is a flow chart of a privacy shielding processing step when a camera moves according to an embodiment of the present disclosure.
[0048] Fig. 4 is a structural schematic diagram of a privacy shielding device according to an embodiment of the present disclosure.
[0049] Fig. 5 is a structural schematic diagram of a privacy shielding device according to an embodiment of the present disclosure. DETAILED DESCRIPTION
[0050] In order to make the technical solution of the present disclosure better understood by those skilled in the art, the embodiments of the present disclosure will be further described in detail below with reference to the accompanying drawings.
[0051] It can be understood that the specific embodiments and the accompanying drawings described herein are only used to explain the present disclosure, but not to limit the present disclosure.
[0052] It can be understood that the embodiments in the present disclosure and the features in the embodiments can be combined with each other without conflict.
[0053] It can be understood that, for the convenience of description, only parts related to the present disclosure are shown in the drawings of the present disclosure, and parts unrelated to the present disclosure are not shown in the drawings.
[0054] It can be understood that each unit and module involved in the embodiments of the present disclosure can only correspond to one entity structure, or can be composed of multiple entity structures, or multiple units and modules can also be integrated into one entity structure.
[0055] It can be understood that the terms "first", "second" and the like in the embodiments of the present disclosure are used to distinguish different objects, or to distinguish different treatments of the same object, but not to describe a specific order of the objects.
[0056] It can be understood that the functions, steps in the flowcharts and block diagrams of the present disclosure can occur in an order different from that indicated in the accompanying drawings, without conflict.
[0057] It can be understood that the flowcharts and block diagrams of the present disclosure show the architecture, functions and operations of the implementation of the system, device, equipment and method according to the embodiments of the present disclosure. Each block in the flowchart or block diagram can represent a unit, module, program segment, code, which contains executable instructions for implementing the specified function. Moreover, each block or combination of blocks in the block diagram and flowchart can be implemented by a hardware-based system for implementing the specified function, or by a combination of hardware and computer instructions.
[0058] It can be understood that the units and modules involved in the embodiments of the present disclosure can be implemented in software or hardware, for example, the units and modules can be located in a processor.
[0059] Some privacy shielding methods mainly use various technical means and method steps to shield the privacy area in the video image. One means is to manually shield the monitoring camera, which often uses the cover provided with the camera or the camera shell. This method requires the operator to manually cover the shielding cover when needed, which can easily make the camera completely lose the monitoring value. Another technical means is to shield the original video uploaded to the cloud or client, which is most likely to be leaked during video transmission and storage. This stage cannot achieve privacy protection, and the operator transmission and cloud storage cannot be exempted from liability. In the method of automatically detecting and shielding the privacy area by image processing algorithm, the human body and face are usually automatically recognized and detected, and then shielded, or in the medical field, the content to be shielded in the specific application scenario is recognized and shielded. Although this method has high automation level, it is not strong in universality, and users cannot select the shielding.
[0060] Embodiment 1:
[0061] The embodiment provides a privacy shielding method, as shown in FIG. 1, which comprises S101 to S105.
[0062] In S101, the video data stream of the camera is collected in real time.
[0063] In this embodiment, the user adjusts the camera to the area to be monitored, and obtains the video data stream collected in real time.
[0064] In S102, the imaging area of the camera is determined according to the horizontal field of view angle and the vertical field of view angle of the camera.
[0065] In this embodiment, the monitoring range of the camera can be described by the calculated field of view angle.
[0066] In some embodiments, before determining the imaging area of the camera according to the horizontal field of view and the vertical field of view of the camera, the method further comprises:
[0067] calculating the horizontal field of view and the vertical field of view of the camera according to the width and the height of the image sensor and the focal length of the lens in the camera.
[0068] In this embodiment, the horizontal field of view of the camera can be calculated according to the following formula:
[0069] In the formula, W is the horizontal field of view of the camera, ω is the width of the image sensor, and f is the focal length of the lens.
[0070] The vertical field of view of the camera can be calculated according to the following formula:
[0071] In the formula, H is the vertical field of view of the camera, and h is the height of the image sensor.
[0072] In some embodiments, the determination of the imaging area of the camera according to the horizontal field of view and the vertical field of view of the camera can comprise:
[0073] determining the coordinate range of the imaging area of the camera in the horizontal direction according to the X-axis coordinate of the position of the camera on the plane and the horizontal field of view of the camera; and,
[0074] determining the coordinate range of the imaging area of the camera in the vertical direction according to the Y-axis coordinate of the position of the camera on the plane and the vertical field of view of the camera.
[0075] In this embodiment, it is assumed that the position of the camera on the plane is (x cam ,y cam ,h cam ), and the coordinate range of the imaging area can be represented in the following manner:
[0076] At a certain distance D (referring to the distance between the camera and the object being photographed), the coordinate range of the imaging area of the camera in the horizontal direction is:
[0077] At a certain distance D, the coordinate range of the imaging area of the camera in the vertical direction is:
[0078] In S103, the actual coordinates of the privacy area in the imaging area are calculated according to the need for the privacy area to be occluded by the user's frame selection.
[0079] In the embodiment, the user can define a privacy area in the video imaging that needs to be shielded, thereby improving the user's autonomous selection.
[0080] In some embodiments, the calculating the actual coordinates of the privacy area in the imaging area according to the user's selection of the privacy area to be shielded can include:
[0081] obtaining a rectangular privacy area selected by the user and needing to be shielded;
[0082] determining the coordinates of two vertices corresponding to the rectangular privacy area;
[0083] normalizing the coordinates of the two vertices according to the resolution of the video image in the camera;
[0084] obtaining the actual coordinates of the normalized two vertices in the imaging area according to the normalized coordinates of the two vertices and the width and height of the image sensor;
[0085] calculating the actual coordinates of the privacy area in the imaging area according to the actual coordinates of the normalized two vertices in the imaging area.
[0086] In the embodiment, the two vertices are, for example, the upper left corner and the lower right corner of a rectangular privacy area, and it is assumed that the resolution of the video image is I ω ×I h , the coordinates of a vertex are (x, y), and the normalized coordinates in the interval [-1, 1] are calculated according to the following formula:
[0087] In the embodiment, the actual coordinates of the normalized two vertices in the imaging area can be calculated according to the following formula:
[0088] In S104, for each frame of image in the video data stream, the privacy area is shielded by using a mask method according to the actual coordinates of the privacy area in the imaging area.
[0089] In the embodiment, according to the obtained actual coordinates of the privacy area, a mask of the same size as the area is designed, and the mask is superimposed on the privacy area of the original image collected by the camera. In addition or alternatively, the mask can be superimposed on the original image collected by the camera, and in the superimposition process, the transparency of the mask will act on the corresponding area of the original image. The part of the mask outside the privacy area is set to be transparent, and the part of the mask inside the privacy area is set to be completely shielded.
[0090] In the embodiment, the occlusion method can also use different occlusion methods such as blur, pixelation, black occlusion block, etc. to process the privacy area.
[0091] In S105, the occlusion-processed video data stream is uploaded to the cloud.
[0092] In some embodiments, the method further comprises:
[0093] obtaining the offset angle of the camera adjusted by the user;
[0094] determining a new imaging area of the camera according to the offset angle of the adjusted camera;
[0095] determining whether the new imaging area contains the privacy area;
[0096] in response to the new imaging area containing the privacy area, obtaining the relative coordinates of the privacy area in the new imaging area;
[0097] occluding the privacy area using a mask method according to the relative coordinates of the privacy area in the new imaging area.
[0098] In the embodiment, in order to ensure that only the user-delineated area is occluded for privacy when the camera moves, without affecting the display of information in other areas, the above steps are further included, wherein the offset angle includes a horizontal field of view angle and a vertical field of view angle.
[0099] In some embodiments, the determination of whether the new imaging area contains the privacy area can include:
[0100] obtaining the coordinate correspondence relationship between the original imaging area and the new imaging area;
[0101] determining whether the privacy area is contained in the new imaging area according to the coordinate correspondence relationship.
[0102] In the embodiment, the coordinate correspondence relationship between the original imaging area and the new imaging area can be calculated according to the following formula:
[0103] In the formula, W1 is the new horizontal field of view angle of the camera adjusted by the user, H1 is the new vertical field of view angle of the camera adjusted by the user, W and H are the original horizontal field of view angle and vertical field of view angle, (x t ,y t ) is a coordinate point in the original imaging area, and (x new , y new ) is the corresponding coordinate point in the new imaging area.
[0104] The privacy shielding method provided by the embodiments of the present disclosure can shield the privacy of a video during video acquisition, and can calculate the rotation angle of a camera in real time and adjust the privacy area that needs to be shielded according to the rotation angle. Compared with a method of automatically detecting and shielding a privacy area by using an image processing algorithm, the present disclosure can save computing resources, and the camera does not need to be installed with a chip with higher computing power, thereby saving costs.
[0105] In one embodiment, the privacy shielding method is applied to a privacy shielding system for shielding the privacy of a video acquired by a camera. The system includes a video acquisition module, a rotation angle calculation module, a privacy area setting module, and a shielding processing module. The modules are described as follows.
[0106] The video acquisition module is configured to acquire a video signal in real time.
[0107] The rotation angle calculation module is connected to the video acquisition module and is configured to calculate the rotation angle of the camera in real time and record the offset angle and direction.
[0108] The privacy area setting module allows a user to customize an area and record the coordinates of the area in a picture.
[0109] The shielding processing module is connected to the rotation angle calculation module and the privacy area setting module, and is configured to shield the corresponding area in the video according to the rotation angle of the camera and the coordinates of the set privacy area.
[0110] As shown in FIG. 2, the privacy shielding method includes the following steps.
[0111] 1. Acquire a real-time video signal.
[0112] 2. Record the offset angle of the camera.
[0113] 3. Draw a privacy area by a user.
[0114] 4. Obtain the coordinate information of the privacy area in the video area.
[0115] 5. Shield the privacy area.
[0116] 6. Upload a real-time video stream to the cloud.
[0117] In another embodiment, the privacy shielding method can include the following S11 to S16.
[0118] In S11, a user adjusts the camera to a desired monitoring area, and acquires a real-time video data stream.
[0119] In S12, the horizontal field of view angle and the vertical field of view angle of the camera are recorded.
[0120] The horizontal field of view angle is calculated. Vertical field of view where ω is the width of the image sensor, h is the height of the image sensor, and f is the focal length of the lens. Although the calculated field of view can be slightly smaller than the actual field of view, this difference can be ignored. We will describe the monitoring range of the camera in terms of the calculated field of view.
[0121] For example, the imaging size of a 1 / 2.7 inch CMOS image sensor is ω x h = 5.27 mm x 3.96 mm.
[0122] In S13, the user customizes the frame selection of the area that needs to be blocked for privacy, i.e., the user uses a rectangular frame to block the area that needs to be blocked.
[0123] In S14, the coordinate point information of the privacy area selected by the user is obtained.
[0124] 1) Obtain the imaging area of the camera video
[0125] According to the parameters of S12, the imaging area width Imaging area height
[0126] Assuming the position of the camera on the plane is (x cam ,y cam ,h cam ), the coordinate range of the imaging area can be represented as follows:
[0127] At a certain distance D, the coordinate range of the imaging area of the camera in the horizontal direction is:
[0128] At a certain distance D, the coordinate range of the imaging area of the camera in the vertical direction is:
[0129] 2) Calculate the actual coordinates of the two vertices on the diagonal of the user's calibration rectangle in the imaging area
[0130] The two vertices (x1, y1) and (x2, y2) on the diagonal of the rectangle are converted to the actual coordinates in the imaging area through the following conversion steps.
[0131] In order to convert the pixel coordinates (x, y) in the image to the coordinates in the actual imaging area, the image resolution needs to be considered. For example, assume that the resolution of the image is I ω x I h .
[0132] The coordinate formula for normalizing the pixel coordinates (x, y) in the image to the [-1, 1] interval is:
[0133] The formula for converting normalized coordinates to physical coordinates of the actual imaging area is:
[0134] In S15, the video stream of the selected area range (i.e., the privacy area) is occluded.
[0135] The selected area is occluded using a mask method. For each frame of the video stream, a mask of the same size as the selected area is designed according to the obtained privacy area coordinate information, and the mask is superimposed on the privacy area of the original image captured by the camera.
[0136] In addition or alternatively, the mask is superimposed with the original image captured by the camera, and during the superimposition process, the transparency of the mask will act on the corresponding area of the original image. The part of the mask outside the privacy area is set to be transparent, and the part of the mask inside the privacy area is set to be completely occluded.
[0137] In S16, the video stream processed through the above steps is uploaded to the cloud in real time.
[0138] Through the above steps, the user's frame is realized to perform privacy occlusion when the fixed area is drawn, and the normal display outside the frame is realized.
[0139] Further, in order to ensure that only the user-drawn area is privacy-occluded when the camera moves without affecting the information display of other areas, the privacy-occlusion processing steps when the camera moves are further included, as shown in FIG. 3, including S21 to S25.
[0140] In S21, the real-time captured video signal is obtained. When the camera stops rotating, the video signal captured at this time is obtained.
[0141] In S22, the camera offset angle adjusted by the current user is obtained.
[0142] After the camera rotates, the horizontal field of view angle W1 and the vertical field of view angle H1 reaching the new position are recorded, and the same calculation method as S12 is used.
[0143] In S23, it is judged whether the current imaging area contains a privacy area.
[0144] 1) Calculate the current imaging area. According to W1 and H1 in S22, calculate the imaging area contained by the current area, and calculate according to 1) in S14.
[0145] 2) Calculate the coordinate point of the selected area in the original area under the new angle. For a coordinate point (x t ,y t ) in the imaging area when the horizontal field of view angle and the vertical field of view angle are W and H, it should correspond to the coordinate (x new , ynew ) are:
[0146] 3) Compare the new coordinate point with the current imaging area.
[0147] Put the two vertices (x1, y1) and (x2, y2) on the diagonal of the rectangle into the calculation of 2), and the corresponding x new1 , x new2 , y new1 , y new2 obtained in 1) are compared, and for each vertex (x', y') in the rectangular area, it is checked whether the rectangular area is completely contained in the imaging area: x min ≤ x' ≤ x max y min ≤ y' ≤ y max
[0148] and it is checked whether the edges of the rectangular area are within the imaging area.
[0149] If the new corresponding coordinates obtained are not within the current imaging area, no processing is performed. If they are contained in the current imaging area, processing is performed through S24.
[0150] In S24, the relative coordinates of the privacy area corresponding to the current imaging area are recorded according to the values calculated in S23.
[0151] In S25, the privacy area is shielded.
[0152] 1) Recalculate the coordinates of the privacy area in the current imaging area.
[0153] According to 3) of S23, if the rectangular area is completely contained in the imaging area, the current privacy area coordinate range is obtained according to the calculation of 2) of S23. If the rectangular area is partially contained in the imaging area, it is checked according to the boundary intersection checking formula which part of the rectangular area intersects with the boundary of the imaging area, and then the coordinates of the privacy area are obtained according to the coordinates of the points contained in the imaging area and the intersecting boundary.
[0154] 2) Shield the privacy area using the mask method.
[0155] A mask of the same size as the privacy area obtained in 1) is designed, and the mask is superimposed on the privacy area of the original image captured by the camera. In addition or alternatively, the mask can be superimposed on the original image captured by the current angle camera, and during the superimposition process, the part of the mask outside the shielding area is set to be transparent, and the part of the mask inside the shielding area is set to be completely shielded.
[0156] It should be noted that the privacy shielding method provided by the present disclosure has the following characteristics:
[0157] a) Chip-level computing characteristic design: The present disclosure designs the computing characteristics of privacy shielding at the camera chip level, and uses the horizontal field of view and the vertical field of view of the camera to perform real-time calculation. This design simplifies the processing process, avoids complex post-processing, greatly reduces the consumption of computing resources and the cost of equipment, and thus improves the efficiency of the overall system.
[0158] b) Shielding calculation combined with the physical characteristics of the camera: The present disclosure determines the monitoring range by calculating the horizontal field of view and the vertical field of view of the camera, and uses the formula horizontal field of view vertical field of view to calculate the field of view, where ω is the image sensor width, h is the image sensor height, and f is the focal length. This method directly uses the physical characteristics of the camera to calculate the privacy shielding, avoids additional complex calculations, and improves the calculation efficiency and accuracy.
[0159] c) Self-selective area shielding: Users can mark the privacy area that needs to be shielded in the video imaging. The present disclosure can calculate the relative position of the area in the imaging range according to the area marked by the user and the rotation angle of the camera, and perform shielding processing on the position. This method enhances the self-selectivity and flexibility of privacy shielding, allowing users to dynamically adjust the privacy area according to actual needs.
[0160] d) Real-time video stream privacy shielding: During the video acquisition process of the camera, real-time privacy shielding processing is performed on the video stream to ensure that privacy shielding processing has been completed before the video data is uploaded to the cloud, thereby realizing natural exemption of data. This not only improves the security of data storage, but also protects the privacy of users and avoids the risk of privacy leakage.
[0161] The privacy shielding method provided by the embodiments of the present disclosure first collects a video data stream of a camera in real time; then determines an imaging area of the camera according to a horizontal field of view and a vertical field of view of the camera; then calculates actual coordinates of a privacy area that needs to be shielded in the imaging area according to the privacy area selected by a user; finally, for each frame of image in the video data stream, the privacy area is shielded by using a mask method according to the actual coordinates of the privacy area in the imaging area; and the video data stream after shielding is uploaded to the cloud. The present disclosure can shield the privacy of the video data stream in real time during the process of collecting the video by the camera, ensure that the privacy shielding has been completed before the video data is uploaded to the cloud, avoid the risk of privacy leakage, and improve the security of data storage. At the same time, the user can customize the selection of the privacy area that needs to be shielded, improving the user's autonomous selection. In addition, compared with the method of automatically detecting and shielding the privacy area by using an image processing algorithm, since the camera does not need to install a chip with higher computing power, the present disclosure can save computing resources and costs, and solve the problems of the existing privacy shielding methods, such as the risk of privacy leakage and the user's inability to selectively shield.
[0162] Embodiment 2
[0163] As shown in FIG. 4, the present embodiment provides a privacy shielding device for executing the above-mentioned privacy shielding method, comprising:
[0164] A data stream collection module 11 is configured to collect a video data stream of a camera in real time.
[0165] An imaging area acquisition module 12 is connected with the data stream collection module 11 and configured to determine an imaging area of the camera according to a horizontal field of view and a vertical field of view of the camera.
[0166] A privacy coordinate calculation module 13 is connected with the imaging area acquisition module 12 and configured to calculate actual coordinates of a privacy area that needs to be shielded in the imaging area according to the privacy area selected by a user.
[0167] A privacy area shielding module 14 is connected with the privacy coordinate calculation module 13 and configured to shield the privacy area by using a mask method according to the actual coordinates of the privacy area in the imaging area for each frame of image in the video data stream.
[0168] A data stream uploading module 15 is connected with the privacy area shielding module 14 and configured to upload the video data stream after shielding to the cloud.
[0169] In some embodiments, the device further comprises:
[0170] A field of view angle calculation module is configured to calculate a horizontal field of view angle and a vertical field of view angle of the camera according to a width and a height of an image sensor in the camera and a focal length of a lens.
[0171] In some embodiments, the field of view angle calculation module can include:
[0172] A first calculation unit is configured to calculate the horizontal field of view angle of the camera according to the following formula:
[0173] wherein W is the horizontal field of view angle of the camera, ω is the width of the image sensor, and f is the focal length of the lens.
[0174] A second calculation unit is configured to calculate the vertical field of view angle of the camera according to the following formula:
[0175] wherein H is the vertical field of view angle of the camera, and h is the height of the image sensor.
[0176] In some embodiments, the imaging area acquisition module 12 can include:
[0177] A horizontal range determination unit is configured to determine a coordinate range of the imaging area of the camera in a horizontal direction according to an X-axis coordinate of a position of the camera on a plane and the horizontal field of view angle of the camera.
[0178] A vertical range determination unit is configured to determine a coordinate range of the imaging area of the camera in a vertical direction according to a Y-axis coordinate of the position of the camera on the plane and the vertical field of view angle of the camera.
[0179] In some embodiments, the privacy coordinate calculation module 13 can include:
[0180] An area acquisition unit is configured to acquire a privacy area of a rectangle selected by a user and needed to be occluded.
[0181] A coordinate determination unit is configured to determine coordinates of two vertices of a line corresponding to the privacy area of the rectangle.
[0182] A normalization unit is configured to normalize the coordinates of the two vertices according to a resolution of a video image in the camera.
[0183] A first obtaining unit is configured to obtain actual coordinates of the normalized two vertices in the imaging area according to the normalized coordinates of the two vertices and the width and the height of the image sensor.
[0184] An actual coordinate calculation unit is configured to calculate actual coordinates of the privacy region in the imaging region according to the normalized coordinates of the two vertices in the imaging region.
[0185] In some embodiments, the apparatus further comprises:
[0186] An adjustment parameter obtaining module is configured to obtain an adjusted offset angle of the camera.
[0187] A new region determining module is configured to determine a new imaging region of the camera according to the adjusted offset angle of the camera.
[0188] A judging module is configured to judge whether the new imaging region contains the privacy region.
[0189] A relative coordinate obtaining module is configured to, in response to the new imaging region containing the privacy region, obtain relative coordinates of the privacy region in the new imaging region.
[0190] A new obscuring module is configured to obscure the privacy region by using a mask method according to the relative coordinates of the privacy region in the new imaging region.
[0191] In some embodiments, the judging module comprises:
[0192] A coordinate correspondence obtaining unit is configured to obtain a coordinate correspondence between the original imaging region and the new imaging region.
[0193] A judging unit is configured to judge whether the privacy region is contained in the new imaging region according to the coordinate correspondence.
[0194] Embodiment 3
[0195] Referring to FIG. 5, this embodiment provides a privacy obscuring apparatus, which comprises a memory 21 and a processor 22. The memory 21 stores a computer program, and the processor 22 is configured to run the computer program to perform the privacy obscuring method in Embodiment 1.
[0196] The memory 21 is connected to the processor 22. The memory 21 can be a flash memory or a read-only memory or other memory, and the processor 22 can be a central processing unit or a single-chip microcomputer.
[0197] Embodiment 4
[0198] This embodiment provides a computer readable storage medium (including a non-transitory computer readable storage medium), which stores a computer program. When the computer program is executed by a processor, the privacy obscuring method in Embodiment 1 is implemented.
[0199] The computer-readable storage medium includes volatile or non-volatile, removable or non-removable media implemented in any method or technology for storage of information such as computer readable instructions, data structures, computer program modules or other data. The computer-readable storage medium includes, but is not limited to, RAM (Random Access Memory), ROM (Read-Only Memory), EEPROM (Electrically Erasable Programmable read only memory), flash memory or other memory technology, CD-ROM (Compact Disc Read-Only Memory), digital versatile disc (DVD) or other optical disc storage, magnetic cassettes, magnetic tapes, magnetic disk storage or other magnetic storage devices, or any other medium that can be used to store the desired information and can be accessed by a computer.
[0200] In summary, the privacy shielding method, device and readable storage medium provided by the embodiments of the present disclosure first collect the video data stream of the camera in real time; then determine the imaging area of the camera according to the horizontal field of view and the vertical field of view of the camera; then calculate the actual coordinates of the privacy area in the imaging area according to the privacy area that needs to be shielded by the user's frame selection; finally, for each frame of image in the video data stream, the privacy area is shielded by using the mask method according to the actual coordinates of the privacy area in the imaging area; and the video data stream after shielding processing is uploaded to the cloud. The present disclosure can shield the privacy of the video data stream in real time during the process of collecting the video by the camera, ensure that the privacy shielding processing has been completed before the video data is uploaded to the cloud, avoid the risk of privacy leakage, and improve the security of data storage. At the same time, the user can customize the frame selection of the privacy area that needs to be shielded, improving the user's autonomous selection. In addition, compared with the method of automatically detecting and shielding the privacy area by using image processing algorithm, since the camera does not need to install a chip with higher computing power, the present disclosure can save computing resources and cost, and solve the problems of existing privacy shielding methods, such as the risk of privacy leakage and the user's inability to choose to shield.
[0201] It can be understood that the above embodiments are only exemplary embodiments adopted to illustrate the principles of the present disclosure, but the present disclosure is not limited thereto. Various modifications and improvements can be made by those of ordinary skill in the art without departing from the essence of the present disclosure, and these modifications and improvements are also considered within the protection scope of the present disclosure.
Claims
1. A method for privacy blocking, comprising: collecting a video data stream of a camera in real time; determining an imaging area of the camera according to a horizontal field of view and a vertical field of view of the camera; calculating actual coordinates of a privacy area in the imaging area according to a rectangle of the privacy area that needs to be blocked as selected by a user; blocking the privacy area according to the actual coordinates of the privacy area in the imaging area by using a mask method for each frame of the video data stream; uploading the video data stream after blocking to a cloud.
2. The method of claim 1, wherein, Before the determining the imaging area of the camera according to the horizontal field of view and the vertical field of view of the camera, the method further comprises: calculating the horizontal field of view and the vertical field of view of the camera according to a width and a height of an image sensor in the camera and a focal length of a lens.
3. The method of claim 2, wherein, The calculating the horizontal field of view and the vertical field of view of the camera according to the width and the height of the image sensor in the camera and the focal length of the lens comprises: The horizontal field of view angle of the camera is calculated according to the following formula: wherein W is the horizontal field of view of the camera, ω is the width of the image sensor, and f is the focal length of the lens; The vertical field of view angle of the camera is calculated according to the following formula: wherein H is the vertical field of view of the camera, and h is the height of the image sensor.
4. The method of any one of claims 1 to 3, wherein, The determining the imaging area of the camera according to the horizontal field of view and the vertical field of view of the camera comprises: determining a coordinate range of the imaging area of the camera in a horizontal direction according to an X-axis coordinate of a position of the camera on a plane and the horizontal field of view of the camera; and determining a coordinate range of the imaging area of the camera in a vertical direction according to a Y-axis coordinate of the position of the camera on the plane and the vertical field of view of the camera.
5. The method of any one of claims 1 to 4, wherein, The calculating the actual coordinates of the privacy area in the imaging area according to the rectangle of the privacy area that needs to be blocked as selected by the user comprises: obtaining the rectangle of the privacy area that needs to be blocked as selected by the user; determining coordinates of two vertices of the rectangle corresponding to the privacy area on a line; normalizing the coordinates of the two vertices according to a resolution of a video image in the camera; obtaining actual coordinates of the normalized two vertices in the imaging area according to the width and the height of the image sensor in the camera; calculating the actual coordinates of the privacy area in the imaging area according to the actual coordinates of the normalized two vertices in the imaging area. 6.The method according to any one of claims 1 to 5, further comprising: obtaining an adjusted offset angle of the camera by a user; determining a new imaging area of the camera according to the adjusted offset angle of the camera; judging whether the new imaging area contains the privacy area; in response to the new imaging area containing the privacy area, obtaining relative coordinates of the privacy area in the new imaging area; blocking the privacy area according to the relative coordinates of the privacy area in the new imaging area by using the mask method.
7. The method of claim 6, wherein, The judging whether the new imaging area contains the privacy area comprises: obtaining a coordinate correspondence relationship between an original imaging area and the new imaging area; According to the coordinate correspondence relationship, it is judged whether the privacy area is contained in the new imaging area.
8. A privacy shielding device, comprising: a data stream acquisition module configured to acquire a video data stream of a camera in real time; an imaging area acquisition module connected to the data stream acquisition module and configured to determine an imaging area of the camera according to a horizontal field of view and a vertical field of view of the camera; a privacy coordinate calculation module connected to the imaging area acquisition module and configured to calculate actual coordinates of a privacy area in the imaging area according to the privacy area selected by a user for shielding; a privacy area shielding module connected to the privacy coordinate calculation module and configured to shield the privacy area in the video data stream according to the actual coordinates of the privacy area in the imaging area by using a mask method for each frame of image in the video data stream; a data stream uploading module connected to the privacy area shielding module and configured to upload the video data stream after shielding to a cloud.
9. A privacy screening device comprising a memory and a processor, wherein, The memory stores a computer program, and the processor is configured to run the computer program to implement the privacy shielding method according to any one of claims 1-7.
10. A computer readable storage medium, wherein, The computer readable storage medium stores a computer program, and the computer program is executed by the processor to implement the privacy shielding method according to any one of claims 1-7.
11. A computer program product comprising computer program instructions which, when executed by a processor, implement the privacy shielding method according to any one of claims 1-7.
12. A computer program comprising computer program instructions which, when executed by a processor, implement the privacy shielding method according to any one of claims 1-7.
Citation Information
Patent Citations
Method and device for shielding privacy region of PTZ (Pan / Tilt / Zoom) surveillance camera
CN104038740A
Window blanking for pan / tilt / zoom camera
CN105144703A
Image processing method and apparatus for pan-tilt-zoom (PTZ) camera
CN106598078A
Image region shading method and device
CN107517360A
Image processing method and device, equipment and storage medium
CN115457115A