WO2025016331A1 - 图像处理方法、装置、设备及介质 - Google Patents
图像处理方法、装置、设备及介质 Download PDFInfo
- Publication number
- WO2025016331A1 WO2025016331A1 PCT/CN2024/105295 CN2024105295W WO2025016331A1 WO 2025016331 A1 WO2025016331 A1 WO 2025016331A1 CN 2024105295 W CN2024105295 W CN 2024105295W WO 2025016331 A1 WO2025016331 A1 WO 2025016331A1
- Authority
- WO
- WIPO (PCT)
- Prior art keywords
- target
- region
- edge
- sub
- target sub
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Pending
Links
Classifications
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06T—IMAGE DATA PROCESSING OR GENERATION, IN GENERAL
- G06T5/00—Image enhancement or restoration
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06T—IMAGE DATA PROCESSING OR GENERATION, IN GENERAL
- G06T7/00—Image analysis
- G06T7/10—Segmentation; Edge detection
Definitions
- the present disclosure relates to the field of image processing technology, and in particular to an image processing method, device, equipment and medium.
- the aliasing problem is a common problem in the field of images. Factors such as canvas size or magnification will affect the obviousness of aliasing in the image, thereby affecting the user's perception.
- the present disclosure provides an image processing method, apparatus, device and medium.
- An embodiment of the present disclosure provides an image processing method, the method comprising: obtaining a target line region in an image to be processed; determining a target sub-region in the target line region; and performing a gradient blurring process on the target sub-region, wherein the transparency of pixel points of a target edge in the target sub-region close to the target line region is greater than the transparency of pixel points of a target edge in the target sub-region far from the target line region, and the target edge is an edge where the target sub-region overlaps with the target line region.
- determining the target sub-region in the target line region includes: determining a target edge from all edges of the target line region without cropping the target line region, and obtaining a first adjustable parameter corresponding to the target edge; determining the target sub-region based on the target edge and the first adjustable parameter; wherein the first adjustable parameter is used to determine an edge in the target sub-region that does not overlap with the target edge.
- determining the target sub-region in the target line region includes: in the case of cropping the target line region, obtaining a cropping edge corresponding to the target line region; determining the cropped target line region based on the cropping edge, determining a target edge from all edges of the cropped target line region, and obtaining a second adjustable parameter corresponding to the target edge; determining the target sub-region based on the target edge and the second adjustable parameter; wherein the second adjustable parameter is used to determine an edge in the cropped target line region that does not overlap with the target edge.
- the target line area has a plurality of target edges; each of the target edges corresponds to a target sub-area, and the target edge is a long side of the corresponding target sub-area.
- the gradient blurring processing of the target sub-region includes: obtaining original pixel values and position coordinates corresponding to the pixel points in the target sub-region; determining the transparency corresponding to the pixel points in the target sub-region based on the position coordinates corresponding to the pixel points in the target sub-region; and determining the actual pixel values of the pixel points in the target sub-region based on the original pixel values and transparency corresponding to the pixel points in the target sub-region.
- determining the transparency corresponding to the pixel points in the target sub-region based on the position coordinates corresponding to the pixel points in the target sub-region includes: determining the transparency of the edge pixel points on the adjacent edge having an intersection with the target edge in the target sub-region based on the position coordinates of the top pixel point of the target edge of the target sub-region and the position coordinates of the edge pixel points on the adjacent edge in the target sub-region; wherein the transparency of the edge pixel points close to the top pixel point is greater than the transparency of the edge pixel points far from the top pixel point; determining that the transparency of the associated pixel points in the target sub-region corresponding to the edge pixel points is equal to the transparency of the edge pixel points; wherein the distance between the associated pixel points and the target edge is equal to the distance between the edge pixel points and the target edge.
- the top pixel point on the target edge is completely transparent, and the top pixel point on the adjacent edge that is farthest from the top pixel point is completely opaque.
- the step of obtaining the target line area in the image to be processed includes: in response to receiving a user's request for adding a graphic to the image to be processed, drawing a line area corresponding to the graphic adding request; The corresponding lines are obtained, and a target line area in the image to be processed is determined based on the lines.
- the disclosed embodiment also provides an image processing device, including: a line region acquisition module, used to acquire a target line region in an image to be processed; a sub-region determination module, used to determine a target sub-region in the target line region; a blur processing module, used to perform a gradual blur processing on the target sub-region, wherein the transparency of the pixel points of the target edge in the target sub-region close to the target line region is greater than the transparency of the pixel points of the target edge in the target sub-region far from the target line region, and the target edge is an edge where the target sub-region overlaps with the target line region.
- a line region acquisition module used to acquire a target line region in an image to be processed
- a sub-region determination module used to determine a target sub-region in the target line region
- a blur processing module used to perform a gradual blur processing on the target sub-region, wherein the transparency of the pixel points of the target edge in the target sub-region close to the target line region is greater than the transparency of the pixel points of
- An embodiment of the present disclosure also provides an electronic device, which includes: a processor; a memory for storing executable instructions of the processor; the processor is used to read the executable instructions from the memory and execute the instructions to implement the image processing method provided by the embodiment of the present disclosure.
- the embodiment of the present disclosure further provides a computer-readable storage medium, wherein the storage medium stores a computer program, and the computer program is used to execute the image processing method provided by the embodiment of the present disclosure.
- the embodiment of the present disclosure further provides a computer program product, which includes instructions, and when the instructions are executed by a processor, the image processing method provided by the embodiment of the present disclosure is implemented.
- the above technical solution provided by the embodiment of the present disclosure can obtain the target line area in the image to be processed, and further determine the target sub-area in the target line area, so as to perform a gradual blurring process on the target sub-area, and the transparency of the pixel points in the target sub-area close to the target edge of the target line area (that is, the edge where the target sub-area and the target line area overlap) is greater than the transparency of the pixel points in the target sub-area far from the target edge of the target line area. Since the target sub-area and the target line area have overlapping edges, the target sub-area can be regarded as the edge area corresponding to the target line area.
- FIG1 is a schematic diagram of an edge sawtooth provided by an embodiment of the present disclosure.
- FIG2 is a schematic diagram of a flow chart of an image processing method provided by an embodiment of the present disclosure
- FIG3 is a schematic diagram of a target line area provided by an embodiment of the present disclosure.
- FIG4a is a schematic diagram of determining a target sub-region provided by an embodiment of the present disclosure.
- FIG4b is a schematic diagram of determining a target sub-region provided by an embodiment of the present disclosure.
- FIG4c is a schematic diagram of determining a target sub-region provided by an embodiment of the present disclosure.
- FIG4d is a schematic diagram of determining a target sub-region provided by an embodiment of the present disclosure.
- FIG5 is a schematic diagram of a target line area provided by an embodiment of the present disclosure.
- FIG6 is a schematic diagram of processing a target line area provided by an embodiment of the present disclosure.
- FIG7 is a schematic diagram of processing a target line area provided by an embodiment of the present disclosure.
- FIG8 is a schematic diagram of processing a target line area provided by an embodiment of the present disclosure.
- FIG9 is a schematic diagram of processing a target line area provided by an embodiment of the present disclosure.
- FIG10 is a schematic diagram of a flow chart of an image processing method provided by an embodiment of the present disclosure.
- FIG11 is a schematic diagram of the structure of an image processing device provided by an embodiment of the present disclosure.
- FIG. 12 is a schematic diagram of the structure of an electronic device provided in an embodiment of the present disclosure.
- the aliasing phenomenon of images is relatively common.
- the schematic diagram of edge aliasing shown in Figure 1 can be referred to.
- the left figure in Figure 1 is a rectangle, and the right figure in Figure 1 is a clearly visible stepped aliasing after the rectangle is magnified.
- the main reason for the aliasing is that it is necessary to determine the fragments covered by the shape in the rasterization stage. Taking a triangle as an example, if the center point of the pixel is in the triangle, the pixel is judged to be in the triangle, and a square fragment will be generated at the pixel position.
- the pixel is judged not to be in the triangle, and no fragment will be generated at the pixel position.
- the pixels in the image are displayed in the form of square fragments, so the stepped aliasing will be clearly displayed under magnification.
- the stepped aliasing in the oblique line shown in Figure 1 will be more obvious.
- This phenomenon can be called edge aliasing.
- the main processing method of full-screen anti-aliasing technology used in related technologies is essentially to perform a weighted operation on each pixel in the entire image, which consumes a lot of performance and will bring additional memory and CPU consumption, especially in high-frequency rendering.
- the above method is difficult to control and is not easy to apply flexibly.
- the embodiments of the present disclosure provide an image processing method, device, equipment and medium, which are described in detail below.
- FIG2 is a flow chart of an image processing method provided by an embodiment of the present disclosure, which can be performed by an image processing device, wherein the device can be implemented by software and/or hardware, and can generally be integrated in an electronic device. As shown in FIG2 , the method mainly includes the following steps S202 to S206:
- Step S202 obtaining a target line area in the image to be processed.
- any line has a certain width.
- the difference is that lines of different thicknesses have different widths, so each line is actually a strip area.
- the lines in the image to be processed that need to be repaired for aliasing can be regarded as the target line area.
- the target line area For ease of understanding, please refer to a schematic diagram of a target line area shown in Figure 3.
- the line has a certain width (or thickness).
- the four vertices of the thick line are represented by ABCD.
- at least two triangles can be constructed when rendering the thick line, such as rendering triangle ABC and triangle BCD in sequence, so that a rectangular line can be rendered.
- rectangular lines can also be directly rendered, which is not limited here.
- the disclosed embodiment provides an example of a method for obtaining a target line area, such as, in response to receiving a user's request to add a graphic to an image to be processed, drawing a line corresponding to the graphic adding request, and determining the target line area in the image to be processed based on the line.
- a user adds the required graphics on an existing image (i.e., the image to be processed) according to demand through image editing software.
- the graphics can be graphics of various shapes such as straight lines, triangles, polygons, etc. It can be understood that lines are the basic elements of graphics.
- the lines corresponding to the graphic adding request can be used as the target line area for jagged edge repair processing.
- the above is only an example. In actual applications, all lines or specified lines involved in the image rendering and drawing process can also be directly used as the target line area for jagged edge repair, which is not limited here.
- Step S204 determine a target sub-region in the target line region.
- the target sub-area can be the edge sub-area of the target line area itself, or the edge sub-area of the target line area in the remaining area after being cropped.
- FIG4a it is shown that Aa1c1C can be a target sub-region, and Bb1d1D can be a target sub-region.
- the above two target sub-regions are essentially determined by taking the two long sides of the target line region ABCD as target sides. edge sub-region.
- FIG4b it is illustrated that Aa2b2B can be a target sub-region, and Cc2d2D can be a target sub-region.
- the above two target sub-regions are essentially edge sub-regions determined by taking the two short sides (also called wide sides) of the target line region ABCD as target sides.
- Aa1c1C, Bb1d1D, Aa2b2B, and Cc2d2D can all be processed as target sub-regions at the same time, so that the four target sides (AC, BD, AB, CD) can be repaired with jagged edges.
- the disclosed embodiment takes into account that the target line region may be cropped in some scenarios. Taking FE as the cropping edge as an example, as shown in FIG4c, FE crops the target line region ABCD into two parts, namely AFEC and FBDE.
- the target sub-regions can be Aa1c1C and faFEec respectively; if FBDE is retained after cropping, the target sub-regions can be FfbedE and b1BDd1 respectively.
- the above target sub-regions are edge sub-regions determined based on the cropped rectangular edges (AC, BD, EF). As shown in Figure 4c, FE crops the target line region ABCD into two parts, namely AFEC and FBDE.
- the target sub-regions can be AFf1a2 and c2e1EC respectively; if FBDE is retained after cropping, the target sub-regions can be FBb2f2 and e2d2DE respectively.
- Aa1c1C, faFEec, AFf1a2 and c2e1EC can be processed as target sub-regions respectively, that is, each target sub-region is processed for aliasing repair respectively, so that the aliasing of the four edges of the cropped target sub-region can be repaired without affecting the user's perception.
- the processing method of retaining FBDE after cropping is the same, which will not be repeated here.
- Step S206 performing a gradual blurring process on the target sub-region, wherein the transparency of the pixel points of the target edge in the target sub-region close to the target line region is greater than the transparency of the pixel points of the target edge in the target sub-region far from the target line region, and the target edge is the edge where the target sub-region and the target line region overlap.
- the main method of the gradual blurring process is to change the transparency of the pixel points in the target sub-region (also referred to as the edge sub-region), and by performing different degrees of transparency processing on the pixel points close to the edge, it is helpful to prevent the user from seeing the jagged edges, and effectively alleviate the problem of poor visual perception experience brought to the user due to the jagged problem of the lines in the image.
- the target line area may have one or more target edges.
- the edge to be repaired for aliasing may be used as the target edge according to the needs.
- the target edge of the target line area is also the edge to be repaired for aliasing corresponding to the target line area. It may be the original edge of the target line area or the cropped edge of the target line area.
- Each target edge corresponds to a target sub-area, and the target edge is the long edge of the corresponding target sub-area. Specifically, it may be an edge where the target sub-area completely overlaps with the target line area or the cropped target line area.
- the target edge of the target sub-region Aa1c1C is AC
- the target edge of the target sub-region Bb1d1D is BD
- the target edge of the target sub-region Aa2b2B is AB
- the target edge of the target sub-region Cc2d2D is CD.
- FE cuts the target line region ABCD into two parts, namely AFEC and FBDE.
- the target edge of the target sub-region Aa1c1C is AC, and the target edge of the target sub-region faFEec is FE; if FBDE is retained after cutting, the target edge of the target sub-region FfbedE is FE, and the target edge of the target sub-region b1BDd1 is BD.
- the target edge of the target sub-region AFf1a2 is AF
- the target edge of c2e1EC is CE
- the target edge of the target sub-region FBb2f2 is FB
- the target edge of the target sub-region e2d2DE is DE.
- the target sub-region can be regarded as the edge region corresponding to the target line region.
- the key to determining the target sub-region is to determine whether to crop the target line region. In practical applications, whether to crop the target line region can be determined according to specific business needs or user needs. For example, a preset cropping configuration of the target line region can be obtained, and whether the target line region needs to be cropped can be determined according to the cropping configuration. For another example, when a cropping instruction for the target line region is received, it can be determined that the target line region needs to be cropped. Specifically, Flexible setting, not limited here.
- the disclosed embodiment proposes two main implementation methods for determining the target sub-area in the target line area, which can be performed with reference to the following implementation method 1 and implementation method 2:
- the target edge Without cropping the target line area, determine the target edge from all the edges of the target line area, and obtain the first adjustable parameter corresponding to the target edge; determine the target sub-area based on the target edge and the first adjustable parameter; wherein the first adjustable parameter is used to determine the edge in the target sub-area that does not overlap with the target edge.
- the first adjustable parameter corresponding to the target edge AC is used to determine the position of a1 and the position of c1, which can also be understood as the first adjustable parameter is used to determine the length of Aa1 and Cc1, thereby determining Aa1, Cc1 and a1c1.
- the first adjustable parameter corresponding to the target edge BD of the target sub-area Bb1d1D is used to determine the position of b1 and the position of d1, thereby determining Bb1, Dd1 and b1d1.
- the first adjustable parameter corresponding to the target edge AB is used to determine the position of a2 and the position of b2. It can also be understood that the first adjustable parameter is used to determine the length of Aa2 and Bb2, thereby determining Aa2, Bb2 and a2b2.
- a cropping edge corresponding to the target line area is obtained; the cropped target line area is determined based on the cropping edge, the target edge is determined from all edges of the cropped target line area, and a second adjustable parameter corresponding to the target edge is obtained; a target sub-area is determined based on the target edge and the second adjustable parameter; wherein the second adjustable parameter is used to determine the edge in the cropped target line area that does not overlap with the target edge.
- the clipping edge in FIG4c and FIG4d is FE.
- the second adjustable parameter corresponding to the target edge FE is used to determine the position of fa and the position of ec. It can also be understood that the second adjustable parameter is used to determine the length of faF and ecE, thereby determining faF, ecE and faec.
- the second adjustable parameter corresponding to the target edge AF is The number is used to determine the position of f1 and the position of a2, and can also be understood as the second adjustable parameter is used to determine the length of Ff1 and Aa2, thereby determining Ff1, Aa2 and f1a2. The rest are similar and will not be repeated here.
- first adjustable parameter or second adjustable parameter other edges in the target sub-area except the target edge can be flexibly adjusted.
- the first adjustable parameter and the second adjustable parameter can be set according to needs to change the width of the target sub-area and adjust the anti-aliasing effect.
- the embodiment of the present disclosure may further perform a gradual blurring process on the target sub-region, including the following steps A to C:
- Step A obtaining the original pixel value and position coordinates corresponding to the pixel points in the target sub-region. Specifically, the original pixel value and position coordinates corresponding to each pixel point in the target sub-region may be obtained.
- Step B based on the position coordinates corresponding to the pixel points in the target sub-region, determines the transparency corresponding to the pixel points in the target sub-region. That is, according to the position coordinates corresponding to each pixel point, determines its corresponding transparency, so that the transparency of the pixel points of the target side close to the target line area in the target sub-region is greater than the transparency of the pixel points of the target side far from the target line area in the target sub-region.
- the present disclosure embodiment provides a specific implementation example, which can be performed with reference to the following steps B1 to B2:
- Step B1 based on the position coordinates of the top pixel point of the target edge of the target sub-region and the position coordinates of the edge pixel points on the adjacent edge in the target sub-region that intersects the target edge, determine the transparency of the edge pixel points on the adjacent edge; wherein the transparency of the edge pixel points close to the top pixel point is greater than the transparency of the edge pixel points far from the top pixel point.
- the adjacent edges that intersect the target edge AC of the target sub-area Aa1c1C are Aa1 and Cc1.
- Aa1 is usually parallel to Cc1, so only the transparency of the edge pixels on one adjacent edge needs to be determined.
- the transparency of the pixel at point A is the largest, which can be completely transparent (that is, the transparency is 100%).
- the opacity of the pixel at point A is the smallest, that is, the opacity is 0.
- the transparency of the pixel at point a1 is the smallest, which can be completely opaque (that is, the transparency is 0).
- the transparency of the pixel at point a1 is the smallest, which can be completely opaque (that is, the transparency is 0).
- the opacity of the pixel point is the largest, that is, the opacity is 100%.
- the transparency of the pixel points from point a1 to point A gradually increases, in other words, the opacity gradually decreases.
- the adjacent edges that intersect with the target edge AB of the target sub-area Aa2b2B are Aa2 and Bb2 respectively.
- the adjacent edges that intersect with the target edge FE of the target sub-area faFEec are Ffa and Eec respectively.
- the adjacent edges that intersect with the target edge AF of the target sub-area AFf1a2 are Ff1 and Aa2 respectively.
- the method for determining the transparency of the pixel points of the above adjacent edges can refer to the relevant description of Figure 4a above, and the method for determining the adjacent edges of the remaining target sub-areas in Figures 4a to 4d is similar to the above examples, and will not be repeated here.
- the top pixel on the target edge is completely transparent, and the top pixel on the adjacent edge that is farthest from the top pixel is completely opaque. That is, the transparency of the top pixel on the target edge is 100%, and the transparency of the top pixel on the adjacent edge that is farthest from the top pixel is 0. It can also be said that the opacity of the top pixel on the target edge is 0, the transparency of the top pixel on the adjacent edge that is farthest from the top pixel is 0, and the transparency or opacity of the remaining pixels are gradually transitioned.
- Step B2 determine that the transparency of the associated pixel points corresponding to the edge pixel points in the target sub-area is equal to the transparency of the edge pixel points; wherein the distance between the associated pixel points and the target edge is equal to the distance between the edge pixel points and the target edge, such as, taking the target sub-area as a rectangle as an example, the line connecting the edge pixel points and the associated pixel points is parallel to the target edge.
- the above method can unify the transparency of the pixels that are at the same distance from the target edge, which is not only more reasonable, but also has high processing efficiency and better visual perception. It can be understood that there are multiple associated pixel points corresponding to each edge pixel point. In actual applications, the transparency of each edge pixel point and the transparency of the associated pixel points corresponding to the edge pixel point are known, and the transparency of all pixels in the target sub-area can be basically determined. The above method is convenient and efficient.
- Step C Determine the actual pixel value of the pixel in the target sub-region according to the original pixel value and transparency corresponding to the pixel in the target sub-region.
- the actual pixel value is equal to the original pixel value*opaqueness, and the sum of opacity and transparency is 1.
- a target line area schematic diagram shown in FIG5 can be referred to, which clearly shows a parameter z based on FIG3, and the parameter z can be understood as an opacity parameter.
- the target line area is a thick line drawn from coordinates (1, 2) to coordinates (7, 4).
- the x and y coordinates of the four vertices ABCD are: A (1+offset, 2-offsetX), B (1-offset, 2+offsetX), C (7+offset, 4-offsetX), D (7-offset, 4+offsetX), and the coordinates of the remaining pixels are similar, which will not be repeated here.
- FIG5 it is assumed that the entire target line area ABCD needs to be blurred and gradually processed, and AC has the highest transparency and the lowest opacity (z is 0), BD has the lowest transparency and the highest opacity (z is 1), and the transparency gradually increases from BD to AC, and the opacity gradually decreases.
- Figure 6 a processing schematic diagram of a target line area
- the left figure of Figure 6 can be understood as a trend diagram of the change of the z value
- the right figure of Figure 6 can be understood as the effect diagram obtained by processing the target line area based on the z value, wherein Figure 6 first uses the entire target line area as the target sub-area to be gradually blurred.
- the texture color shown in the right figure of Figure 6 becomes lighter and lighter, tending to be transparent.
- the target sub-area corresponding to a target edge can be blurred and gradually processed (also understood as feathering) through the z value.
- the line has multiple edges, and the corresponding edge areas all need to be blurred and gradually processed. For example, for another edge BD, it can be adjusted according to the following algorithm:
- f(x) pixel value*(1-abs(z*2-1)) where abs represents absolute value.
- FIG7 a processing schematic diagram of a target line area can be referred to as shown in FIG7.
- the target area ABCD is essentially divided into two target sub-areas, and the z value is the highest at the common edge of the two target sub-areas (that is, the center line of ABCD), and then decreases to 0 in both directions, thereby achieving a blurred gradient effect on the two edges of the target line area.
- the z value change trend obtained according to the left figure in FIG7 is The right picture in FIG7 shows that the target line area is relatively blurred, and the effect is not good. Therefore, the area to be blurred can be further adjusted, that is, the width of the target sub-area can be adjusted.
- m can be adjusted according to the needs, specifically corresponding to the aforementioned first adjustable parameter.
- n can be adjusted according to needs, specifically corresponding to the aforementioned second adjustable parameter.
- each small target area in Figure 9 can be processed in a similar manner as shown in Figure 8. Subsequently, according to needs, the target area on the top of Figure 9 can be retained, or the target area on the bottom of Figure 9 can be retained, and the remaining target areas are considered to be cropped. Alternatively, you can first confirm the target area to be retained after cropping, and only perform gradient blur processing on the retained target area.
- the target side being the long side of the target line area.
- the opacity (or transparency) of the edge pixels on the adjacent edge of the target edge can be determined. If the target edge is the short edge of the target line area, in order to facilitate distinction, an additional w value can be set to represent the opacity (or transparency) of the edge pixels on the adjacent edge of the target edge.
- the z value along the BA direction is the w value along the AC direction, and the rest of the calculation methods are similar and will not be repeated here.
- the flowchart of an image processing method shown in FIG. 10 can also be referred to.
- the method mainly includes the following steps S1002 to S100:
- Step S1002 obtaining a target line area in the image to be processed.
- Step S1004 determining whether to crop the target line area, if not to crop, executing step S1006, if cropped, executing step S1008.
- Step S1006 determine the target sub-region based on all the edges of the target line region, and use the first preset algorithm to perform a gradual blurring process on the target sub-region.
- Step S1008 obtaining the cropping edge corresponding to the target line area, determining the cropped target line area based on the cropping edge, and determining the target sub-area based on all edges of the cropped target line area, and performing a gradient blurring process on the target sub-area using a second preset algorithm.
- the above method not only can the aliasing problem be effectively alleviated, but also the computing cost is not high, the performance consumption is small, and it is lightweight.
- the controllability of the area that needs to be gradually blurred can be achieved through adjustable parameters, and it is easy to apply and expand in different business scenarios. Regardless of whether the line area will be cropped, the above method can be applied.
- FIG11 is a schematic diagram of the structure of an image processing device provided by an embodiment of the present disclosure.
- the device can be implemented by software and/or hardware and can generally be integrated in an electronic device, as shown in FIG11 , including:
- the line region acquisition module 1100 is used to acquire the target line region in the image to be processed
- the blur processing module 1104 is used to perform gradual blur processing on the target sub-region, wherein the transparency of the pixel points of the target edge close to the target line region in the target sub-region is greater than the transparency of the pixel points of the target edge far from the target line region in the target sub-region, and the target edge is the edge where the target sub-region overlaps with the target line region.
- the target sub-region can be regarded as the edge region corresponding to the target line region.
- the sub-region determination module 1102 is specifically used to: determine the target edge from all edges of the target line region without cropping the target line region, and obtain a first adjustable parameter corresponding to the target edge; determine the target sub-region based on the target edge and the first adjustable parameter; wherein the first adjustable parameter is used to determine the edge in the target sub-region that does not overlap with the target edge.
- the sub-region determination module 1102 is specifically used to: when the target line region is cropped, obtain the cropping edge corresponding to the target line region; determine the cropped target line region based on the cropping edge, determine the target edge from all edges of the cropped target line region, and obtain a second adjustable parameter corresponding to the target edge; determine the target sub-region based on the target edge and the second adjustable parameter; wherein the second adjustable parameter is used to determine the edge in the cropped target line region that does not overlap with the target edge.
- the target line area has a plurality of target edges; each of the target edges corresponds to a target sub-area, and the target edge is a long side of the corresponding target sub-area.
- the blur processing module 1104 is specifically used to: obtain the original pixel value and position coordinates corresponding to the pixel point in the target sub-region; determine the pixel point in the target sub-region based on the position coordinates corresponding to the pixel point in the target sub-region; Corresponding transparency; determining the actual pixel value of the pixel in the target sub-region according to the original pixel value and transparency corresponding to the pixel in the target sub-region.
- the blur processing module 1104 is specifically used to: determine the transparency of edge pixels on the adjacent edge based on the position coordinates of the top pixel of the target edge of the target sub-region and the position coordinates of edge pixels on the adjacent edge having an intersection with the target edge in the target sub-region; wherein the transparency of the edge pixel close to the top pixel is greater than the transparency of the edge pixel far from the top pixel; determine that the transparency of the associated pixel corresponding to the edge pixel in the target sub-region is equal to the transparency of the edge pixel; and the distance between the associated pixel and the target edge is equal to the distance between the edge pixel and the target edge.
- the top pixel point on the target edge is completely transparent, and the top pixel point on the adjacent edge that is farthest from the top pixel point is completely opaque.
- the line area acquisition module 1100 is specifically used to: in response to receiving a user's request to add a graphic to the image to be processed, draw a line corresponding to the graphic adding request, and determine a target line area in the image to be processed based on the line.
- the image processing device provided in the embodiments of the present disclosure can execute the image processing method provided in any embodiment of the present disclosure, and has the corresponding functional modules and beneficial effects of the execution method.
- An embodiment of the present disclosure further provides an electronic device, which includes: a processor; a memory for storing instructions executable by the processor; and a processor for reading executable instructions from the memory and executing the instructions to implement the above-mentioned image processing method.
- FIG12 is a schematic diagram of the structure of an electronic device provided by an embodiment of the present disclosure. As shown in FIG12 , the electronic device 1200 includes one or more processors 1201 and a memory 1202 .
- the processor 1201 may be a central processing unit (CPU) or other forms of processing units having data processing capabilities and/or instruction execution capabilities, and may control other components in the electronic device 1200 to perform desired functions.
- CPU central processing unit
- Other components in the electronic device 1200 may control other components in the electronic device 1200 to perform desired functions.
- the memory 1202 may include one or more computer program products, and the computer program product may include various forms of computer-readable storage media, such as volatile memory and/or non-volatile memory.
- the volatile memory may include, for example, a random access memory (RAM) and/or a cache memory (cache), etc.
- the non-volatile memory may include, for example, a read-only memory (ROM), a hard disk, a flash memory, etc.
- One or more computer program instructions may be stored on the computer-readable storage medium, and the processor 1201 may run the program instructions to implement the image processing method of the embodiment of the present disclosure described above and/or other desired functions.
- Various contents such as input signals, signal components, noise components, etc. may also be stored in the computer-readable storage medium.
- the electronic device 1200 may further include: an input device 1203 and an output device 1204 , and these components are interconnected via a bus system and/or other forms of connection mechanisms (not shown).
- the input device 1203 may also include, for example, a keyboard, a mouse, and the like.
- the output device 1204 can output various information to the outside, including the determined distance information, direction information, etc.
- the output device 1204 can include, for example, a display, a speaker, a printer, a communication network and a remote output device connected thereto, and the like.
- FIG12 only shows some of the components related to the present disclosure in the electronic device 1200, omitting components such as a bus, an input/output interface, etc.
- the electronic device 1200 may further include any other appropriate components according to specific application scenarios.
- the embodiment of the present disclosure may also be a computer program product, which includes computer program instructions, and when the computer program instructions are executed by a processor, the processor executes the image processing method provided by the embodiment of the present disclosure.
- the computer program product may be written in any combination of one or more programming languages to write program codes for executing the operations of the embodiments of the present disclosure.
- the program code may be executed entirely on the user's computing device, partially on the user's computing device, as a stand-alone software package, partially on the user's computing device and partially on a remote computing device, or entirely on a remote computing device or server.
- the embodiment of the present disclosure may also be a computer-readable storage medium on which computer program instructions are stored.
- the processor executes the image processing method provided by the embodiment of the present disclosure.
- the computer readable storage medium can adopt any combination of one or more readable media.
- the readable medium can be a readable signal medium or a readable storage medium.
- the readable storage medium can include, for example, but is not limited to, a system, device or device of electricity, magnetism, light, electromagnetic, infrared, or semiconductor, or any combination of the above.
- readable storage media include: an electrical connection with one or more wires, a portable disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above.
- RAM random access memory
- ROM read-only memory
- EPROM or flash memory erasable programmable read-only memory
- CD-ROM compact disk read-only memory
- magnetic storage device or any suitable combination of the above.
- the embodiment of the present disclosure further provides a computer program product, including a computer program/instruction, which implements the image processing method in the embodiment of the present disclosure when the computer program/instruction is executed by a processor.
- a prompt message is sent to the user to clearly prompt the user that the operation requested to be performed will require obtaining and using the user's personal information.
- the user can autonomously choose whether to provide personal information to software or hardware such as an electronic device, application, server, or storage medium that performs the operation of the technical solution of the present disclosure according to the prompt message.
- the prompt information in response to receiving an active request from the user, may be sent to the user in the form of a pop-up window, in which the prompt information may be presented in text form.
- the pop-up window may also carry a selection control for the user to choose "agree” or “disagree” to provide personal information to the electronic device.
Landscapes
- Engineering & Computer Science (AREA)
- Physics & Mathematics (AREA)
- General Physics & Mathematics (AREA)
- Theoretical Computer Science (AREA)
- Computer Vision & Pattern Recognition (AREA)
- Image Processing (AREA)
- Image Analysis (AREA)
Abstract
本公开实施例涉及一种图像处理方法、装置、设备及介质,其中该方法包括:获取待处理图像中的目标线条区域;确定所述目标线条区域中的目标子区域;对所述目标子区域进行渐变虚化处理,其中,所述目标子区域中靠近所述目标线条区域的目标边的像素点的透明度大于所述目标子区域中远离所述目标线条区域的目标边的像素点的透明度,且所述目标边是所述目标子区域与所述目标线条区域相重合的边。
Description
相关申请的交叉引用
本申请要求申请号为202310869000.4,题为“图像处理方法、装置、设备及介质”、申请日为2023年7月14日的中国发明专利申请的优先权,通过引用的方式将该申请整体并入本文。
本公开涉及图像处理技术领域,尤其涉及一种图像处理方法、装置、设备及介质。
锯齿问题是图像领域中常见的问题,画布大小或者放大程度等因素都会影响图像中锯齿的明显程度,从而影响用户观感。
发明内容
为了解决上述技术问题或者至少部分地解决上述技术问题,本公开提供了一种图像处理方法、装置、设备及介质。
本公开实施例提供了一种图像处理方法,所述方法包括:获取待处理图像中的目标线条区域;确定所述目标线条区域中的目标子区域;对所述目标子区域进行渐变虚化处理,其中,所述目标子区域中靠近所述目标线条区域的目标边的像素点的透明度大于所述目标子区域中远离所述目标线条区域的目标边的像素点的透明度,且所述目标边是所述目标子区域与所述目标线条区域相重合的边。
可选的,所述确定所述目标线条区域中的目标子区域,包括:在不裁剪所述目标线条区域的情况下,从所述目标线条区域的所有边中确定目标边,并获取与所述目标边对应的第一可调参数;基于所述目标边以及所述第一可调参数确定所述目标子区域;其中,所述第一可调参数用于确定所述目标子区域中未与所述目标边重合的边。
可选的,所述确定所述目标线条区域中的目标子区域,包括:在裁剪所述目标线条区域的情况下,获取所述目标线条区域对应的裁剪边;基于所述裁剪边确定裁剪后的所述目标线条区域,从裁剪后的所述目标线条区域的所有边中确定目标边,并获取与所述目标边对应的第二可调参数;基于所述目标边以及所述第二可调参数确定所述目标子区域;其中,所述第二可调参数用于确定裁剪后的所述目标线条区域中未与所述目标边重合的边。
可选的,所述目标线条区域具有多条目标边;每条所述目标边分别对应一个目标子区域,且所述目标边是与其相应的目标子区域的长边。
可选的,所述对所述目标子区域进行渐变虚化处理,包括:获取所述目标子区域中的像素点对应的原始像素值和位置坐标;基于所述目标子区域中的像素点对应的位置坐标,确定所述目标子区域中的像素点对应的透明度;根据所述目标子区域中的像素点对应的原始像素值以及透明度,确定所述目标子区域中的像素点的实际像素值。
可选的,所述基于所述目标子区域中的像素点对应的位置坐标,确定所述目标子区域中的像素点对应的透明度,包括:基于所述目标子区域的目标边的顶端像素点的位置坐标以及所述目标子区域中与所述目标边具有交点的邻边上的边缘像素点的位置坐标,确定所述邻边上的边缘像素点的透明度;其中,靠近所述顶端像素点的边缘像素点的透明度大于远离所述顶端像素点的边缘像素点的透明度;确定所述目标子区域中与所述边缘像素点对应的关联像素点的透明度等于所述边缘像素点的透明度;其中,所述关联像素点与所述目标边之间的距离等于所述边缘像素点与所述目标边之间的距离。
可选的,所述目标边上的顶端像素点为完全透明,所述邻边上与所述顶端像素点相距最远的顶端像素点为完全不透明。
可选的,所述获取待处理图像中的目标线条区域,包括:响应于接收到用户针对待处理图像的图形添加请求,绘制与所述图形添加请
求对应的线条,并基于所述线条确定所述待处理图像中的目标线条区域。
本公开实施例还提供了一种图像处理装置,包括:线条区域获取模块,用于获取待处理图像中的目标线条区域;子区域确定模块,用于确定所述目标线条区域中的目标子区域;虚化处理模块,用于对所述目标子区域进行渐变虚化处理,其中,所述目标子区域中靠近所述目标线条区域的目标边的像素点的透明度大于所述目标子区域中远离所述目标线条区域的目标边的像素点的透明度,且所述目标边是所述目标子区域与所述目标线条区域相重合的边。
本公开实施例还提供了一种电子设备,所述电子设备包括:处理器;用于存储所述处理器可执行指令的存储器;所述处理器,用于从所述存储器中读取所述可执行指令,并执行所述指令以实现如本公开实施例提供的图像处理方法。
本公开实施例还提供了一种计算机可读存储介质,所述存储介质存储有计算机程序,所述计算机程序用于执行如本公开实施例提供的图像处理方法。
本公开实施例还提供了一种计算机程序产品,所述计算机程序产品包括指令,所述指令在被处理器执行时实现如本公开实施例提供的图像处理方法。
本公开实施例提供的上述技术方案,能够获取待处理图像中的目标线条区域,并进一步确定目标线条区域中的目标子区域,从而对目标子区域进行渐变虚化处理,该目标子区域中靠近目标线条区域的目标边(也即目标子区域与目标线条区域相重合的边)的像素点的透明度大于目标子区域中远离目标线条区域的目标边的像素点的透明度。由于目标子区域与目标线条区域具有重合的边,目标子区域可视为目标线条区域对应的边缘区域。
应当理解,本部分所描述的内容并非旨在标识本公开的实施例的关键或重要特征,也不用于限制本公开的范围。本公开的其它特征将通过以下的说明书而变得容易理解。
此处的附图被并入说明书中并构成本说明书的一部分,示出了符合本公开的实施例,并与说明书一起用于解释本公开的原理。
为了更清楚地说明本公开实施例或现有技术中的技术方案,下面将对实施例或现有技术描述中所需要使用的附图作简单地介绍,显而易见地,对于本领域普通技术人员而言,在不付出创造性劳动性的前提下,还可以根据这些附图获得其他的附图。
图1为本公开实施例提供的一种边缘锯齿示意图;
图2为本公开实施例提供的一种图像处理方法的流程示意图;
图3为本公开实施例提供的一种目标线条区域示意图;
图4a为本公开实施例提供的一种目标子区域的确定示意图;
图4b为本公开实施例提供的一种目标子区域的确定示意图;
图4c为本公开实施例提供的一种目标子区域的确定示意图;
图4d为本公开实施例提供的一种目标子区域的确定示意图;
图5为本公开实施例提供的一种目标线条区域示意图;
图6为本公开实施例提供的一种目标线条区域的处理示意图;
图7为本公开实施例提供的一种目标线条区域的处理示意图;
图8为本公开实施例提供的一种目标线条区域的处理示意图;
图9为本公开实施例提供的一种目标线条区域的处理示意图;
图10为本公开实施例提供的一种图像处理方法的流程示意图;
图11为本公开实施例提供的一种图像处理装置的结构示意图;
图12为本公开实施例提供的一种电子设备的结构示意图。
为了能够更清楚地理解本公开的上述目的、特征和优点,下面将对本公开的方案进行进一步描述。需要说明的是,在不冲突的情况下,本公开的实施例及实施例中的特征可以相互组合。
在下面的描述中阐述了很多具体细节以便于充分理解本公开,但本公开还可以采用其他不同于在此描述的方式来实施;显然,说明书中的实施例只是本公开的一部分实施例,而不是全部的实施例。
在实际应用中,图像的锯齿现象较为常见,诸如,画布越小、放大程度越大,锯齿现象越明显。为便于理解,可以参照图1所示的边缘锯齿示意图,图1中的左图为一个矩形,图1中的右图为将矩形放大后清晰可见的阶梯状锯齿。产生锯齿的主要原因是由于在光栅化阶段需要决定形状所覆盖的片元,以三角形为例,若像素中心点在三角形内,则判定该像素在三角形内,该像素位置就会产生一个方形片元,否则判定该像素不在三角形内,该像素位置也就不会产生片元。换言之,图像中的像素都是以方形的片元形式展示的,所以才会在放大情况下清楚展示出阶梯装的锯齿。尤其是在如图1所示的斜线中的阶梯状锯齿会更为明显,这种现象可被称为边缘锯齿。相关技术中所采用的全屏抗锯齿技术的主要处理方式实质是对整张图像中的每个像素点都进行一种加权运算处理,性能消耗较大,会带来额外的内存、CPU的消耗,尤其在高频渲染中更为明显;另外,上述方式也难以调控,也不便于灵活应用。为改善以上问题至少之一,本公开实施例提供了一种图像处理方法、装置、设备及介质,以下进行详细阐述说明。
图2为本公开实施例提供的一种图像处理方法的流程示意图,该方法可以由图像处理装置执行,其中该装置可以采用软件和/或硬件实现,一般可集成在电子设备中。如图2所示,该方法主要包括如下步骤S202~步骤S206:
步骤S202,获取待处理图像中的目标线条区域。
在实际应用中,任何线条实质都具有一定的宽度,区别在于,粗细不同的线条的宽度不同,因此每根线条实质都是一个条状区域。在
一些实施示例中,待处理图像中所需进行锯齿修复的线条本身便可视为目标线条区域。为便于理解,可参见图3所示的一种目标线条区域示意图,线条具有一定的宽度(或粗度),在图3中通过ABCD表征粗线条的四个顶点,在实际应用中,在渲染该粗线条的时候可以构建至少两个三角形,诸如按顺序渲染三角形ABC和三角形BCD,从而可渲染出一个矩形的线条。以上仅为示例,实际应用中也可以直接渲染矩形线条,在此不进行限制。
本公开实施例提供了目标线条区域的获取方式的一种示例,诸如,可以响应于接收到用户针对待处理图像的图形添加请求,绘制与图形添加请求对应的线条,并基于线条确定待处理图像中的目标线条区域。诸如,用户通过图像编辑软件在已有图像(也即待处理图像)上根据需求添加所需的图形,该图形诸如可以为直线、三角形、多边形等各种形状的图形,可以理解的是,线条是图形构成的基本元素,为了避免用户添加的图形存在锯齿而影响观感,可以将图形添加请求对应的线条作为目标线条区域进行锯齿修复处理。以上仅为示例,在实际应用中,还可以直接将图像渲染绘制过程所涉及的全部线条或指定线条作为目标线条区域以进行锯齿修复,在此不进行限制。
步骤S204,确定目标线条区域中的目标子区域。
为了保障锯齿修复效果,提升用户观感,以及进一步降低所需的运算成本,在本公开实施例中可以不直接针对整个目标线条区域中的每个像素均进行处理,而是可以预先确定所需处理的目标子区域,以便后续针对目标子区域进行处理。示例性地,目标子区域可以是目标线条区域本身的边缘子区域,也可以是目标线条区域在被裁剪后的余下区域中的边缘子区域。
为便于理解,本公开实施例示意出了图4a、图4b、图4c和图4d四种类型的目标子区域的确定示意图。在图4a中,示意出Aa1c1C可以为一个目标子区域,Bb1d1D可以为一个目标子区域,以上两个目标子区域本质是分别以目标线条区域ABCD的两条长边作为目标边确定
的边缘子区域。在图4b中,示意出Aa2b2B可以为一个目标子区域,Cc2d2D可以为一个目标子区域,以上两个目标子区域本质是分别以目标线条区域ABCD的两条短边(也可称为宽边)作为目标边确定的边缘子区域。在实际应用中,可以同时将Aa1c1C、Bb1d1D、Aa2b2B、Cc2d2D均作为目标子区域分别进行处理,从而使四条目标边(AC、BD、AB、CD)均得以锯齿修复。进一步,本公开实施例考虑到在一些场景中可能会对目标线条区域进行裁剪,以FE为裁剪边为例,如图4c所示,FE将目标线条区域ABCD裁剪为两个部分,分别为AFEC和FBDE,倘若裁剪后保留AFEC,则目标子区域可以分别为Aa1c1C和faFEec;倘若裁剪后保留FBDE,则目标子区域可以分别为FfbedE和b1BDd1。以上目标子区域分别是基于裁剪后的矩形边缘(AC、BD、EF)确定的边缘子区域。如图4c所示,FE将目标线条区域ABCD裁剪为两个部分,分别为AFEC和FBDE,倘若裁剪后保留AFEC,则目标子区域可以分别为AFf1a2和c2e1EC;若裁剪后保留FBDE,则目标子区域可以分别为FBb2f2和e2d2DE。在实际应用中,以裁剪后保留AFEC为例,可以将Aa1c1C、faFEec、AFf1a2和c2e1EC均分别作为目标子区域进行处理,也即,每个目标子区域分别进行锯齿修复处理,从而使裁剪后的目标子区域的四条边的锯齿得以修复,不影响用户观感,裁剪后保留FBDE的处理方式也是同理,在此不再赘述。
步骤S206,对目标子区域进行渐变虚化处理,其中,目标子区域中靠近目标线条区域的目标边的像素点的透明度大于目标子区域中远离目标线条区域的目标边的像素点的透明度,且目标边是目标子区域与目标线条区域相重合的边。也即,渐变虚化处理的主要方式是改变目标子区域(也可称为边缘子区域)的像素点的透明度,通过对靠近边缘的像素点进行不同程度的透明处理,有助于使用户无法再看清锯齿,有效缓解因图像中线条存在锯齿问题而给用户带来的视觉观感体验度较差的问题。
在实际应用中,目标线条区域可以具有一条或多条目标边,具体可根据需求将所需进行锯齿修复的边作为目标边,目标线条区域的目标边也即目标线条区域对应的待锯齿修复的边,可以是目标线条区域的原有边,也可以是目标线条区域的裁剪边,每条目标边分别对应一个目标子区域,且目标边是与其相应的目标子区域的长边,具体可以是目标子区域与目标线条区域或者裁剪后的目标线条区域完全重合的边。诸如,在图4a中目标子区域Aa1c1C的目标边为AC,目标子区域Bb1d1D的目标边为BD,在图4b中的目标子区域Aa2b2B的目标边为AB,目标子区域Cc2d2D的目标边为CD,在图4c中,FE将目标线条区域ABCD裁剪为两个部分,分别为AFEC和FBDE,倘若裁剪后保留AFEC,则目标子区域Aa1c1C的目标边为AC,目标子区域faFEec的目标边为FE;若裁剪后保留FBDE,则目标子区域FfbedE的目标边为FE,目标子区域b1BDd1的目标边为BD。在图4d中,倘若裁剪后保留AFEC,则目标子区域AFf1a2的目标边为AF,c2e1EC的目标边为CE;若裁剪后保留FBDE,则目标子区域FBb2f2的目标边为FB,目标子区域e2d2DE的目标边为DE。
通过对靠近边缘的像素点进行不同程度的透明处理,有助于使用户无法再看清锯齿,有效缓解因图像中线条存在锯齿问题而给用户带来的视觉观感体验度较差的问题。
由于目标子区域与目标线条区域具有重合的边,目标子区域可视为目标线条区域对应的边缘区域,通过对边缘区域进行渐变虚化处理的方式不仅能够有效缓解锯齿问题,而且运算成本不高,性能消耗较小。
确定目标子区域的关键在于判别是否会裁剪目标线条区域,在实际应用中,可以根据具体业务需求或者用户需求判别是否裁剪目标线条区域,诸如可获取目标线条区域的预设裁剪配置,根据裁剪配置判别是否需要对目标线条区域进行裁剪;又诸如,可以在接收到针对目标线条区域的裁剪指令时确定需要对目标线条区域进行裁剪,具体可
灵活设置,在此不进行限制。本公开实施例提出两种用于确定目标线条区域中的目标子区域的主要实施方式,可以参照如下实施方式一和实施方式二执行:
实施方式一:
在不裁剪目标线条区域的情况下,从目标线条区域的所有边中确定目标边,并获取与目标边对应的第一可调参数;基于目标边以及第一可调参数确定目标子区域;其中,第一可调参数用于确定目标子区域中未与目标边重合的边。以图4a中的目标子区域Aa1c1C的目标边AC为例,则目标边AC对应的第一可调参数用于确定a1的位置和c1的位置,也可理解为第一可调参数用于确定Aa1、Cc1的长度,从而确定Aa1、Cc1和a1c1。同理,目标子区域Bb1d1D的目标边BD对应的第一可调参数用于确定b1的位置和d1的位置,从而确定Bb1、Dd1和b1d1。再以图4b中的目标子区域Aa2b2B的目标边AB为例,则目标边AB对应的第一可调参数用于确定a2的位置和b2的位置,也可理解为第一可调参数用于确定Aa2、Bb2的长度,从而确定Aa2、Bb2和a2b2。
实施方式二:
在裁剪目标线条区域的情况下,获取目标线条区域对应的裁剪边;基于裁剪边确定裁剪后的目标线条区域,从裁剪后的目标线条区域的所有边中确定目标边,并获取与目标边对应的第二可调参数;基于目标边以及第二可调参数确定目标子区域;其中,第二可调参数用于确定裁剪后的目标线条区域中未与目标边重合的边。
诸如,图4c和图4d中的裁剪边为FE,以图4c中裁剪后的目标线条区域是AFEC为例,对于其目标子区域faFEec的目标边FE而言,目标边FE对应的第二可调参数用于确定fa的位置和ec的位置,也可理解为第二可调参数用于确定faF、ecE的长度,从而确定faF、ecE和faec。再以图4d中裁剪后的目标线条区域是AFEC为例,对于其目标子区域AFf1a2的目标边为AF为例,目标边为AF对应的第二可调参
数用于确定f1的位置和a2的位置,也可理解为第二可调参数用于确定Ff1、Aa2的长度,从而确定Ff1、Aa2和f1a2。其余均是类似,在此不再赘述。
通过上述第一可调参数或第二可调参数,可以灵活调整目标子区域中除目标边之外的其它边,在实际应用中可以根据需求设置第一可调参数和第二可调参数,从而改变目标子区域的宽度,调整锯齿修复效果。
在确定目标子区域的基础上,本公开实施例可以进一步对目标子区域进行渐变虚化处理,包括如下步骤A~步骤C:
步骤A,获取目标子区域中的像素点对应的原始像素值和位置坐标。具体的,可以获取目标子区域中的每个像素点对应的原始像素值和位置坐标。
步骤B,基于目标子区域中的像素点对应的位置坐标,确定目标子区域中的像素点对应的透明度。也即,根据每个像素点对应的位置坐标,确定其对应的透明度,以使目标子区域中靠近目标线条区域的目标边的像素点的透明度大于目标子区域中远离目标线条区域的目标边的像素点的透明度。本公开实施例提供了一种具体的实施示例,可以参照如下步骤B1~步骤B2执行:
步骤B1,基于目标子区域的目标边的顶端像素点的位置坐标以及目标子区域中与目标边具有交点的邻边上的边缘像素点的位置坐标,确定邻边上的边缘像素点的透明度;其中,靠近顶端像素点的边缘像素点的透明度大于远离顶端像素点的边缘像素点的透明度。
以图4a为例,与目标子区域Aa1c1C的目标边AC具有交点的邻边分别为Aa1和Cc1。在实际应用中,通常Aa1平行Cc1,因此只确定一条邻边上的边缘像素点的透明度即可,位于A点的像素点的透明度最大,可以为完全透明(也即透明度为100%),换言之,位于A点的像素点的不透明度最小,也即不透明度为0。位于a1点的像素点的透明度最小,可以为完全不透明(也即透明度为0),换言之,位于a1点
的像素点的不透明度最大,也即不透明度为100%。从a1点至A点中的像素点的透明度逐渐递增,换言之,不透明度逐渐递减。
以图4b为例,与目标子区域Aa2b2B的目标边AB具有交点的邻边分别为Aa2和Bb2。以图4c为例,与目标子区域faFEec的目标边FE具有交点的邻边分别为Ffa和Eec,以图4d为例,与目标子区域AFf1a2的目标边为AF具有交点的邻边分别为Ff1和Aa2,以上邻边的像素点的透明度的确定方式均可参照前述图4a的相关描述,且关于图4a~图4d中其余目标子区域的邻边的确定方式与上述示例类似,在此均不再赘述。
在一些具体示例中,目标边上的顶端像素点为完全透明,邻边上与顶端像素点相距最远的顶端像素点为完全不透明。也即,目标边上的顶端像素点的透明度为100%,邻边上与顶端像素点相距最远的顶端像素点的透明度为0。也可以称为,目标边上的顶端像素点的不透明度为0,邻边上与顶端像素点相距最远的顶端像素点的透明度为0,其余像素点的透明度或不透明度都逐渐过渡。
步骤B2,确定目标子区域中与边缘像素点对应的关联像素点的透明度等于边缘像素点的透明度;其中,所述关联像素点与所述目标边之间的距离等于所述边缘像素点与所述目标边之间的距离,诸如,以目标子区域是矩形为例,边缘像素点与关联像素点的连线与目标边平行。上述方式可以将与目标边距离一致的像素点的透明度进行统一,不仅更合理,处理效率也高,视觉观感也更佳。可以理解的是,与每个边缘像素点对应的关联像素点有多个,在实际应用中,已知每个边缘像素点的透明度,以及与边缘像素点对应的关联像素点的透明度,目标子区域中所有像素点的透明度基本都可确定,上述方式方便且高效。
步骤C,根据目标子区域中的像素点对应的原始像素值以及透明度,确定目标子区域中的像素点的实际像素值。示例性地,实际像素值等于原始像素值*不透明度,不透明度与透明度的和值为1。
通过上述方式,可以高效可靠地对目标子区域进行渐变虚化处理。为了便于对以上实施方式进行深入理解,以下结合图5~图10进行推导式阐述说明:
首先,可以参照图5所示的一种目标线条区域示意图,其在图3的基础上清楚表明了一个参数z,该参数z可以理解为不透明参数。假设该目标线条区域是从坐标(1,2)到坐标(7,4)绘制的很粗的线条,渲染时ABCD四个顶点的x、y坐标分别为:A(1+offset,2-offsetX)、B(1-offset,2+offsetX)、C(7+offset,4-offsetX)、D(7-offset,4+offsetX),其余像素点的坐标也是类似,在此不再赘述。在图5中,假设整个目标线条区域ABCD均为需要进行虚化渐变处理,且AC的透明度最高,不透明度最低(z为0),BD的透明度最低,不透明度最高(z为1),由BD向AC方向透明度逐渐增加,不透明度逐渐降低。如图6所示的一种目标线条区域的处理示意图,图6左图可以理解为z值的变化趋势图,图6右图可理解为基于z值对目标线条区域进行处理所得的效果图,其中,图6先将整个目标线条区域均作为待渐变虚化处理的目标子区域,随着图6中左图示意的不透明度z值的递增,图6中右图示意的纹理颜色越来越淡,趋向于透明化。示例性地,基于各像素点坐标确定相应的z值,各像素点的实际像素值f(x)=像素值*z。由图6可知,通过z值可以将一个目标边对应的目标子区域进行虚化渐变处理(也可理解为羽化处理),线条具有多个边,相应的边缘区域均需要进行虚化渐变处理,诸如,对于另一个边BD而言,可按照如下算法进行调整:
f(x)=像素值*(1-abs(z*2-1))其中,abs表示绝对值。
基于上述公式,可参照图7所示的一种目标线条区域的处理示意图,在图7中,实质是将目标区域ABCD等分为两个目标子区域,z值在两个目标子区域的共有边(也即ABCD的中心线)处最高为1,之后朝两个方向递减为0,从而达到目标线条区域的两条边缘的虚化渐变效果。但是发明人经研究发现按照图7中左图的z值变化趋势所得
的图7中的右图显示目标线条区域较为模糊,效果并不佳,因此可进一步调整所需模糊的区域,也即调整目标子区域的宽度,进一步,可以参照以下公式进行调整:
f(x)=像素值*min(1.0,(1.0-abs(z*2.0-1.0))*m)
f(x)=像素值*min(1.0,(1.0-abs(z*2.0-1.0))*m)
其中,m可以根据需求自行调整,具体对应前述第一可调参数,m越大,目标子区域的宽度越小,也即所需进行虚化渐变处理的边缘区域越小。以m=3为例,参见图8所示的一种目标线条区域的处理示意图,从图8中的左图可看到z在中间段(非目标子区域)的取值最大均为1,也即不透明度为1,透明度为0,z在中间段的两侧边缘处逐渐递减,以此实现边缘区域的渐变虚化处理,达到图8中的右图效果。
可以理解的是,不同场景或不同用户对于目标线条区域的处理方式不同,在一些场景中可能需要对目标线条区域进行裁剪,诸如图4c中需要沿FE将ABCD裁剪为两个部分,根据场景需求保留FBDE或者AFEC。倘若在前述图8的基础上裁剪掉一半区域,则EF处仍旧会存在边缘锯齿,进一步,可以参照以下公式进行调整:
f(x)=像素值*min(1.0,(1.0-abs(1.0-abs(z-0.5)*4.0))*n)
f(x)=像素值*min(1.0,(1.0-abs(1.0-abs(z-0.5)*4.0))*n)
其中,n可以根据需求自行调整,具体对应前述第二可调参数,n越大,目标子区域的宽度越小,也即所需进行虚化渐变处理的边缘区域越小。
基于上述公式,以n=1为例,可参照图9所示的一种目标线条区域的处理示意图,在图9中,实质是将目标区域ABCD等分为两个小的目标区域,对于每个小的目标区域,都是类似如图7所示的处理方式,应当说明的是,图9仅是示例,在实际应用中,图9中的每个小的目标区域都可以类似如图8所示的处理方式。后续根据需求,可以保留图9中在上的目标区域,或者保留图9中在下的目标区域,其余目标区域则视为被裁剪掉。或者,也可以首先确认裁剪后所需保留的目标区域,只针对保留的目标区域进行渐变虚化处理。应当说明的是,以上仅是对于目标边为目标线条区域的长边为例进行说明,基于z值
可以确定目标边的邻边上的边缘像素点的不透明度(或透明度),若目标边为目标线条区域的短边,为便于区分,可以额外设置w值表征目标边的邻边上的边缘像素点的不透明度(或透明度),以图5为例,沿BA方向为z值,则沿AC方向为w值,其余计算方式均类似,在此不再赘述。
综上所述,还可以参照图10所示的一种图像处理方法的流程示意图,该方法主要包括如下步骤S1002~步骤S100:
步骤S1002,获取待处理图像中的目标线条区域。
步骤S1004,判断是否对目标线条区域进行裁剪,如果不裁剪,执行步骤S1006,如果裁剪,执行步骤S1008。
步骤S1006,基于目标线条区域的所有边确定目标子区域,并采用第一预设算法对目标子区域进行渐变虚化处理。示例性地,第一预设算法即为包含上述第一可调参数的算法,诸如可参照以下公式实现:
f(x)=像素值*min(1.0,(1.0-abs(z*2.0-1.0))*m)。
f(x)=像素值*min(1.0,(1.0-abs(z*2.0-1.0))*m)。
步骤S1008,获取目标线条区域对应的裁剪边,基于裁剪边确定裁剪后的目标线条区域,以及基于裁剪后的目标线条区域的所有边确定目标子区域,并采用第二预设算法对目标子区域进行渐变虚化处理。示例性地,第二预设算法即为包含上述第二可调参数的算法,诸如可参照以下公式实现:
f(x)=像素值*min(1.0,(1.0-abs(1.0-abs(z-0.5)*4.0))*n)
f(x)=像素值*min(1.0,(1.0-abs(1.0-abs(z-0.5)*4.0))*n)
通过上述方式,不仅能够有效缓解锯齿问题,而且运算成本不高,性能消耗较小,具有运算轻量级,通过可调参数实现需进行渐变虚化处理的区域的可控性,且便于在不同业务场景中进行应用及扩展,无论线条区域是否会被裁剪,都可适用上述方式。
对应于前述图像处理方法,图11为本公开实施例提供的一种图像处理装置的结构示意图,该装置可由软件和/或硬件实现,一般可集成在电子设备中,如图11所示,包括:
线条区域获取模块1100,用于获取待处理图像中的目标线条区域;
子区域确定模块1102,用于确定目标线条区域中的目标子区域;
虚化处理模块1104,用于对目标子区域进行渐变虚化处理,其中,目标子区域中靠近目标线条区域的目标边的像素点的透明度大于目标子区域中远离目标线条区域的目标边的像素点的透明度,且目标边是目标子区域与目标线条区域相重合的边。
由于目标子区域与目标线条区域具有重合的边,目标子区域可视为目标线条区域对应的边缘区域,通过对边缘区域进行渐变虚化处理的方式不仅能够有效缓解锯齿问题,而且运算成本不高,性能消耗较小。
在一些实施方式中,所述子区域确定模块1102具体用于:在不裁剪所述目标线条区域的情况下,从所述目标线条区域的所有边中确定目标边,并获取与所述目标边对应的第一可调参数;基于所述目标边以及所述第一可调参数确定所述目标子区域;其中,所述第一可调参数用于确定所述目标子区域中未与所述目标边重合的边。
在一些实施方式中,所述子区域确定模块1102具体用于:在裁剪所述目标线条区域的情况下,获取所述目标线条区域对应的裁剪边;基于所述裁剪边确定裁剪后的所述目标线条区域,从裁剪后的所述目标线条区域的所有边中确定目标边,并获取与所述目标边对应的第二可调参数;基于所述目标边以及所述第二可调参数确定所述目标子区域;其中,所述第二可调参数用于确定裁剪后的所述目标线条区域中未与所述目标边重合的边。
在一些实施方式中,所述目标线条区域具有多条目标边;每条所述目标边分别对应一个目标子区域,且所述目标边是与其相应的目标子区域的长边。
在一些实施方式中,所述虚化处理模块1104具体用于:获取所述目标子区域中的像素点对应的原始像素值和位置坐标;基于所述目标子区域中的像素点对应的位置坐标,确定所述目标子区域中的像素点
对应的透明度;根据所述目标子区域中的像素点对应的原始像素值以及透明度,确定所述目标子区域中的像素点的实际像素值。
在一些实施方式中,所述虚化处理模块1104具体用于:基于所述目标子区域的目标边的顶端像素点的位置坐标以及所述目标子区域中与所述目标边具有交点的邻边上的边缘像素点的位置坐标,确定所述邻边上的边缘像素点的透明度;其中,靠近所述顶端像素点的边缘像素点的透明度大于远离所述顶端像素点的边缘像素点的透明度;确定所述目标子区域中与所述边缘像素点对应的关联像素点的透明度等于所述边缘像素点的透明度;所述关联像素点与所述目标边之间的距离等于所述边缘像素点与所述目标边之间的距离。
在一些实施方式中,所述目标边上的顶端像素点为完全透明,所述邻边上与所述顶端像素点相距最远的顶端像素点为完全不透明。
在一些实施方式中,所述线条区域获取模块1100具体用于:响应于接收到用户针对待处理图像的图形添加请求,绘制与所述图形添加请求对应的线条,并基于所述线条确定所述待处理图像中的目标线条区域。
本公开实施例所提供的图像处理装置可执行本公开任意实施例所提供的图像处理方法,具备执行方法相应的功能模块和有益效果。
所属领域的技术人员可以清楚地了解到,为描述的方便和简洁,上述描述的装置实施例的具体工作过程,可以参考方法实施例中的对应过程,在此不再赘述。
本公开实施例还提供了一种电子设备,电子设备包括:处理器;用于存储处理器可执行指令的存储器;处理器,用于从存储器中读取可执行指令,并执行指令以实现上述图像处理方法。
图12为本公开实施例提供的一种电子设备的结构示意图。如图12所示,电子设备1200包括一个或多个处理器1201和存储器1202。
处理器1201可以是中央处理单元(CPU)或者具有数据处理能力和/或指令执行能力的其他形式的处理单元,并且可以控制电子设备1200中的其他组件以执行期望的功能。
存储器1202可以包括一个或多个计算机程序产品,所述计算机程序产品可以包括各种形式的计算机可读存储介质,例如易失性存储器和/或非易失性存储器。所述易失性存储器例如可以包括随机存取存储器(RAM)和/或高速缓冲存储器(cache)等。所述非易失性存储器例如可以包括只读存储器(ROM)、硬盘、闪存等。在所述计算机可读存储介质上可以存储一个或多个计算机程序指令,处理器1201可以运行所述程序指令,以实现上文所述的本公开的实施例的图像处理方法以及/或者其他期望的功能。在所述计算机可读存储介质中还可以存储诸如输入信号、信号分量、噪声分量等各种内容。
在一个示例中,电子设备1200还可以包括:输入装置1203和输出装置1204,这些组件通过总线系统和/或其他形式的连接机构(未示出)互连。
此外,该输入装置1203还可以包括例如键盘、鼠标等等。
该输出装置1204可以向外部输出各种信息,包括确定出的距离信息、方向信息等。该输出装置1204可以包括例如显示器、扬声器、打印机、以及通信网络及其所连接的远程输出设备等等。
当然,为了简化,图12中仅示出了该电子设备1200中与本公开有关的组件中的一些,省略了诸如总线、输入/输出接口等等的组件。除此之外,根据具体应用情况,电子设备1200还可以包括任何其他适当的组件。
除了上述方法和设备以外,本公开的实施例还可以是计算机程序产品,其包括计算机程序指令,所述计算机程序指令在被处理器运行时使得所述处理器执行本公开实施例所提供的图像处理方法。
所述计算机程序产品可以以一种或多种程序设计语言的任意组合来编写用于执行本公开实施例操作的程序代码,所述程序设计语言包
括面向对象的程序设计语言,诸如Java、C++等,还包括常规的过程式程序设计语言,诸如“C”语言或类似的程序设计语言。程序代码可以完全地在用户计算设备上执行、部分地在用户设备上执行、作为一个独立的软件包执行、部分在用户计算设备上部分在远程计算设备上执行、或者完全在远程计算设备或服务器上执行。
此外,本公开的实施例还可以是计算机可读存储介质,其上存储有计算机程序指令,所述计算机程序指令在被处理器运行时使得所述处理器执行本公开实施例所提供的图像处理方法。
所述计算机可读存储介质可以采用一个或多个可读介质的任意组合。可读介质可以是可读信号介质或者可读存储介质。可读存储介质例如可以包括但不限于电、磁、光、电磁、红外线、或半导体的系统、装置或器件,或者任意以上的组合。可读存储介质的更具体的例子(非穷举的列表)包括:具有一个或多个导线的电连接、便携式盘、硬盘、随机存取存储器(RAM)、只读存储器(ROM)、可擦式可编程只读存储器(EPROM或闪存)、光纤、便携式紧凑盘只读存储器(CD-ROM)、光存储器件、磁存储器件、或者上述的任意合适的组合。
本公开实施例还提供了一种计算机程序产品,包括计算机程序/指令,该计算机程序/指令被处理器执行时实现本公开实施例中的图像处理方法。
可以理解的是,在使用本公开各施例公开的技术方案之前,均应当依据相关法律法规通过恰当的方式对本公开所涉及个人信息的类型、使用范围、使用场景等告知用户并获得用户的授权。
例如,在响应于接收到用户的主动请求时,向用户发送提示信息,以明确地提示用户,其请求执行的操作将需要获取和使用到用户的个人信息。从而,使得用户可以根据提示信息来自主地选择是否向执行本公开技术方案的操作的电子设备、应用程序、服务器或存储介质等软件或硬件提供个人信息。
作为一种可选的但非限定性的实现方式,响应于接收到用户的主动请求,向用户发送提示信息的方式例如可以是弹窗的方式,弹窗中可以以文字的方式呈现提示信息。此外,弹窗中还可以承载供用户选择“同意”或者“不同意”向电子设备提供个人信息的选择控件。
可以理解的是,上述通知和获取用户授权过程仅是示意性的,不对本公开的实现方式构成限定,其他满足相关法律法规的方式也可应用于本公开的实现方式中。
需要说明的是,在本文中,诸如“第一”和“第二”等之类的关系术语仅仅用来将一个实体或者操作与另一个实体或操作区分开来,而不一定要求或者暗示这些实体或操作之间存在任何这种实际的关系或者顺序。而且,术语“包括”、“包含”或者其任何其他变体意在涵盖非排他性的包含,从而使得包括一系列要素的过程、方法、物品或者设备不仅包括那些要素,而且还包括没有明确列出的其他要素,或者是还包括为这种过程、方法、物品或者设备所固有的要素。在没有更多限制的情况下,由语句“包括一个……”限定的要素,并不排除在包括所述要素的过程、方法、物品或者设备中还存在另外的相同要素。
以上所述仅是本公开的具体实施方式,使本领域技术人员能够理解或实现本公开。对这些实施例的多种修改对本领域的技术人员来说将是显而易见的,本文中所定义的一般原理可以在不脱离本公开的精神或范围的情况下,在其它实施例中实现。因此,本公开将不会被限制于本文所述的这些实施例,而是要符合与本文所公开的原理和新颖特点相一致的最宽的范围。
Claims (12)
- 一种图像处理方法,包括:获取待处理图像中的目标线条区域;确定所述目标线条区域中的目标子区域;对所述目标子区域进行渐变虚化处理,其中,所述目标子区域中靠近所述目标线条区域的目标边的像素点的透明度大于所述目标子区域中远离所述目标线条区域的目标边的像素点的透明度,且所述目标边是所述目标子区域与所述目标线条区域相重合的边。
- 根据权利要求1所述的方法,其中所述确定所述目标线条区域中的目标子区域,包括:在不裁剪所述目标线条区域的情况下,从所述目标线条区域的所有边中确定目标边,并获取与所述目标边对应的第一可调参数;基于所述目标边以及所述第一可调参数确定所述目标子区域;其中,所述第一可调参数用于确定所述目标子区域中未与所述目标边重合的边。
- 根据权利要求1所述的方法,其中所述确定所述目标线条区域中的目标子区域,包括:在裁剪所述目标线条区域的情况下,获取所述目标线条区域对应的裁剪边;基于所述裁剪边确定裁剪后的所述目标线条区域,从裁剪后的所述目标线条区域的所有边中确定目标边,并获取与所述目标边对应的第二可调参数;基于所述目标边以及所述第二可调参数确定所述目标子区域;其中,所述第二可调参数用于确定裁剪后的所述目标线条区域中未与所述目标边重合的边。
- 根据权利要求1至3任一项所述的方法,其中所述目标线条区域具有多条目标边;每条所述目标边分别对应一个目标子区域,且所述目标边是与其相应的目标子区域的长边。
- 根据权利要求1所述的方法,其中所述对所述目标子区域进行渐变虚化处理,包括:获取所述目标子区域中的像素点对应的原始像素值和位置坐标;基于所述目标子区域中的像素点对应的位置坐标,确定所述目标子区域中的像素点对应的透明度;根据所述目标子区域中的像素点对应的原始像素值以及透明度,确定所述目标子区域中的像素点的实际像素值。
- 根据权利要求5所述的方法,其中所述基于所述目标子区域中的像素点对应的位置坐标,确定所述目标子区域中的像素点对应的透明度,包括:基于所述目标子区域的目标边的顶端像素点的位置坐标以及所述目标子区域中与所述目标边具有交点的邻边上的边缘像素点的位置坐标,确定所述邻边上的边缘像素点的透明度;其中,靠近所述顶端像素点的边缘像素点的透明度大于远离所述顶端像素点的边缘像素点的透明度;确定所述目标子区域中与所述边缘像素点对应的关联像素点的透明度等于所述边缘像素点的透明度;其中所述关联像素点与所述目标边之间的距离等于所述边缘像素点与所述目标边之间的距离。
- 根据权利要求6所述的方法,其中所述目标边上的顶端像素点为完全透明,所述邻边上与所述顶端像素点相距最远的顶端像素点为完全不透明。
- 根据权利要求1所述的方法,其中所述获取待处理图像中的目标线条区域,包括:响应于接收到用户针对待处理图像的图形添加请求,绘制与所述图形添加请求对应的线条,并基于所述线条确定所述待处理图像中的目标线条区域。
- 一种图像处理装置,包括:线条区域获取模块,用于获取待处理图像中的目标线条区域;子区域确定模块,用于确定所述目标线条区域中的目标子区域;虚化处理模块,用于对所述目标子区域进行渐变虚化处理,其中,所述目标子区域中靠近所述目标线条区域的目标边的像素点的透明度大于所述目标子区域中远离所述目标线条区域的目标边的像素点的透明度,且所述目标边是所述目标子区域与所述目标线条区域相重合的边。
- 一种电子设备,所述电子设备包括:处理器;用于存储所述处理器可执行指令的存储器;所述处理器,用于从所述存储器中读取所述可执行指令,并执行所述指令以实现上述权利要求1-8中任一所述的图像处理方法。
- 一种计算机可读存储介质,所述存储介质存储有计算机程序,所述计算机程序用于执行上述权利要求1-8中任一所述的图像处理方法。
- 一种计算机程序产品,包括指令,所述指令在被处理器执行时实现权利要求1-8中任一所述的图像处理方法。
Applications Claiming Priority (2)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| CN202310869000.4 | 2023-07-14 | ||
| CN202310869000.4A CN116894781A (zh) | 2023-07-14 | 2023-07-14 | 图像处理方法、装置、设备及介质 |
Publications (1)
| Publication Number | Publication Date |
|---|---|
| WO2025016331A1 true WO2025016331A1 (zh) | 2025-01-23 |
Family
ID=88314578
Family Applications (1)
| Application Number | Title | Priority Date | Filing Date |
|---|---|---|---|
| PCT/CN2024/105295 Pending WO2025016331A1 (zh) | 2023-07-14 | 2024-07-12 | 图像处理方法、装置、设备及介质 |
Country Status (2)
| Country | Link |
|---|---|
| CN (1) | CN116894781A (zh) |
| WO (1) | WO2025016331A1 (zh) |
Families Citing this family (1)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN116894781A (zh) * | 2023-07-14 | 2023-10-17 | 北京字跳网络技术有限公司 | 图像处理方法、装置、设备及介质 |
Citations (5)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN107154063A (zh) * | 2017-04-19 | 2017-09-12 | 腾讯科技(深圳)有限公司 | 图像展示区域的形状设置方法及装置 |
| CN113093903A (zh) * | 2021-03-18 | 2021-07-09 | 聚好看科技股份有限公司 | 一种图像显示方法及显示设备 |
| CN113674303A (zh) * | 2021-08-31 | 2021-11-19 | Oppo广东移动通信有限公司 | 图像处理方法、装置、电子设备及存储介质 |
| US20230186445A1 (en) * | 2021-12-14 | 2023-06-15 | International Business Machines Corporation | Resolving obfuscated sections of an image with selectively captured new imagery |
| CN116894781A (zh) * | 2023-07-14 | 2023-10-17 | 北京字跳网络技术有限公司 | 图像处理方法、装置、设备及介质 |
Family Cites Families (2)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN103473780B (zh) * | 2013-09-22 | 2016-05-25 | 广州市幸福网络技术有限公司 | 一种人像背景抠图的方法 |
| CN108076286B (zh) * | 2017-11-30 | 2019-12-27 | Oppo广东移动通信有限公司 | 图像虚化方法、装置、移动终端和存储介质 |
-
2023
- 2023-07-14 CN CN202310869000.4A patent/CN116894781A/zh active Pending
-
2024
- 2024-07-12 WO PCT/CN2024/105295 patent/WO2025016331A1/zh active Pending
Patent Citations (5)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN107154063A (zh) * | 2017-04-19 | 2017-09-12 | 腾讯科技(深圳)有限公司 | 图像展示区域的形状设置方法及装置 |
| CN113093903A (zh) * | 2021-03-18 | 2021-07-09 | 聚好看科技股份有限公司 | 一种图像显示方法及显示设备 |
| CN113674303A (zh) * | 2021-08-31 | 2021-11-19 | Oppo广东移动通信有限公司 | 图像处理方法、装置、电子设备及存储介质 |
| US20230186445A1 (en) * | 2021-12-14 | 2023-06-15 | International Business Machines Corporation | Resolving obfuscated sections of an image with selectively captured new imagery |
| CN116894781A (zh) * | 2023-07-14 | 2023-10-17 | 北京字跳网络技术有限公司 | 图像处理方法、装置、设备及介质 |
Also Published As
| Publication number | Publication date |
|---|---|
| CN116894781A (zh) | 2023-10-17 |
Similar Documents
| Publication | Publication Date | Title |
|---|---|---|
| US8290300B2 (en) | Seam-based reduction and expansion of images with color-weighted priority | |
| US8384738B2 (en) | Compositing windowing system | |
| US9142044B2 (en) | Apparatus, systems and methods for layout of scene graphs using node bounding areas | |
| US8160398B1 (en) | Independent resizing of multiple image regions | |
| CN111581570B (zh) | 一种页面布局方法及计算设备 | |
| WO2021248705A1 (zh) | 图像渲染方法、装置、计算机程序和可读介质 | |
| US8218900B1 (en) | Non-linear image scaling with seam energy | |
| CN106095437A (zh) | 用户界面从右到左rtl的布局方式的实现方法及装置 | |
| CN115147579A (zh) | 一种扩展图块边界的分块渲染模式图形处理方法及系统 | |
| WO2025016331A1 (zh) | 图像处理方法、装置、设备及介质 | |
| CN114627225B (zh) | 图形渲染方法、装置及存储介质 | |
| CN110457102A (zh) | 可视对象的模糊方法、渲染方法及计算设备 | |
| US8280186B1 (en) | Seam-based reduction and expansion of images with table-based priority | |
| CN114625997A (zh) | 页面渲染方法及装置、电子设备、计算机可读介质 | |
| CN112449167A (zh) | 一种图像锯齿的消除、图像显示方法及装置 | |
| US8280187B1 (en) | Seam carving and expansion of images with color frequency priority | |
| US8265424B1 (en) | Variable seam replication in images with energy-weighted priority | |
| US20240078634A1 (en) | Method and system for processing graphics in tile-based rendering mode by expanding boundaries of tiles | |
| CN110825282B (zh) | 一种图片展示方法、装置、电子设备及存储介质 | |
| CN109739403B (zh) | 用于处理信息的方法和装置 | |
| US8270766B1 (en) | Hybrid seam carving and scaling of images with configurable carving tolerance | |
| CN118042190A (zh) | 视频处理方法、装置、设备及介质 | |
| CN115033226B (zh) | 页面显示方法、装置、终端设备及计算机可读存储介质 | |
| CN111540033A (zh) | 图像制作方法、装置、浏览器、计算机设备及存储介质 | |
| CN116302230A (zh) | 一种页面展示方法、装置及设备 |
Legal Events
| Date | Code | Title | Description |
|---|---|---|---|
| 121 | Ep: the epo has been informed by wipo that ep was designated in this application |
Ref document number: 24842324 Country of ref document: EP Kind code of ref document: A1 |
|
| NENP | Non-entry into the national phase |
Ref country code: DE |