CN-122023558-A - Visual object superimposing method, visual object superimposing device, computer device and readable storage medium
Abstract
The application relates to a visual object superposition method, a visual object superposition device, computer equipment and a readable storage medium. The method comprises the steps of obtaining a superimposed visual object and a visual object to be superimposed, determining an initial fuzzy pixel set based on the superimposed visual object and an interpolation algorithm, screening a first target pixel set in the initial fuzzy pixel set based on color key colors and preset edge pixel conditions, determining an initial non-target pixel set, screening a second target pixel set in the initial non-target pixel set based on the distance between fuzzy pixel points in the initial non-target pixel set and first target pixel points in the first target pixel set, compensating the first target pixel set according to the second target pixel set, obtaining a target pixel set, and superimposing the visual object to be superimposed on the superimposed visual object according to the target pixel set, so as to obtain the target visual object. The quality of the target visual object can be provided by adopting the method.
Inventors
- ZHANG XIHAN
- HAI MING
- HU FEN
Assignees
- 海光集成电路设计(北京)有限公司
Dates
- Publication Date
- 20260512
- Application Date
- 20260115
Claims (16)
- 1. A method of visual object superimposition, the method comprising: acquiring a superimposed visual object and a visual object to be superimposed, and determining an initial fuzzy pixel set based on the superimposed visual object and an interpolation algorithm; Screening a first target pixel set in the initial blurred pixel set based on the color key color and a preset edge pixel condition, and determining an initial non-target pixel set; Screening a second target pixel set in the initial non-target pixel set based on the distance between the fuzzy pixel point in the initial non-target pixel set and the first target pixel point in the first target pixel set, and compensating the first target pixel set according to the second target pixel set to obtain a target pixel set; and according to the target pixel set, the visual object to be superimposed is superimposed on the visual object to be superimposed, and the target visual object is obtained.
- 2. The method of claim 1, wherein the determining an initial blurred pixel set based on the superimposed visual object and an interpolation algorithm comprises: acquiring position information of a target area, and drawing the target area into color key colors in the overlapped visual object according to the position information; and determining an initial fuzzy pixel set in the overlapped visual object according to a preset interpolation algorithm.
- 3. The method of claim 2, wherein said determining an initial set of blurred pixels in said superimposed visual object according to a preset interpolation algorithm comprises: amplifying the overlapped visual object based on a preset interpolation algorithm to obtain an amplified overlapped visual object; Determining an amplified target area in the overlapped visual object according to the position information of the target area; and determining an initial fuzzy pixel set in the initial pixel set corresponding to the amplified superimposed visual object based on the amplified target area and a preset fuzzy distance.
- 4. The method of claim 1, wherein the screening the first set of target pixels in the initial set of blurred pixels based on color key colors and a preset edge pixel condition and determining an initial set of non-target pixels comprises: Marking each fuzzy pixel in the initial fuzzy pixel set based on the color key color and the preset edge pixel condition to obtain each overlapped label; screening a first target pixel set from the initial blurred pixel set based on each of the overlapping labels; and constructing an initial non-target pixel set according to the fuzzy pixel points in the initial fuzzy pixel set, which are not in the first target pixel set.
- 5. The method of claim 4, wherein the overlay labels comprise a first overlay label and a second overlay label, and wherein the marking each blurred pixel in the initial set of blurred pixels based on a color key color and a preset edge pixel condition to obtain each overlay label comprises: Marking the fuzzy pixel points based on the relation between each fuzzy pixel point in the initial fuzzy pixel set and the color key color to obtain the first overlapped tag; Screening the initial blurred pixel set for a blurred pixel set based on each of the first overlay labels; And marking each fuzzy pixel point in the fuzzy pixel set according to a preset edge pixel condition to obtain the second overlapped tag.
- 6. The method of claim 5, wherein the marking the blurred pixel points based on the relationship between each blurred pixel point in the initial blurred pixel set and the color of the color key to obtain the first overlay label includes: Judging whether the fuzzy pixel points match with the color key colors or not according to each fuzzy pixel point in the initial fuzzy pixel set; If the fuzzy pixel point is matched with the color key color, determining a first overlapped label of the fuzzy pixel point as a first mark; and if the fuzzy pixel points are not matched with the color key colors, determining that the first overlapped labels of the fuzzy pixel points are second labels.
- 7. The method of claim 5, wherein said screening the set of blurred pixels in the initial set of blurred pixels based on each of the first overlay labels comprises: Judging whether the first overlapped tag of the fuzzy pixel point is a first mark or not according to each fuzzy pixel point in the initial fuzzy pixel set; And if the first overlapped tag is a first mark, adding the blurred pixel points to a blurred pixel set.
- 8. The method of claim 5, wherein marking each of the blurred pixels in the blurred pixel set according to a preset edge pixel condition to obtain the second overlay label includes: judging whether the fuzzy pixel points accord with preset edge pixel conditions or not according to each fuzzy pixel point in the fuzzy pixel set; If the blurred pixel points meet the edge pixel conditions, determining a second overlapped label of the blurred pixel points as a first label; And if the blurred pixel point does not accord with the edge pixel condition, determining a second overlapped label of the blurred pixel point as a second mark.
- 9. The method of claim 8, wherein the determining whether the blurred pixel point meets a preset edge pixel condition comprises: Determining adjacent pixel sets of the fuzzy pixel points, and judging whether first overlapped labels of adjacent pixel points in the adjacent pixel sets are first marks or not; If the first overlapped labels of the adjacent pixel points are first marks, determining that the blurred pixel points do not meet the edge pixel conditions; And if the first overlapped label of the adjacent pixel points is a second label, determining that the blurred pixel points meet the edge pixel condition.
- 10. The method of claim 1, wherein the selecting a second target pixel set from the initial non-target pixel set based on a distance between the blurred pixel point in the initial non-target pixel set and the first target pixel point in the first target pixel set, and compensating the first target pixel set according to the second target pixel set, to obtain a target pixel set, comprises: for each fuzzy pixel point in the initial non-target pixel set, determining a first target pixel point nearest to the fuzzy pixel as a neighbor target pixel point; Screening a second target pixel set from the initial non-target pixel set based on the distance between the neighbor target pixel point and the fuzzy pixel point and a preset distance threshold; And updating the second target pixel set to the first target pixel set to obtain a target pixel set.
- 11. The method of claim 10, wherein the screening the second set of target pixels in the initial set of non-target pixels based on the distance between the neighbor target pixel point and the blurred pixel point and a preset distance threshold comprises: Calculating the absolute distance between the neighbor target pixel point and the fuzzy pixel point, and judging whether the absolute distance is smaller than or equal to a preset distance threshold value; and if the absolute distance is smaller than or equal to the distance threshold, determining the blurred pixel point as a second target pixel, and adding the blurred pixel point into the second target pixel set based on the second target pixel.
- 12. The method according to claim 1, wherein the overlaying the visual object to be overlaid on the overlaid visual object according to the target pixel set to obtain a target visual object includes: Amplifying the visual object to be superimposed, and determining a superimposed area in the amplified superimposed visual object based on the target pixel set; Overlapping the amplified visual objects to be overlapped on the overlapping area to obtain an initial target visual object; And reducing the initial target visual object to obtain a target visual object.
- 13. A visual object superimposing apparatus, the apparatus comprising: The acquisition module is used for acquiring the overlapped visual object and the visual object to be overlapped and determining an initial fuzzy pixel set based on the overlapped visual object and an interpolation algorithm; The first screening module is used for screening a first target pixel set in the initial fuzzy pixel set based on the color key color and the preset edge pixel condition, and determining an initial non-target pixel set; The second screening module is used for screening a second target pixel set in the initial non-target pixel set based on the distance between the fuzzy pixel point in the initial non-target pixel set and the first target pixel point in the first target pixel set, and compensating the first target pixel set according to the second target pixel set to obtain a target pixel set; And the superposition module is used for superposing the visual object to be superposed on the vision object to be superposed according to the target pixel set to obtain a target visual object.
- 14. A computer device comprising a memory and a processor, the memory storing a computer program, characterized in that the processor implements the steps of the method of any one of claims 1 to 12 when the computer program is executed.
- 15. A computer readable storage medium, on which a computer program is stored, characterized in that the computer program, when being executed by a processor, implements the steps of the method of any of claims 1 to 12.
- 16. A computer program product comprising a computer program, characterized in that the computer program, when being executed by a processor, implements the steps of the method of any one of claims 1 to 12.
Description
Visual object superimposing method, visual object superimposing device, computer device and readable storage medium Technical Field The present application relates to the field of display technology, and in particular, to a visual object superimposing method, a visual object superimposing apparatus, a visual object superimposing computer device, a visual object superimposing computer program, and a visual object superimposing computer program. Background In the display field, users often have a need for multiple image overlay displays or multiple video overlay displays or image and video overlay displays. For example, the video being played is displayed on a desktop with interface occlusions of other applications on top of the video. To fulfill this need, it is necessary to superimpose the visual object to be superimposed on the target area of the visual object to be superimposed by the visual object superimposing method. The target area is an area for displaying the visual objects to be superimposed. In the conventional art, colorkey (color key) colors are drawn in a target area. And amplifying the overlapped visual object based on an interpolation algorithm, and updating the pixel point in the amplified overlapped visual object equal to Colorkey to the pixel point of the visual object to be overlapped. And then, shrinking the updated overlapped visual object to obtain the target visual object. However, in the conventional technology, since the interpolation algorithm adds a new pixel point similar to Colorkey but not equal to Colorkey, the Colorkey judgment fails, so that macroscopic visual object flaws are caused, and the quality of the generated target visual object is poor. Disclosure of Invention Based on this, it is necessary to provide a visual object superimposing method, apparatus, computer device, computer readable storage medium and computer program product, in view of the above technical problems. In a first aspect, the present application provides a visual object superimposing method, including: acquiring a superimposed visual object and a visual object to be superimposed, and determining an initial fuzzy pixel set based on the superimposed visual object and an interpolation algorithm; Screening a first target pixel set in the initial blurred pixel set based on the color key color and a preset edge pixel condition, and determining an initial non-target pixel set; Screening a second target pixel set in the initial non-target pixel set based on the distance between the fuzzy pixel point in the initial non-target pixel set and the first target pixel point in the first target pixel set, and compensating the first target pixel set according to the second target pixel set to obtain a target pixel set; and according to the target pixel set, the visual object to be superimposed is superimposed on the visual object to be superimposed, and the target visual object is obtained. In one embodiment, the determining an initial blurred pixel set based on the superimposed visual object and an interpolation algorithm includes: acquiring position information of a target area, and drawing the target area into color key colors in the overlapped visual object according to the position information; and determining an initial fuzzy pixel set in the overlapped visual object according to a preset interpolation algorithm. In one embodiment, the determining the initial blurred pixel set in the superimposed visual object according to a preset interpolation algorithm includes: amplifying the overlapped visual object based on a preset interpolation algorithm to obtain an amplified overlapped visual object; Determining an amplified target area in the overlapped visual object according to the position information of the target area; and determining an initial fuzzy pixel set in the initial pixel set corresponding to the amplified superimposed visual object based on the amplified target area and a preset fuzzy distance. In one embodiment, the filtering the first target pixel set in the initial blurred pixel set based on the color key color and the preset edge pixel condition, and determining the initial non-target pixel set includes: Marking each fuzzy pixel in the initial fuzzy pixel set based on the color key color and the preset edge pixel condition to obtain each overlapped label; screening a first target pixel set from the initial blurred pixel set based on each of the overlapping labels; and constructing an initial non-target pixel set according to the fuzzy pixel points in the initial fuzzy pixel set, which are not in the first target pixel set. In one embodiment, the overlay labels include a first overlay label and a second overlay label, and the marking each blurred pixel in the initial blurred pixel set based on a color key color and a preset edge pixel condition to obtain each overlay label includes: Marking the fuzzy pixel points based on the relation between each fuzzy pixel point in the initial fuzzy pixel set an