Object shielding method, electronic device, and storage medium
By marking and obtaining the coordinates of the objects to be masked in the video stream, and using the graphics processor for global masking, the inefficiency of marking each object individually in existing technologies is solved, thus improving the user experience.
Patent Information
- Application Number
- CN202111243082.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-10-25
- Publication Date
- 2026-02-06
- Estimated Expiration
- 2041-10-25
AI Technical Summary
Existing blocking methods require marking each object to be blocked individually, which is inefficient and results in a poor user experience.
By marking the objects to be masked in the video stream, obtaining their coordinates, and performing masking operations in each frame of the video stream based on these coordinates, the rendering of virtual masked objects is performed using the graphics processor.
This allows for global masking of an object by marking it once, improving operational efficiency and enhancing the user experience.
Smart Images

Figure CN114119328B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the technical field of mobile terminals, and in particular to an object shielding method, an electronic device and a storage medium. BACKGROUND
[0002] With the universal application of video image information technology in people's life, more and more people are used to using mobile phones to record the details of life. Unintentionally, some private information such as phone numbers, ID numbers, road signs or some people who do not want to be photographed will be photographed or screenshot. People often want to shield these objects that they do not want others to see in the photo to protect personal privacy or beautify the photo. However, the traditional way is to shield these objects one by one. For example, if there are three identical water cups in the same picture, three shielding operations are needed, which is low in operation efficiency.
[0003] Therefore, it is necessary to provide an intelligent shielding method for shielding objects, which can shield an object globally by marking the object once, so as to solve the problem of low operation efficiency of the existing shielding method which needs to mark the objects to be shielded one by one, improve the operation efficiency and enhance the user experience. SUMMARY
[0004] The main purpose of the present application is to provide an object shielding method, an electronic device and a storage medium to solve the problem of low operation efficiency of the existing shielding method which needs to mark the objects to be shielded one by one, improve the operation efficiency and enhance the user experience.
[0005] In a first aspect, the present application provides an object shielding method, comprising:
[0006] In response to a control command of a user marking a first marked object, obtaining the first marked object in a first video stream, and obtaining a first object to be shielded based on the first marked object;
[0007] Obtaining the coordinates of the first object to be shielded in each video frame of the first video stream;
[0008] Shielding the region corresponding to the coordinates of the first object to be shielded in each video frame of the first video stream.
[0009] Optionally, the step of marking the object to be shielded in the first video stream and obtaining the object to be shielded in response to the control command of the user marking the object to be shielded comprises:
[0010] Marking the first marked object as the first object to be shielded.
[0011] Optionally, the step of marking the object to be shielded in the first video stream and obtaining the object to be shielded in response to the control command of the user marking the object to be shielded comprises:
[0012] marking an object other than the first marked object as a first to-be-masked object.
[0013] Optionally, the step of marking the to-be-masked object in the first video stream in response to the control command of the user marking the to-be-masked object comprises:
[0014] obtaining the second marked object in the first video stream in response to a control command of the user marking the second marked object, and obtaining the first to-be-masked object based on the first marked object and the second marked object.
[0015] Optionally, the step of marking the to-be-masked object in the first video stream in response to the control command of the user marking the to-be-masked object comprises:
[0016] editing the to-be-masked object.
[0017] Optionally, the step of masking the region corresponding to the coordinates of the first to-be-masked object in each video frame of the first video stream comprises:
[0018] masking the first to-be-masked object according to a preset masking manner.
[0019] Optionally, the preset masking manner is to blur the to-be-masked object.
[0020] Optionally, the step of masking the region corresponding to the coordinates of the first to-be-masked object in each video frame of the first video stream comprises:
[0021] masking the region corresponding to the coordinates of the first to-be-masked object in each video frame of the second video stream.
[0022] According to a second aspect of the embodiments of the present application, an electronic device is provided, comprising a memory and a processor, the memory is configured to store one or more computer instructions, wherein the one or more computer instructions are executed by the processor to implement the object masking method according to any one of the first aspect.
[0023] According to a third aspect of the embodiments of the present application, a storage medium is provided, wherein the storage medium stores a program, and the program is executed by a computer to implement the object masking method according to any one of the first aspect.
[0024] Compared with the prior art, one or more of the above solutions can have the following advantages or beneficial effects:
[0025] The application solves the problem of low operation efficiency of the prior art by marking the to-be-masked object in the video stream, obtaining the to-be-masked object coordinates, and masking the to-be-masked object based on the to-be-masked object coordinates, thereby improving operation efficiency and user experience. BRIEF DESCRIPTION OF DRAWINGS
[0026] In order to more clearly illustrate the technical solutions of the present application, the drawings needed in the embodiments will be briefly introduced as follows. Obviously, for those skilled in the art, other drawings can also be obtained without creative labor on the basis of these drawings.
[0027] Figure 1 A flowchart of an object masking method provided by the embodiment of the present application is shown in the figure.
[0028] Figure 2 An example picture provided by the embodiment of the present application is shown in the figure.
[0029] Figure 3 A schematic diagram of a masking marked object provided by the embodiment of the present application is shown in the figure.
[0030] Figure 4 A schematic diagram of a masking marked object provided by the embodiment of the present application is shown in the figure.
[0031] Figure 5 A schematic diagram of a masking marked object provided by the embodiment of the present application is shown in the figure.
[0032] Figure 6 A schematic diagram of a masking marked object provided by the embodiment of the present application is shown in the figure.
[0033] Figure 7 A schematic diagram of a masking marked object provided by the embodiment of the present application is shown in the figure. DETAILED DESCRIPTION
[0034] The embodiments of the present application will be described in detail below with reference to the accompanying drawings and embodiments, so that the implementation process of how the present application applies technical means to solve technical problems and achieve corresponding technical effects can be fully understood and implemented. The embodiments of the present application and each feature in the embodiments can be combined with each other without conflict, and the technical solutions formed thereby are all within the protection scope of the present application.
[0035] In one embodiment, as shown in Figure 1 The embodiment of the present application provides an object masking method, which comprises the following steps S101-S103:
[0036] Step S101: In response to a control command of a user marking a first marked object, a first marked object in a first video stream is obtained, and a first to-be-masked object is obtained based on the first marked object.
[0037] When users are editing videos or images, they can mark objects in the images or videos, such as a teapot, chair, or stool in an image, or a refrigerator, television, or air conditioner in a video. The same object can be marked from multiple angles. For example, the target teapot can be marked from a level view first, and then from a top-down view second. The two can be combined to obtain the target teapot object, and then the target teapot can be masked to achieve a better masking effect.
[0038] Step S102: Obtain the coordinates of the first object to be masked in each video frame of the first video stream.
[0039] For any object to be blocked, obtain the position of the object to be blocked in each video frame of the video stream, specifically by obtaining the coordinates of the object to be blocked in each video frame of the video stream.
[0040] Step S103: In each video frame of the first video stream, the region corresponding to the coordinates of the first object to be masked is masked.
[0041] Based on the coordinates of the object to be masked in each video frame of the video stream, a virtual masking object associated with the object is rendered into each video frame. This virtual masking object is used to mask the object in the video stream. The rendering operation is performed by the graphics processing unit (GPU) of the electronic device. The obtained coordinates are in a pixel coordinate system, also known as an image coordinate system. This system is constructed with the top-left vertex of the video frame as the origin and pixels as the unit. The x-coordinate u and y-coordinate v of a pixel are the column number and row number in the image array of the video frame, respectively. Considering that the object to be masked actually occupies a small portion of the video frame, the centroid of the object can be determined first, and the coordinates of the centroid in each video frame can be used as the object's coordinates in each video frame.
[0042] In one embodiment, such as Figure 2 As shown, red represents women, blue represents men, and red flowers are ornaments, such as... Figure 3 As shown, after the user marks all male faces and selects to blur them using a preset blurring method, all male faces are blurred.
[0043] In one embodiment, such as Figure 3 As shown, when a user marks all men, all men are blurred and masked. At the same time, after marking all men, all non-men can be masked.
[0044] In one embodiment, as shown in Figure 4 When the user has marked all the women, all the women produce a striped masking effect that is different from the blurred masking effect, as shown in
[0045] In one embodiment, as shown in Figure 5 When the user has marked all the red flowers, all the red flowers produce a blurred masking effect, as shown in Figure 6 When the user has marked all the red flowers, and then has marked all the people wearing red flowers, all the people wearing red flowers produce a blurred masking effect, as shown in
[0046] In one embodiment, as shown in Figure 7 When the user has marked the specified task, a reinforced blurred effect is produced by adjusting the degree of blurring, as shown in
[0047] This embodiment can also achieve that after marking the objects in one picture to obtain the coordinates, the coordinates are applied to another picture to perform masking.
[0048] The embodiment of the present application provides an electronic device, which can be a mobile phone, a tablet computer or the like, comprising a memory and a processor, the memory is used for storing one or more computer instructions, wherein the one or more computer instructions are executed by the processor to realize the object masking method in the above-mentioned embodiments.
[0049] The processor is used for executing all or part of the steps in the object masking method in the embodiment one or the embodiment two. The memory is used for storing various types of data, for example, dedicated access point configuration information parameters and the like.
[0050] The processor can be an application specific integrated circuit (ASIC), a digital signal processor (DSP), a digital signal processing device (DSPD), a programmable logic device (PLD), a field programmable gate array (FPGA), a controller, a microcontroller, a microprocessor or other electronic elements, and is used for executing the object masking method in the above-mentioned embodiment one.
[0051] The memory can be implemented by any type of volatile or nonvolatile storage devices or a combination thereof, such as Static Random Access Memory (SRAM), Electrically Erasable Programmable Read-Only Memory (EEPROM), Erasable Programmable Read-Only Memory (EPROM), Programmable Read-Only Memory (PROM), Read-Only Memory (ROM), magnetic storage, flash memory, magnetic disk or optical disk.
[0052] The various functional units in the embodiments of the present application can be integrated in one processing unit, or each unit can exist physically, or two or more units can be integrated in one unit. When the functions are realized in the form of software functional units and sold or used as independent products, they can be stored in a computer readable storage medium. Based on this understanding, the technical solutions of the present application essentially or the parts that make contributions to the prior art or the parts of the technical solutions can be embodied in the form of a software product. The computer software product is stored in a storage medium and includes several instructions for enabling a computer device (which can be a personal computer, a server, or a network device, etc.) to execute all or part of the steps of the methods described in the embodiments of the present application. The aforementioned storage medium includes: a U disk, a mobile hard disk, a Read-Only Memory (ROM), a Random Access Memory (RAM), a magnetic disk or an optical disk, and various storage media that can store program codes.
[0053] In the embodiments provided by the present disclosure, it should be understood that the disclosed apparatus and method can also be implemented in other manners. The embodiments described above are merely exemplary for describing the present disclosure. For example, the flowchart and block diagram in the accompanying drawings show the possible implementation architectures, functions and operation of the apparatus, method and computer program product according to the embodiments of the present disclosure. In this regard, each block in the flowchart or block diagram can represent a module, a segment or a portion of code which comprises one or more executable instructions for implementing the specified logic function. It should also be noted that in some alternative implementations, the functions shown in the blocks can occur in a different order than that shown in the figure. For example, two blocks shown in succession can in fact be executed substantially concurrently or in the reverse order, depending on the functionality involved. It should also be noted that each block in the block diagram and / or flowchart, and combinations of blocks in the block diagram and / or flowchart, can be implemented by dedicated hardware-based systems which perform the specified functions or acts, or can be implemented by a combination of dedicated hardware-based systems and computer instructions.
[0054] It should be noted that, in the present disclosure, the terms "comprising", "containing", or any other variant thereof are intended to cover non-exclusive inclusion, such that a process, method, article or apparatus that comprises a list of elements does not only include those elements, but also includes other elements not expressly listed or inherent to such process, method, article or apparatus. Without more limitations, the element defined by the phrase "comprising a" does not exclude the presence of additional identical elements in the process, method, article or apparatus that includes the element.
[0055] Although the embodiments disclosed by the present disclosure are as described above, the above description is only for the purpose of facilitating the understanding of the present disclosure, and is not intended to limit the present disclosure. Any person skilled in the art, without departing from the spirit and scope of the present disclosure, can make any modifications and changes in the implementation form and details, but the patent protection scope of the present disclosure shall be subject to the scope defined by the appended claims.
Claims
1. An object shielding method characterized by, Comprising: in response to a user marking a first marked object control command, obtaining a first marked object in the first video stream, obtaining a first to-be-masked object based on the first marked object; obtaining the coordinates of the first to-be-masked object in each video frame of the first video stream; masking the region corresponding to the coordinates of the first to-be-masked object in each video frame of the first video stream; The step of marking the first to-be-masked object in the first video stream in response to the user marking the to-be-masked object control command includes: in response to a user marking a second marked object control command, obtaining a second marked object in the first video stream, obtaining a first to-be-masked object based on the first marked object in combination with the second marked object, wherein the marking angle of the first marked object is different from the marking angle of the second marked object; After the step of masking the region corresponding to the coordinates of the first to-be-masked object in each video frame of the first video stream, it includes: masking the region corresponding to the coordinates of the first to-be-masked object in each video frame of the second video stream.
2. The method of claim 1, wherein, The step of marking the first to-be-masked object in the first video stream in response to the user marking the to-be-masked object control command includes: marking the first marked object as the first to-be-masked object.
3. The method of claim 1, wherein, The step of marking the first to-be-masked object in the first video stream in response to the user marking the to-be-masked object control command includes: marking objects other than the first marked object as the first to-be-masked object.
4. The method of claim 1, wherein, The step of marking the first to-be-masked object in the first video stream in response to the user marking the to-be-masked object control command includes: editing the to-be-masked object.
5. The method of claim 1, wherein, The step of masking the region corresponding to the coordinates of the first to-be-masked object in each video frame of the first video stream includes: masking the first to-be-masked object according to a preset masking mode.
6. The method of claim 5, wherein, The preset masking mode is to blur the to-be-masked object.
7. An electronic device, comprising: The memory is used to store one or more computer instructions, wherein the one or more computer instructions are executed by the processor to implement the object masking method according to any one of claims 1-6.
8. A computer readable storage medium having stored therein a program, characterized in that, The program is executed by the computer to implement the object masking method according to any one of claims 1-6.
Citation Information
Patent Citations
Object shielding method, object shielding device and electronic equipment
CN110660032A
Shielding strategy determination method and device, storage medium and electronic device
CN110942027A