Privacy shielding method and device and readable storage medium
By collecting and processing camera video data streams in real time, masking and occluding them according to the privacy areas selected by users, the problems of privacy leakage and unselective occlusion in the existing technology are solved, and the secure upload and efficient privacy protection of video data are achieved. .
Patent Information
- Application Number
- CN202411087789.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-08-08
- Publication Date
- 2024-12-06
AI Technical Summary
The existing privacy occlusion methods pose a risk of privacy leakage and users cannot selective occlusion, and cannot effectively protect the privacy areas in the video while ensuring the monitoring effect.
By collecting the camera video data stream in real time, the imaging area is determined based on the horizontal field of view angle and vertical field of view angle of the camera. The user box selects the privacy area that needs to be blocked and calculates its actual coordinates in the imaging area. The video data is used by masking method. Each frame of the image in the stream is blocked and the processed video data stream is uploaded to the cloud.
Real-time privacy occlusion processing before video data is uploaded to the cloud, avoiding the risk of privacy leakage, improving the security of data storage, enhancing users' autonomous selectivity, and saving computing resources and costs.
Smart Images

Figure CN119094842A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of video surveillance technology, and in particular to a privacy shielding method, device and readable storage medium. Background Art
[0002] With the rapid development and widespread application of video surveillance technology, it plays an increasingly important role in public security, urban management, traffic monitoring and other fields. However, when video surveillance equipment collects and transmits video images, it inevitably involves the protection of personal privacy. Therefore, how to effectively block the privacy area in the video while ensuring the monitoring effect has become a technical problem that needs to be solved in the field of video surveillance.
[0003] Existing privacy masking methods mainly use a variety of technical means and method steps to achieve the masking of privacy areas in video images. A common method is to manually mask the surveillance camera, often using the camera's own cover or camera housing. This method requires the operator to manually cover the mask when needed, which can easily make the camera completely lose its monitoring value. Another technical method is to mask the original video of the camera after uploading it to the cloud or client. Video transmission and storage are most prone to leakage. Privacy protection cannot be achieved at this stage, and operators cannot be exempted from transmission and cloud storage. In the method of automatically detecting and masking privacy areas with image processing algorithms, it is usually to automatically identify and detect human bodies and faces, and then mask them, or in the medical field, identify and mask the content that needs to be masked in specific application scenarios. Although this method has a high level of automation, it is not very versatile, and users cannot perform selective masking. Summary of the invention
[0004] The technical problem to be solved by the present invention is to provide a privacy shielding method, device and readable storage medium in view of the above-mentioned deficiencies in the prior art, so as to solve the problem that the existing privacy shielding method has the risk of privacy leakage and the user cannot perform selective shielding.
[0005] In a first aspect, the present invention provides a privacy shielding method, the method comprising:
[0006] Collect the video data stream of the camera in real time;
[0007] Determining an imaging area of a camera according to a horizontal field of view angle and a vertical field of view angle of the camera;
[0008] Calculate the actual coordinates of the privacy area within the imaging area according to the privacy area that needs to be shielded and selected by the user;
[0009] For each frame of the video data stream, masking the privacy area according to the actual coordinates of the privacy area in the imaging area using a masking method;
[0010] Upload the video data stream after occlusion processing to the cloud.
[0011] Furthermore, before 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 includes:
[0012] The horizontal field of view angle and the vertical field of view angle of the camera are calculated according to the width and height of the image sensor in the camera and the focal length of the lens.
[0013] Further, the 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 specifically includes:
[0014] The horizontal field of view of the camera is calculated according to the following formula:
[0015]
[0016] Where 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;
[0017] The vertical field of view of the camera is calculated according to the following formula:
[0018]
[0019] Where H is the vertical field of view of the camera, and h is the height of the image sensor.
[0020] Further, 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 specifically includes:
[0021] 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,
[0022] The coordinate range of the imaging area of the camera in the vertical direction is determined according to the Y-axis coordinate of the position of the camera on the plane and the vertical field of view of the camera.
[0023] Furthermore, the calculating of the actual coordinates of the privacy area within the imaging area according to the privacy area to be shielded selected by the user specifically includes:
[0024] Get the privacy area of the rectangle selected by the user that needs to be blocked;
[0025] Determine the coordinates of two vertices on the line corresponding to the privacy area of the rectangle;
[0026] Normalizing the coordinates of the two vertices according to the resolution of the video image in the camera;
[0027] Obtaining actual coordinates of the normalized coordinates of the two vertices in the imaging area according to the normalized coordinates of the two vertices and the width and height of the image sensor;
[0028] The actual coordinates of the privacy area in the imaging area are calculated according to the actual coordinates of the normalized coordinates of the two vertices in the imaging area.
[0029] Furthermore, the method further comprises:
[0030] Get the offset angle of the camera adjusted by the user;
[0031] Determining a new imaging area of the camera according to the adjusted offset angle of the camera;
[0032] Determining whether the new imaging area includes the privacy area;
[0033] In response to the new imaging area including the privacy area, acquiring relative coordinates of the privacy area in the new imaging area;
[0034] The privacy area is shielded by using a mask method according to the relative coordinates of the privacy area in the new imaging area.
[0035] Further, the determining whether the new imaging area includes the privacy area specifically includes:
[0036] Acquire the coordinate correspondence between the original imaging area and the new imaging area;
[0037] It is determined whether the privacy area is included in the new imaging area according to the coordinate correspondence.
[0038] In a second aspect, the present invention provides a privacy shielding device, the device comprising:
[0039] Data stream acquisition module, used to acquire the video data stream of the camera in real time;
[0040] An imaging area acquisition module, connected to the data stream acquisition module, for 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;
[0041] A privacy coordinate calculation module, connected to the imaging area acquisition module, is used to calculate the actual coordinates of the privacy area within the imaging area according to the privacy area that needs to be shielded and selected by the user;
[0042] a privacy area shielding module, connected to the privacy coordinate calculation module, for shielding the privacy area by using a mask method according to the actual coordinates of the privacy area within the imaging area for each frame of the video data stream;
[0043] The data stream uploading module is connected to the privacy area shielding module and is used to upload the video data stream after shielding processing to the cloud.
[0044] In a third aspect, the present invention provides a privacy shielding 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 described in the first aspect.
[0045] In a fourth aspect, the present invention provides a computer-readable storage medium having a computer program stored thereon, and when the computer program is executed by a processor, the privacy shielding method described in the first aspect is implemented.
[0046] The privacy shielding method, device and readable storage medium provided by the present invention 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 selected by the user to be shielded; finally, for each frame of the video data stream, the privacy area is shielded by the 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 invention can perform privacy shielding processing on the video data stream in real time during the process of the camera collecting video, ensuring that the privacy shielding processing has been completed before the video data is uploaded to the cloud, avoiding the risk of privacy leakage and improving the security of data storage. At the same time, the user can customize the privacy area to be shielded, which improves the user's autonomous selectivity; in addition, compared with the method of automatically detecting and shielding the privacy area using the image processing algorithm, the present invention can save computing resources and costs because the camera does not need to install a chip with higher computing power, and solves the problem that the existing privacy shielding method has the risk of privacy leakage and the user cannot perform selective shielding. BRIEF DESCRIPTION OF THE DRAWINGS
[0047] Figure 1 This is a flowchart of a privacy shielding method according to Embodiment 1 of the present invention;
[0048] Figure 2This is a flow chart of another privacy shielding method according to Embodiment 1 of the present invention;
[0049] Figure 3 This is a flowchart of steps for processing privacy shielding when the camera moves according to Embodiment 1 of the present invention;
[0050] Figure 4 This is a schematic structural diagram of a privacy shielding device according to Embodiment 2 of the present invention;
[0051] Figure 5 This is a schematic structural diagram of a privacy shielding device according to Embodiment 3 of the present invention. DETAILED DESCRIPTION
[0052] In order to enable those skilled in the art to better understand the technical solution of the present invention, the embodiments of the present invention will be further described in detail below with reference to the accompanying drawings.
[0053] It should be understood that the specific embodiments and drawings described herein are only used to explain the present invention rather than to limit the present invention.
[0054] It can be understood that, in the absence of conflict, the various embodiments of the present invention and the various features in the embodiments can be combined with each other.
[0055] It can be understood that, for the convenience of description, the drawings of the present invention only show the parts related to the present invention, while the parts irrelevant to the present invention are not shown in the drawings.
[0056] It can be understood that each unit and module involved in the embodiments of the present invention may correspond to only one physical structure, or may be composed of multiple physical structures, or multiple units and modules may be integrated into one physical structure.
[0057] It can be understood that the terms "first", "second", etc. in the embodiments of the present invention are used to distinguish different objects, or to distinguish different processing of the same object, rather than to describe a specific order of objects.
[0058] It can be understood that, without conflict, the functions and steps marked in the flowcharts and block diagrams of the present invention may occur in an order different from that marked in the drawings.
[0059] It is understood that the flowcharts and block diagrams of the present invention illustrate the possible architectures, functions, and operations of the systems, devices, equipment, and methods according to the various embodiments of the present invention. Each box in the flowchart or block diagram may represent a unit, module, program segment, or code, which contains executable instructions for implementing the specified functions. Moreover, each box or combination of boxes in the block diagram and flowchart may be implemented by a hardware-based system that implements the specified functions, or may be implemented by a combination of hardware and computer instructions.
[0060] It can be understood that the units and modules involved in the embodiments of the present invention can be implemented by software or hardware. For example, the units and modules can be located in a processor.
[0061] Embodiment 1:
[0062] This embodiment provides a privacy shielding method, such as Figure 1 As shown, the method includes:
[0063] Step S101: Collect the video data stream of the camera in real time.
[0064] In this embodiment, the user adjusts the camera to the area that he wants to monitor and obtains the real-time collected video data stream.
[0065] Step S102: determining an imaging area of the camera according to the horizontal field of view angle and the vertical field of view angle of the camera.
[0066] In this embodiment, the monitoring range of the camera can be described by the calculated field of view angle.
[0067] Optionally, before 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 includes:
[0068] The horizontal field of view angle and the vertical field of view angle of the camera are calculated according to the width and height of the image sensor in the camera and the focal length of the lens.
[0069] In this embodiment, the horizontal field of view angle of the camera can be calculated according to the following formula:
[0070]
[0071] Where 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;
[0072] The vertical field of view of the camera is calculated according to the following formula:
[0073]
[0074] Where H is the vertical field of view of the camera, and h is the height of the image sensor.
[0075] Optionally, 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 specifically includes:
[0076] 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,
[0077] The coordinate range of the imaging area of the camera in the vertical direction is determined according to the Y-axis coordinate of the position of the camera on the plane and the vertical field of view of the camera.
[0078] In this embodiment, it is assumed that the position of the camera on the plane is (x cam ,y cam ,h cam ), the coordinate range of the imaging area can be expressed as follows:
[0079] At a specific distance D (the distance between the camera and the object), the coordinate range of the camera's imaging area in the horizontal direction is:
[0080]
[0081]
[0082] At a specific distance D, the coordinate range of the camera's imaging area in the vertical direction is:
[0083]
[0084]
[0085] Step S103: calculating the actual coordinates of the privacy area within the imaging area according to the privacy area that needs to be shielded and selected by the user.
[0086] In this embodiment, the user can define a privacy area that needs to be blocked in the video imaging, thereby improving the user's autonomous selectivity.
[0087] Optionally, the calculating the actual coordinates of the privacy area within the imaging area according to the privacy area to be shielded selected by the user specifically includes:
[0088] Get the privacy area of the rectangle selected by the user that needs to be blocked;
[0089] Determine the coordinates of two vertices on the line corresponding to the privacy area of the rectangle;
[0090] Normalizing the coordinates of the two vertices according to the resolution of the video image in the camera;
[0091] Obtaining actual coordinates of the normalized coordinates of the two vertices in the imaging area according to the normalized coordinates of the two vertices and the width and height of the image sensor;
[0092] The actual coordinates of the privacy area in the imaging area are calculated according to the actual coordinates of the normalized coordinates of the two vertices in the imaging area.
[0093] In this embodiment, two vertices are, for example, the upper left corner and the lower right corner of a rectangular privacy area. Assuming that the resolution of the video image is I ω ×I h , the coordinates of a vertex are (x, y), then the coordinate formula normalized to the interval [-1, 1] is:
[0094]
[0095]
[0096] In this embodiment, the actual coordinates of the normalized coordinates of the two vertices in the imaging area are obtained according to the normalized coordinates of the two vertices and the width and height of the image sensor, and are specifically calculated according to the following formula:
[0097]
[0098]
[0099] Step S104: for each frame of the video data stream, masking the privacy area is performed according to the actual coordinates of the privacy area in the imaging area using a masking method.
[0100] In this embodiment, according to the actual coordinate information of the privacy area, a mask of the same size as the area is designed, and the designed mask is superimposed on the original image collected by the camera. During the superposition process, the transparency of the mask or the privacy area will act on the corresponding area on the original image. The mask outside the privacy area is set to be transparent, and the privacy area is set to be completely blocked.
[0101] In this embodiment, the shielding method may also use different shielding methods such as blurring, pixelation, black shielding blocks, etc. to process the privacy area.
[0102] Step S105: uploading the video data stream after occlusion processing to the cloud.
[0103] Optionally, the method further comprises:
[0104] Get the offset angle of the camera adjusted by the user;
[0105] Determining a new imaging area of the camera according to the adjusted offset angle of the camera;
[0106] Determining whether the new imaging area includes the privacy area;
[0107] In response to the new imaging area including the privacy area, acquiring relative coordinates of the privacy area in the new imaging area;
[0108] The privacy area is shielded by using a mask method according to the relative coordinates of the privacy area in the new imaging area.
[0109] In this embodiment, in order to ensure that only the area designated by the user is privacy shielded without affecting the information display of other areas when the camera moves, the above steps are also included, wherein the offset angle includes a horizontal field of view angle and a vertical field of view angle.
[0110] Optionally, the determining whether the new imaging area includes the privacy area specifically includes:
[0111] Acquire the coordinate correspondence between the original imaging area and the new imaging area;
[0112] It is determined whether the privacy area is included in the new imaging area according to the coordinate correspondence.
[0113] In this embodiment, the coordinate correspondence between the original imaging area and the new imaging area can be calculated according to the following formula:
[0114]
[0115]
[0116] Where W 1 The new horizontal field of view of the camera after adjustment by the user, H 1 is the new vertical field of view of the camera after adjustment by the user, W and H are the original horizontal and vertical field of view angles, (x t ,y t ) is a coordinate point in the original imaging area, (x new ,y new ) are the corresponding coordinate points in the new imaging area.
[0117] The privacy masking method provided in the embodiment of the present invention can protect the privacy of the video during video acquisition, calculate the camera rotation angle in real time and adjust the privacy area to be masked accordingly. Compared with the method of automatically detecting and masking the privacy area using an image processing algorithm, the present invention can save computing resources, and the camera does not need to be installed with a chip with higher computing power, thereby saving costs.
[0118] In a specific embodiment, the privacy shielding method is applied to a privacy shielding system to implement privacy shielding for videos captured 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, wherein each part is described as follows:
[0119] Video acquisition module, used for real-time acquisition of video signals.
[0120] A rotation angle calculation module is connected to the video acquisition module and is used to calculate the rotation angle of the camera in real time and record the offset angle and direction;
[0121] The privacy zone setting module allows users to customize the zone and record its coordinates in the screen;
[0122] The occlusion processing module is connected to the rotation angle calculation module and the privacy area setting module, and is used to encrypt and occlude the corresponding area in the video according to the rotation angle of the camera and the set privacy area coordinates.
[0123] like Figure 2 As shown, the privacy shielding method includes:
[0124] 1. Obtain real-time video signal;
[0125] 2. Record the camera's offset angle;
[0126] 3. Users define privacy areas;
[0127] 4. Get the coordinate information of the privacy area in the video area;
[0128] 5. Block the privacy area;
[0129] 6. Real-time video streaming is uploaded to the cloud.
[0130] In another specific embodiment, the privacy shielding method may include the following steps:
[0131] Step S11: The user adjusts the camera to the area that he wants to monitor and obtains the real-time collected video data stream.
[0132] Step S12: Record the horizontal field of view angle and the vertical field of view angle of the camera.
[0133] Calculate the horizontal field of view 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 angle may be slightly smaller than the actual field of view angle, this difference can be ignored. We will use the calculated field of view angle to describe the monitoring range of the camera.
[0134] For example, the imaging size of a 1 / 2.7-inch CMOS image sensor is ω×h=5.27mm×3.96mm.
[0135] Step S13: The user defines a frame to select the area to be shielded for privacy, that is, the user uses a rectangle to frame the area to be shielded.
[0136] Step S14: Obtaining coordinate point information of the privacy area selected by the user.
[0137] 1) Get the imaging area of the camera video
[0138] According to the parameters of step S12, the imaging area width Imaging area height
[0139] Assume that the position of the camera on the plane is (x cam ,y cam ,h cam ), the coordinate range of the imaging area can be expressed as follows:
[0140] At a specific distance D, the coordinate range of the camera's imaging area in the horizontal direction is:
[0141]
[0142]
[0143] At a specific distance D, the coordinate range of the camera's imaging area in the vertical direction is:
[0144]
[0145]
[0146] 2) Calculate the actual coordinates of the two vertices on the diagonal of the user-calibrated rectangle in the imaging area
[0147] Place the two vertices on the diagonal of the rectangle (x 1 ,y 1 ) and (x 2 ,y 2 )The actual coordinates in the imaging area are obtained through the following transformation steps.
[0148] 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, assuming the image resolution is I ω ×I h .
[0149] The coordinate formula for normalizing the pixel coordinates (x, y) in the image to the interval [-1, 1] is:
[0150]
[0151]
[0152] The formula for converting normalized coordinates to physical coordinates of the actual imaging area is:
[0153]
[0154]
[0155] Step S15: masking the video stream in the selected area (ie, the privacy area).
[0156] The selected area is masked using the mask method. For each frame of the video stream, a mask of the same size as the selected area is designed based on the obtained privacy area coordinate information.
[0157] The designed mask is superimposed on the original image captured by the camera. During the superposition process, the transparency or privacy area of the mask will act on the corresponding area on the original image. The mask outside the privacy area is set to be transparent, and the privacy area is set to be completely blocked.
[0158] Step S16: The video stream processed by the above steps is uploaded to the cloud in real time.
[0159] After the above steps, when the user is in a fixed area, the frame is privacy shielded, and the outside of the frame is displayed normally.
[0160] Furthermore, in order to ensure that only the area designated by the user is privacy shielded when the camera moves without affecting the information display of other areas, the privacy shielding processing steps when the camera moves are also included, such as Figure 3 As shown, including:
[0161] Step S21: Acquire the video signal collected in real time. When the camera stops rotating, obtain the video signal collected at this time.
[0162] Step S22: Obtain the camera offset angle adjusted by the current user.
[0163] After the camera rotates, record the horizontal field of view angle W at the new position 1 and vertical field of view H 1 , using the same calculation method as step S12.
[0164] Step S23: determining whether the current imaging area includes a privacy area.
[0165] 1) Calculate the current imaging area. According to W in step S22 1 and H1 The imaging area included in the current area is calculated according to 1) in step S14.
[0166] 2) Calculate the coordinates of the area demarcated in the original area at the new angle. When the horizontal and vertical viewing angles are W and H, a coordinate point (x t ,y t ), which is in the new W 1 and H 1 The corresponding coordinates (x new ,y new )for:
[0167]
[0168]
[0169] 3) Compare the new coordinate point with the current imaging area.
[0170] Place the two vertices on the diagonal of the rectangle (x 1 ,y 1 ) and (x 2 ,y 2 ) into 2) and calculate the corresponding x new1 , x new2 ,y new1 ,y new2 Compare with the coordinates of the current imaging area obtained in 1), for each vertex (x ′ ,y ′ ), check whether the rectangular area is completely contained in the image area:
[0171] x min ≤x ′ ≤x max
[0172] y min ≤y ′ ≤y max
[0173] And check whether the edge of the rectangular area is within the imaging area.
[0174] If the obtained new corresponding coordinates are not in the current imaging area, no processing is performed. If they are included in the current imaging area, the processing is performed in step S24.
[0175] Step S24: Record the relative coordinates corresponding to the privacy area in the current imaging area according to the values calculated in step S23.
[0176] Step S25: shielding the privacy area.
[0177] 1) Recalculate the coordinates of the privacy zone in the current imaging area.
[0178] According to step S23 3), if the rectangular area is completely contained in the imaging area, the coordinate range of the current privacy area is calculated according to step S23 2). If the rectangular area is partially contained in the imaging area, the boundary intersection check formula is used to check 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 intersection boundary.
[0179] 2) Use masking method to block the privacy area.
[0180] Design a mask of the same size as the privacy area obtained in 1), and superimpose it with the original image collected by the camera at the current angle. During the superposition process, set the mask outside the occluded area to be transparent, and set the occluded area to be completely occluded.
[0181] It should be noted that the privacy shielding method provided by the present invention has the following characteristics:
[0182] a) Chip-level computing feature design: The present invention designs the computing features of privacy shielding at the camera chip level, and uses the horizontal and vertical field of view angles of the camera for real-time calculations. This design simplifies the processing process, avoids complex post-processing, and greatly reduces computing resource consumption and equipment costs, thereby improving the efficiency of the overall system.
[0183] b) Occlusion calculation combined with the physical characteristics of the camera: The present invention determines the monitoring range by calculating the horizontal field of view angle and the vertical field of view angle of the camera, and adopts the formula horizontal field of view angle Vertical field of view To calculate the field of view angle, ω 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, avoiding additional complex calculations and improving calculation efficiency and accuracy.
[0184] c) Autonomous and selective area masking: Users can define the privacy area to be masked in the video imaging. The present invention can calculate the relative position of the area in the imaging range in real time based on the area defined by the user and the rotation angle of the camera, and mask the position. This method enhances the autonomous selectivity and flexibility of privacy masking, allowing users to dynamically adjust the privacy area according to actual needs.
[0185] d) Real-time video stream privacy masking: When the camera is collecting video, the video stream is subjected to privacy masking in real time to ensure that the privacy masking is completed before the video data is uploaded to the cloud, thus achieving 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.
[0186] The privacy shielding method provided by the embodiment of the present invention first collects the video data stream of the camera in real time; then determines the imaging area of the camera according to the horizontal field of view and the vertical field of view of the camera; then calculates the actual coordinates of the privacy area in the imaging area according to the privacy area selected by the user to be shielded; finally, for each frame of the video data stream, the privacy area is shielded by the 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 invention can perform privacy shielding processing on the video data stream in real time during the process of the camera collecting video, ensuring that the privacy shielding processing has been completed before the video data is uploaded to the cloud, avoiding the risk of privacy leakage and improving the security of data storage. At the same time, the user can customize the privacy area to be shielded, which improves the user's autonomous selectivity; in addition, compared with the method of automatically detecting and shielding the privacy area using the image processing algorithm, the present invention can save computing resources and costs because the camera does not need to install a chip with higher computing power, thereby solving the problem that the existing privacy shielding method has the risk of privacy leakage and the user cannot perform selective shielding.
[0187] Embodiment 2:
[0188] like Figure 4 As shown, this embodiment provides a privacy shielding device, which is used to execute the above-mentioned privacy shielding method, including:
[0189] The data stream acquisition module 11 is used to acquire the video data stream of the camera in real time;
[0190] An imaging area acquisition module 12, connected to the data stream acquisition module 11, is used to determine the imaging area of the camera according to the horizontal field of view angle and the vertical field of view angle of the camera;
[0191] The privacy coordinate calculation module 13 is connected to the imaging area acquisition module 12 and is used to calculate the actual coordinates of the privacy area in the imaging area according to the privacy area that needs to be shielded and selected by the user;
[0192] A privacy area shielding module 14 is connected to the privacy coordinate calculation module 13 and is used 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 the video data stream;
[0193] The data stream uploading module 15 is connected to the privacy area shielding module 14 and is used to upload the video data stream after shielding processing to the cloud.
[0194] Optionally, the device further comprises:
[0195] The viewing angle calculation module is used to calculate the horizontal viewing angle and the vertical viewing angle of the camera according to the width and height of the image sensor in the camera and the focal length of the lens.
[0196] Optionally, the viewing angle calculation module specifically includes:
[0197] The first calculation unit is used to calculate the horizontal field of view angle of the camera according to the following formula:
[0198]
[0199] Where 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;
[0200] The second calculation unit is used to calculate the vertical field angle of the camera according to the following formula:
[0201]
[0202] Where H is the vertical field of view of the camera, and h is the height of the image sensor.
[0203] Optionally, the imaging area acquisition module 12 specifically includes:
[0204] A horizontal range determination unit, used to determine 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;
[0205] A vertical range determination unit is used to determine 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.
[0206] Optionally, the privacy coordinate calculation module 13 specifically includes:
[0207] An area acquisition unit, used to acquire a rectangular privacy area selected by a user that needs to be blocked;
[0208] A coordinate determination unit, used to determine the coordinates of two vertices on a line corresponding to the rectangular privacy area;
[0209] A normalization unit, configured to normalize the coordinates of the two vertices according to a resolution of the video image in the camera;
[0210] A first obtaining unit, configured to obtain actual coordinates of the normalized coordinates of the two vertices in the imaging area according to the normalized coordinates of the two vertices and the width and height of the image sensor;
[0211] The actual coordinate calculation unit is used to calculate the actual coordinates of the privacy area in the imaging area according to the actual coordinates of the normalized coordinates of the two vertices in the imaging area.
[0212] Optionally, the device further comprises:
[0213] An adjustment parameter acquisition module is used to obtain the offset angle of the camera adjusted by the user;
[0214] A new area determination module, used to determine a new imaging area of the camera according to the adjusted offset angle of the camera;
[0215] A judging module, used for judging whether the new imaging area includes the privacy area;
[0216] a relative coordinate acquisition module, configured to acquire relative coordinates of the privacy area in the new imaging area in response to the new imaging area including the privacy area;
[0217] The new shielding module is used to shield the privacy area by using a mask method according to the relative coordinates of the privacy area in the new imaging area.
[0218] Optionally, the judging module includes:
[0219] A coordinate correspondence acquisition unit, used to acquire a coordinate correspondence between the original imaging area and the new imaging area;
[0220] A judging unit is used to judge whether the privacy area is included in the new imaging area according to the coordinate correspondence.
[0221] Embodiment 3:
[0222] refer to Figure 5 This embodiment provides a privacy shielding device, including 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 execute the privacy shielding method in Example 1.
[0223] The memory 21 is connected to the processor 22. The memory 21 may be a flash memory, a read-only memory or other memory. The processor 22 may be a central processing unit or a single-chip microcomputer.
[0224] Embodiment 4:
[0225] This embodiment provides a computer-readable storage medium, on which a computer program is stored. When the computer program is executed by a processor, the privacy shielding method in the above-mentioned embodiment 1 is implemented.
[0226] The computer-readable storage medium includes volatile or non-volatile, removable or non-removable media implemented in any method or technology for storing information (such as computer-readable instructions, data structures, computer program modules or other data). Computer-readable storage media include, but are 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 disk (DVD) or other optical disk 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.
[0227] In summary, the privacy shielding method, device and readable storage medium provided by the embodiment of the present invention 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 selected by the user to be shielded; finally, for each frame of the video data stream, the privacy area is shielded by the 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 invention can perform privacy shielding processing on the video data stream in real time during the process of the camera collecting video, ensuring that the privacy shielding processing has been completed before the video data is uploaded to the cloud, avoiding the risk of privacy leakage and improving the security of data storage. At the same time, the user can customize the privacy area to be shielded, which improves the user's autonomous selectivity; in addition, compared with the method of automatically detecting and shielding the privacy area using the image processing algorithm, the present invention can save computing resources and costs because the camera does not need to install a chip with higher computing power, and solves the problem that the existing privacy shielding method has the risk of privacy leakage and the user cannot perform selective shielding.
[0228] It is to be understood that the above embodiments are merely exemplary embodiments used to illustrate the principles of the present invention, but the present invention is not limited thereto. For those of ordinary skill in the art, various modifications and improvements can be made without departing from the spirit and essence of the present invention, and these modifications and improvements are also considered to be within the scope of protection of the present invention.
Claims
1. A privacy shielding method, It is characterized in that The method comprises: Collect the video data stream of the camera in real time; Determining an imaging area of a camera according to a horizontal field of view angle and a vertical field of view angle of the camera; Calculate the actual coordinates of the privacy area within the imaging area according to the privacy area that needs to be shielded and selected by the user; For each frame of the video data stream, masking the privacy area according to the actual coordinates of the privacy area in the imaging area using a masking method; Upload the video data stream after occlusion processing to the cloud.
2. The method according to claim 1, It is characterized in that Before 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 includes: The horizontal field of view angle and the vertical field of view angle of the camera are calculated according to the width and height of the image sensor in the camera and the focal length of the lens.
3. The method according to claim 2, It is characterized in that The 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 specifically includes: The horizontal field of view of the camera is calculated according to the following formula: Where 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 of the camera is calculated according to the following formula: Where H is the vertical field of view of the camera, and h is the height of the image sensor.
4. The method according to claim 1, It is characterized in that 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 specifically includes: 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, The coordinate range of the imaging area of the camera in the vertical direction is determined according to the Y-axis coordinate of the position of the camera on the plane and the vertical field of view of the camera.
5. The method according to claim 2, It is characterized in that The calculating the actual coordinates of the privacy area within the imaging area according to the privacy area that needs to be shielded and selected by the user specifically includes: Get the privacy area of the rectangle selected by the user that needs to be blocked; Determine the coordinates of two vertices on the line corresponding to the privacy area of the rectangle; Normalizing the coordinates of the two vertices according to the resolution of the video image in the camera; Obtaining actual coordinates of the normalized coordinates of the two vertices in the imaging area according to the normalized coordinates of the two vertices and the width and height of the image sensor; The actual coordinates of the privacy area in the imaging area are calculated according to the actual coordinates of the normalized coordinates of the two vertices in the imaging area.
6. The method according to claim 1, It is characterized in that The method further comprises: Get the offset angle of the camera adjusted by the user; Determining a new imaging area of the camera according to the adjusted offset angle of the camera; Determining whether the new imaging area includes the privacy area; In response to the new imaging area including the privacy area, acquiring relative coordinates of the privacy area in the new imaging area; The privacy area is shielded by using a mask method according to the relative coordinates of the privacy area in the new imaging area.
7. The method according to claim 6, It is characterized in that The determining whether the new imaging area includes the privacy area specifically includes: Acquire the coordinate correspondence between the original imaging area and the new imaging area; It is determined whether the privacy area is included in the new imaging area according to the coordinate correspondence.
8. A privacy shielding device, It is characterized in that The device comprises: Data stream acquisition module, used to acquire the video data stream of the camera in real time; An imaging area acquisition module, connected to the data stream acquisition module, for 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; A privacy coordinate calculation module, connected to the imaging area acquisition module, is used to calculate the actual coordinates of the privacy area within the imaging area according to the privacy area that needs to be shielded and selected by the user; a privacy area shielding module, connected to the privacy coordinate calculation module, for shielding the privacy area by using a mask method according to the actual coordinates of the privacy area within the imaging area for each frame of the video data stream; The data stream uploading module is connected to the privacy area shielding module and is used to upload the video data stream after shielding processing to the cloud.
9. A privacy shielding device, It is characterized in that The method comprises 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 to 7.
10. A computer-readable storage medium, It is characterized in that The computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the privacy shielding method according to any one of claims 1 to 7 is implemented.
Citation Information
Cited By
Privacy masking method and apparatus, and readable storage medium
WO2026031452A1
