Image processing method and device

By performing pixel filling and Gaussian blur processing on non-spike images, the problem of blackening or darkening caused by the Gaussian blur algorithm when processing non-rectangular images is solved, and the image blur effect is improved.

CN120219227APending Publication Date: 2025-06-27VIVO MOBILE COMM CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202510411884.8
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-04-02
Publication Date
2025-06-27

AI Technical Summary

Technical Problem

When the existing Gaussian blur algorithm processes non-rectangular images, it will cause black or darker edges to appear at the edges of the image, affecting the blur effect.

Method used

By determining the pixel values ​​of pixel points in a non-rectangular image, the area to be filled in the Gaussian blur area is formed, and the matrix is ​​subjected to Gaussian blur processing to generate a Gaussian blur image.

Benefits of technology

It effectively avoids the difference in pixel values ​​between the area to be filled and the non-rectangular image, reduces the phenomenon of blackening or darkening, and improves the effect of electronic devices to perform Gaussian blurring on non-rectangular images.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120219227A_ABST
    Figure CN120219227A_ABST
Patent Text Reader

Abstract

The invention discloses an image processing method and device, and belongs to the technical field of image processing. The method comprises the steps of determining a first pixel value based on pixel values of pixel points in a non-rectangular image; based on the first pixel value, performing pixel filling on a to-be-filled area in a Gaussian blur area corresponding to the non-rectangular image to obtain a pixel matrix; performing Gaussian blur processing on the pixel matrix to generate a Gaussian blur image; wherein the Gaussian blur region is a circumscribed rectangle of the non-rectangular image, and the to-be-filled region is a region, except the non-rectangular image, in the circumscribed rectangle.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application belongs to the technical field of image processing, and particularly relates to an image processing method and apparatus. Background Art

[0002] With the development of image processing technology, an electronic device can perform Gaussian blur processing on a displayed image using a Gaussian blur algorithm, making the display interface of the electronic device look more spatially layered, as if the foreground elements are floating above the blurred displayed image, bringing a three-dimensional visual experience to the user and increasing the realism and immersion of the interface.

[0003] In the related art, the Gaussian function is a bell-shaped curve, and the pixels closer to the center have higher weights, while those farther away have lower weights. First, a weight matrix is used to traverse each pixel point of the image, and corresponding weights are assigned to the pixels within the weight matrix according to the Gaussian distribution, and the new pixel value of the pixel point at the center of the weight matrix is calculated by weighted averaging. Therefore, the new pixel value of each pixel point after Gaussian blur is closely related to the values of its adjacent pixel points.

[0004] However, since the weight matrix is a rectangular matrix, if the displayed image to be processed is non-rectangular, when the weight matrix traverses to the irregular edge of the displayed image, there will be a part of the weight matrix in the area outside the displayed image. At this time, the Gaussian blur algorithm will fill the pixel points in this area with black for Gaussian blur calculation. In this way, there may be a phenomenon of blackening or darkening at the edge of the displayed image, resulting in a poor Gaussian blur effect. Summary of the Invention

[0005] The purpose of the embodiments of this application is to provide an image processing method and apparatus that can improve the Gaussian blur effect of an electronic device in processing images.

[0006] In a first aspect, the embodiments of this application provide an image processing method, which includes: determining a first pixel value based on the pixel values of pixel points in a non-rectangular image; performing pixel filling on a to-be-filled area in a Gaussian blur area corresponding to the non-rectangular image based on the first pixel value to obtain a pixel matrix; performing Gaussian blur processing on the pixel matrix to generate a Gaussian blur image; where the Gaussian blur area is the circumscribed rectangle of the non-rectangular image, and the to-be-filled area is the area in the circumscribed rectangle except the non-rectangular image.

[0007] In a second aspect, an embodiment of the present application provides an image processing device, which includes a processing module, a filling module, and a generating module; the processing module is configured to determine a first pixel value based on the pixel values of the pixel points in the non-rectangular image; the filling module is configured to perform pixel filling on the area to be filled in the Gaussian blur area corresponding to the non-rectangular image based on the first pixel value to obtain a pixel matrix; the generating module is configured to perform Gaussian blur processing on the pixel matrix to generate a Gaussian blur image; wherein, the Gaussian blur area is the circumscribed rectangle of the non-rectangular image, and the area to be filled is the area in the circumscribed rectangle except the non-rectangular image.

[0008] In a third aspect, an embodiment of the present application provides an electronic device, which includes a processor and a memory, and the memory stores a program or instruction that can run on the processor. When the program or instruction is executed by the processor, the steps of the method described in the first aspect are implemented.

[0009] In a fourth aspect, an embodiment of the present application provides a readable storage medium, and a program or instruction is stored on the readable storage medium. When the program or instruction is executed by a processor, the steps of the method described in the first aspect are implemented.

[0010] In a fifth aspect, an embodiment of the present application provides a chip, which includes a processor and a communication interface, and the communication interface is coupled to the processor. The processor is configured to run a program or instruction to implement the method described in the first aspect.

[0011] In a sixth aspect, an embodiment of the present application provides a computer program product, which is stored in a storage medium, and the program product is executed by at least one processor to implement the method described in the first aspect.

[0012] In the embodiment of the present application, a first pixel value is determined based on the pixel values of the pixel points in the non-rectangular image; pixel filling is performed on the area to be filled in the Gaussian blur area corresponding to the non-rectangular image based on the first pixel value to obtain a pixel matrix; Gaussian blur processing is performed on the pixel matrix to generate a Gaussian blur image; wherein, the Gaussian blur area is the circumscribed rectangle of the non-rectangular image, and the area to be filled is the area in the circumscribed rectangle except the non-rectangular image. In this solution, since the first pixel value is determined according to the pixel values of the pixel points in the non-rectangular image, therefore, using the first pixel value to perform pixel filling on the area to be filled can make the imaging effect of the area to be filled similar to that of the non-rectangular image, so that when performing Gaussian blur processing on the pixel matrix obtained after filling, the phenomenon of excessive difference in pixel values between the area to be filled and the non-rectangular image, resulting in blackening or darkening, is avoided, thereby improving the Gaussian blur effect of the electronic device on the non-rectangular image. Description of the Drawings

[0013] Figure 1 is one of the schematic diagrams of an image processing method provided by an embodiment of the present application;

[0014] Figure 2 is a schematic diagram of expanding a circular image into a rectangular image provided by an embodiment of the present application;

[0015] Figure 3 is a schematic diagram of expanding a square image into a rectangular image provided by an embodiment of the present application;

[0016] Figure 4 is a schematic diagram of a target area of a circular image provided by an embodiment of the present application;

[0017] Figure 5 is a schematic diagram of a target area of a square image provided by an embodiment of the present application;

[0018] Figure 6 is one of the schematic diagrams of the structure of an image processing device provided by an embodiment of the present application;

[0019] Figure 7 is the second schematic diagram of the structure of an image processing device provided by an embodiment of the present application;

[0020] Figure 8 is one of the schematic diagrams of the hardware structure of an electronic device provided by an embodiment of the present application;

[0021] Figure 9 is the second schematic diagram of the hardware structure of an electronic device provided by an embodiment of the present application. Detailed implementation manners

[0022] Next, the technical solutions in the embodiments of the present application will be clearly described in conjunction with the accompanying drawings in the embodiments of the present application. Obviously, the described embodiments are some, rather than all, of the embodiments of the present application. Based on the embodiments in the present application, all other embodiments obtained by those of ordinary skill in the art belong to the scope of protection of the present application.

[0023] The terms "first", "second", etc. in the specification and claims of the present application are used to distinguish similar objects, rather than to describe a specific order or sequence. It should be understood that such terms can be interchanged under appropriate circumstances so that the embodiments of the present application can be implemented in an order other than those illustrated or described herein, and the objects distinguished by "first", "second", etc. generally belong to the same category, and the number of objects is not limited. For example, the first object can be one or more. In addition, "and / or" in the specification means at least one of the connected objects, and the character " / ", generally represents an "or" relationship between the associated objects before and after.

[0024] The terms "at least one (item)", "at least one of", etc. in the description and claims of this application refer to any one, any two or more combinations of the objects it contains. For example, at least one (item) of a, b, and c can represent: "a", "b", "c", "a and b", "a and c", "b and c", and "a, b, and c", where a, b, and c can be single or multiple. Similarly, "at least two (items)" means two or more, and its meaning is similar to that of "at least one (item)".

[0025] The identifiers in this application are words, symbols, images, etc. used to indicate information, and can use identifiers or other containers as carriers for displaying information, including but not limited to text identifiers, image identifiers, symbol identifiers, etc.

[0026] It should be noted that for the image processing method provided in the embodiments of this application, the execution subject can be an electronic device such as a mobile phone, a tablet computer, a laptop computer, a handheld computer, a vehicle-mounted electronic device, etc. In some embodiments of this application, taking the electronic device as the execution subject to execute the image processing method as an example, the image processing method provided in the embodiments of this application is described.

[0027] The following combines the accompanying drawings to elaborate in detail on the image processing method and device provided in the embodiments of this application through specific embodiments and their application scenarios.

[0028] Gaussian blur can simulate a depth effect, making the interface look more spatially layered, as if the foreground elements are floating above the blurred background, bringing a three-dimensional visual experience to the user and increasing the realism and immersion of the interface. Compared with a solid color background or a clear image background, the blurred background after Gaussian blur has a soft and hazy beauty, which can add a touch of delicacy and elegance to the interface, making the entire UI design more vivid and interesting, and avoiding the monotony and mediocrity of the interface. Therefore, the Gaussian blur effect is widely used in the effect display of various operating systems (OS) and applications (APPs).

[0029] In the related art, the core of Gaussian blur is to calculate the new value of each pixel point using the Gaussian function. The Gaussian function is a bell-shaped curve, where the pixel points closer to the center have higher weights, and the farther away, the lower the weights. From a programming perspective, the Gaussian function needs to traverse each pixel point in the image, determine a neighborhood range centered on a pixel point, assign weights to the pixel points within the neighborhood according to the Gaussian distribution, and calculate the new pixel value of the central pixel point through weighted averaging. Therefore, the new pixel value of each pixel point after Gaussian blur is closely related to the pixel values of its adjacent pixel points. This results in a phenomenon where, after performing Gaussian blur calculations on some curved screens, the area near the interface curve appears darker / darker. This is because the calculation methods used for Gaussian blur are all calculated according to rectangles, and the parts outside the screen curve will be automatically filled with black, so it will cause the area near the interface curve to be darker or darker.

[0030] In response to this, in the image processing method provided in the embodiments of the present application, based on the pixel values of the pixel points in the non-rectangular image, a first pixel value is determined; based on the first pixel value, pixel filling is performed on the area to be filled in the Gaussian blur area corresponding to the non-rectangular image to obtain a pixel matrix; Gaussian blur processing is performed on the pixel matrix to generate a Gaussian blur image; where the Gaussian blur area is the circumscribed rectangle of the non-rectangular image, and the area to be filled is the area in the circumscribed rectangle except the non-rectangular image. In this solution, since the first pixel value is determined according to the pixel values of the pixel points in the non-rectangular image, therefore, using the first pixel value to perform pixel filling on the area to be filled can make the imaging effect of the area to be filled similar to that of the non-rectangular image, so that when performing Gaussian blur processing on the pixel matrix obtained after filling, the phenomenon of excessive difference in pixel values between the area to be filled and the non-rectangular image, resulting in darkening or darkening, is avoided, thereby improving the effect of Gaussian blur of the non-rectangular image by the electronic device.

[0031] The execution subject of the image processing method provided in the embodiments of the present application can be an image processing device. Exemplarily, the image processing device can be an electronic device, or a component in the electronic device, such as an integrated circuit or a chip. Hereinafter, the image processing method provided in the embodiments of the present application will be exemplarily described taking an electronic device as an example.

[0032] The embodiments of the present application provide an image processing method, Figure 1 which shows a flowchart of an image processing method provided in the embodiments of the present application. This method can be applied to an electronic device. As Figure 1 shown, the image processing method provided in the embodiments of the present application may include the following steps 201 to step 203.

[0033] Step 201: The electronic device determines a first pixel value based on the pixel values of the pixel points in the non-rectangular image.

[0034] In some embodiments of the present application, the above non-rectangular image may be an image displayed on the display screen of an electronic device.

[0035] Exemplarily, the above non-rectangular image may be a display image of an application interface of an application, or a display image of a desktop interface of an electronic device, or any display image displayed on the display screen of an electronic device.

[0036] Exemplarily, the above non-rectangular image may be a circular image, a square image with four rounded corners, a triangular image, or any irregular image.

[0037] In some embodiments of the present application, the electronic device obtains the pixel values of each pixel point in the non-rectangular image, and determines the above first pixel value according to these pixel values.

[0038] In some embodiments of the present application, the above first pixel value may be the average pixel value of all pixel points in a certain area of the non-rectangular image, or the pixel value with the most same pixel values in the non-rectangular image, or any pixel value in the non-rectangular image.

[0039] In a possible embodiment, the electronic device obtains the pixel values of each pixel point in the non-rectangular image, counts the number of pixel points with the same pixel value, and determines the pixel value corresponding to the largest number as the first pixel value.

[0040] For example, the non-rectangular image contains 9 pixel points, and the pixel values are 122, 135, 135, 136, 168, 178, 190, 135, 135 respectively. Among them, the number of pixel points with the pixel value of 135 is the largest, and the pixel value 135 is determined as the first pixel value.

[0041] In another possible embodiment, the electronic device obtains the pixel values of each pixel point in the non-rectangular image, determines a target area from the non-rectangular image, calculates the average pixel value of each pixel point in the target area, and determines the average pixel value as the above first pixel value.

[0042] For example, if the average pixel value of each pixel point in the determined target area of the non-rectangular image is 135, then the pixel value 135 is determined as the first pixel value.

[0043] Step 202: The electronic device performs pixel filling on the area to be filled in the Gaussian blur area corresponding to the non-rectangular image based on the first pixel value to obtain a pixel matrix.

[0044] In some embodiments of the present application, the above Gaussian blur area is a rectangular area obtained by expanding the non-rectangular image.

[0045] In some embodiments of the present application, the above Gaussian blur region is the circumscribed rectangle of a non-rectangular image.

[0046] Exemplarily, the above circumscribed rectangle can be understood as the minimum circumscribed rectangle of the non-rectangular image.

[0047] Exemplarily, the above minimum circumscribed rectangle refers to the maximum range of the non-rectangular image represented by two-dimensional coordinates, that is, a rectangle defined by the maximum abscissa, minimum abscissa, maximum ordinate, and minimum ordinate among the vertices of the given non-rectangular image.

[0048] In some embodiments of the present application, the above Gaussian blur region is the region where the electronic device needs to perform Gaussian blur processing.

[0049] Exemplarily, the above Gaussian blur region corresponds to a pixel matrix.

[0050] In some embodiments of the present application, the above region to be filled is the region in the circumscribed rectangle except the non-rectangular image.

[0051] In some embodiments of the present application, the above region to be filled is the region expanded from the non-rectangular image.

[0052] In other words, the above region to be filled is the region in the Gaussian blur region except the non-rectangular image.

[0053] Exemplarily, the above region to be filled can be one region in the Gaussian blur region or multiple regions in the above Gaussian blur region.

[0054] It should be noted that usually an image is stored in the frame buffer of an electronic device in a rectangular form. When the electronic device starts to perform Gaussian blur processing on a certain non-rectangular image, it will obtain the pixel matrix corresponding to the non-rectangular image from the frame buffer. Each matrix element is the pixel value of a pixel point. At this time, for the region outside the non-rectangular image, that is, the pixel values of all pixel points in the above region to be filled are usually automatically filled with 0 by the electronic device, that is, black. However, in the embodiments of the present application, the electronic device fills the first pixel value determined based on the non-rectangular image into the above region to be filled.

[0055] Example 1, as Figure 2 shown, taking the non-rectangular image as a circular image as an example, the circular image 21 is expanded into a rectangular image 22. Among them, A1, B1, C1, and D1 are the regions to be filled of the circular image.

[0056] Example 2, as Figure 3 shown, taking the non-rectangular image as a square image 31 with four rounded corners as an example, the square image is expanded into a rectangular image 32. Among them, X1, YI, M1, and N1 are the regions to be filled of the square image.

[0057] In some embodiments of the present application, after determining the first pixel value, when the electronic device obtains the pixel matrix corresponding to the non-rectangular image, each pixel point in the to-be-filled area is filled with the first pixel value to obtain a new pixel matrix.

[0058] Example 3, in combination with Example 1, taking the non-rectangular image as a circular image as an example, the electronic device first obtains the pixel matrix of the circular image from the frame buffer:

[0059]

[0060] Next, the electronic device determines that the first pixel value is 45, and then fills the pixel value 45 into the to-be-filled area in the above pixel matrix to obtain a new pixel matrix:

[0061]

[0062] Step 203: The electronic device performs Gaussian blur processing on the pixel matrix to generate a Gaussian blur image.

[0063] In some embodiments of the present application, the electronic device uses a Gaussian blur algorithm to perform Gaussian blur processing on the above pixel matrix to obtain a new pixel matrix, and converts the pixel matrix into a Gaussian blur image to obtain the Gaussian blur image corresponding to the non-rectangular image.

[0064] Gaussian Blur, also known as Gaussian smoothing and Gaussian filtering, is usually used to reduce image noise and reduce the level of details, and is often also used to blur images.

[0065] Generally speaking, Gaussian blur is a process of weighted averaging the entire image. The value of each pixel point is obtained by weighted averaging itself and other pixel values in its neighborhood. The specific operation of Gaussian blur is: scan each pixel in the image with a template (or convolution, mask), and replace the pixel value of the pixel point at the center of the template with the weighted average pixel value of the pixels in the neighborhood determined by the weight matrix of the same size as the template.

[0066] In the image processing method provided by the embodiments of the present application, a first pixel value is determined based on the pixel values of the pixel points in the non-rectangular image; based on the first pixel value, pixel filling is performed on the area to be filled in the Gaussian blur area corresponding to the non-rectangular image to obtain a pixel matrix; the pixel matrix is subjected to Gaussian blur processing to generate a Gaussian blur image; wherein, the Gaussian blur area is the circumscribed rectangle of the non-rectangular image, and the area to be filled is the area in the circumscribed rectangle except the non-rectangular image. In this solution, since the first pixel value is determined according to the pixel values of the pixel points in the non-rectangular image, therefore, using the first pixel value to perform pixel filling on the area to be filled can make the imaging effect of the area to be filled similar to that of the non-rectangular image, so that when performing Gaussian blur processing on the pixel matrix obtained after filling, the phenomenon of excessive difference in pixel values between the area to be filled and the non-rectangular image, resulting in blackening or darkening, is avoided, thereby improving the Gaussian blur effect of the electronic device on the non-rectangular image.

[0067] Optionally, in some embodiments of the present application, before the above step 202 "the electronic device performs pixel filling on the area to be filled in the Gaussian blur area corresponding to the non-rectangular image based on the first pixel value", the image processing method provided by the embodiments of the present application further includes steps 301 to 303.

[0068] Step 301: The electronic device determines a target area from the non-rectangular image based on the image parameters of the non-rectangular image.

[0069] In some embodiments of the present application, the above image parameters of the non-rectangular image include, but are not limited to, at least one of the following: size, resolution, pixel value, color value, brightness, saturation.

[0070] In some embodiments of the present application, the above target area may be any area in the above non-rectangular image.

[0071] Exemplarily, the above target area may be an area adjacent to the area to be filled, or a preset area of the electronic device, or a user-defined specified area, and the present application does not make any restrictions.

[0072] Exemplarily, the above target area may be one area in the non-rectangular image, or multiple areas in the non-rectangular image.

[0073] In some embodiments of the present application, the electronic device may determine a target area related to the area to be filled from the non-rectangular image according to the image parameters of the non-rectangular image.

[0074] Exemplarily, the electronic device can obtain the irregular image edges in the non-rectangular image according to the image parameters of the non-rectangular image, and determine the area near the edges as the target area, so that the electronic device can obtain the average pixel value of all pixel points in the irregular area.

[0075] Step 302: The electronic device calculates the average pixel value of the target area according to the pixel values of each pixel point in the target area.

[0076] In some embodiments of the present application, the electronic device obtains the pixel values of each pixel point in the target area from the pixel values of each pixel point in the non-rectangular image, and calculates the average pixel value of all pixel points in the target area.

[0077] In one possible embodiment, the above target area may be one target area, and the electronic device can obtain the average pixel value of all pixel points in the target area.

[0078] In another possible embodiment, the above target area may be multiple target areas. The electronic device can obtain the average pixel value corresponding to each target area respectively, or the electronic device obtains the average pixel value of all pixel points in all target areas.

[0079] Step 303: The electronic device determines the average pixel value as the first pixel value.

[0080] In some embodiments of the present application, the electronic device determines the average pixel value of all pixel points in the target area as the first pixel value, and performs pixel filling on the area to be filled based on the first pixel value.

[0081] For example, the non-rectangular image contains 9 pixel points with pixel values of 122, 135, 135, 136, 168, 178, 190, 135, 135 respectively, and the pixel values of the target area are 135, 135, 136, 168 respectively. Then, the average pixel value of all pixel points in the target area is calculated as 143.5. Therefore, the pixel value 143.5 is determined as the first pixel value.

[0082] In this way, the electronic device determines the target area related to the area to be filled, calculates the average pixel value of the target area to determine the first pixel value, so that when using the first pixel value to perform pixel filling on the area to be filled, it can ensure the imaging effect of the area to be filled is consistent with that of the non-rectangular image, and avoid the problem of poor effect caused by excessive differences between image areas during Gaussian blur processing.

[0083] The following uses two specific embodiments to exemplarily illustrate the above step 301 "The electronic device determines the target area from the non-rectangular image based on the image parameters of the non-rectangular image".

[0084] In the first possible embodiment, the non-rectangular image is a circular image.

[0085] In some embodiments of the present application, the image parameters include the position information of four target endpoints in the circular image.

[0086] In some embodiments of the present application, the four target endpoints include two endpoints of the horizontal diameter of the circular image and two endpoints of the vertical diameter of the circular image.

[0087] Further, in some embodiments of the present application, step 301 may be specifically implemented by the following step 301a.

[0088] Step 301a: The electronic device sequentially connects adjacent endpoints among the four target endpoints to obtain four second regions, and determines the four second regions as target regions.

[0089] In some embodiments of the present application, one of the second regions is a region enclosed by a line segment formed by connecting any adjacent endpoints and a minor arc corresponding to the adjacent endpoints in the circular image.

[0090] Exemplarily, after the electronic device obtains the image parameters of the circular image, four second regions are divided on the circular image by sequentially connecting the starting points of adjacent arcs.

[0091] Exemplarily, the four second regions are respectively located at four positions of the circular image, namely the upper left region, the lower left region, the upper right region, and the lower right region.

[0092] Exemplarily, when the second region is located in the upper left region, assuming that the center coordinates of the circular image are (0, 0), the coordinates of the pixel points in the second region are (x, y), and the radius of the circular image is r, the distance from the pixel points in the second region to the center of the circular image needs to satisfy formula 1:

[0093] x 2 + y 2 ≤ r 2 and x - y ≤ -r (1)

[0094] Exemplarily, when the second region is located in the upper right region, assuming that the center coordinates of the circular image are (0, 0), the coordinates of the pixel points in the second region are (x, y), and the radius of the circular image is r, the distance from the pixel points in the second region to the center of the circular image needs to satisfy formula 2:

[0095] x 2 + y 2 ≤ r 2 and x + y ≥ r (2)

[0096] Exemplarily, when the above-mentioned second region is located in the lower right region, assuming that the center coordinates of the circular image are (0, 0), the coordinates of the pixel points in the second region are (x, y), and the radius of the circular image is r, the distance from the pixel points in the second region to the center of the circular image needs to satisfy Formula 3:

[0097] x 2 + y 2 ≤ r 2 and x - y ≥ r (3)

[0098] Exemplarily, when the above-mentioned second region is located in the lower left region, assuming that the center coordinates of the circular image are (0, 0), the coordinates of the pixel points in the second region are (x, y), and the radius of the circular image is r, the distance from the pixel points in the second region to the center of the circular image needs to satisfy Formula 4:

[0099] x 2 + y 2 ≤ r 2 and x + y ≤ -r (4)

[0100] Example 4, combined with Example 1, as Figure 4 shown, taking a non-rectangular image as a circular image as an example, 4 target endpoints are determined from the circular image 21, namely target endpoint 41, target endpoint 42, target endpoint 43, and target endpoint 44. The adjacent endpoints among the four target endpoints are connected in sequence to obtain four second regions, namely region A0, region B0, region C0, and region D0. Each region corresponds to a part of the region to be filled. Region A0 corresponds to the region to be filled A1, region B0 corresponds to the region to be filled B1, region C0 corresponds to the region to be filled C1, and region D0 corresponds to the region to be filled D1.

[0101] In one example, the electronic device can calculate the average pixel value of all pixel points in a second region, and then determine this average pixel value as the first pixel value and fill it into the pixel points of the corresponding region to be filled. By analogy, the average pixel value of each second region is respectively determined as a first pixel value and filled into the pixel points of the region to be filled corresponding to the second region.

[0102] For example, sample the pixel points of region A0, calculate the average pixel value of region A0 after sampling, and fill region A1 with this average pixel value. Because the calculation method of Gaussian blur is to perform weighted averaging using the pixel values of adjacent regions, when performing Gaussian blur calculation on region A0, the pixel values of region A1 have been filled with the average pixel value of region A0. In this way, the pixel values of region A1 will not affect the calculation of region A0. The other 3 regions are filled in the same way.

[0103] In another example, the electronic device calculates the average pixel value of all pixel points in all the second regions, then determines the average pixel value as the first pixel value, and performs pixel filling on all the regions to be filled based on the first pixel value.

[0104] In this way, for an irregular non-rectangular image, there are usually regions to be filled near the irregular edges. By determining the region near the irregular edges as the target region to calculate the average pixel value and performing pixel filling on the adjacent regions to be filled based on the average pixel value, the image can be better smoothed, reducing the difference between the pixel values filled in the regions to be filled and the non-rectangular image, thereby improving the Gaussian blur processing effect on the non-rectangular image.

[0105] In the second possible embodiment, the above non-rectangular image is a square image with four rounded corners.

[0106] In some embodiments of the present application, the above image parameters include the angular radian of the rounded corners of the square image.

[0107] Further, in some embodiments of the present application, step 301 can be specifically implemented by the following step 301b and step 301c.

[0108] Step 301b: The electronic device respectively determines the inscribed circle corresponding to each rounded corner according to the angular radian of each rounded corner.

[0109] In some embodiments of the present application, the electronic device respectively determines the inscribed circle corresponding to each rounded corner according to the angular radian of the four rounded corners.

[0110] Exemplarily, the electronic device calculates the radius of the inscribed circle according to the angular radian of the rounded corner, and determines the inscribed circle corresponding to the rounded corner based on the radius of the inscribed circle.

[0111] Step 302c: For each rounded corner, the electronic device connects the rounded corner to the two tangent points of the inscribed circle corresponding to the rounded corner in the square image to obtain a third region, and determines the third region corresponding to each rounded corner as the target region.

[0112] In some embodiments of the present application, one of the third regions is a region enclosed by a line segment formed by connecting two tangent points of a rounded corner and the inscribed circle corresponding to the rounded corner in the square image, and the rounded corner.

[0113] Exemplarily, taking one inscribed circle as an example, assuming the radius of the inscribed circle is r and the center coordinates are (0, 0), the coordinates (x, y) of the pixel points in the above third region satisfy the following formula 5:

[0114] (x - Cx) 2 + (y - Cy)2 ≤ r 2 and x - y ≤ Cx - Cy - r (5)

[0115] Example 5, combined with Example 2, as Figure 5 shown, taking a non-rectangular image as an example of one of the four rounded corners of a square image with rounded corners 51, first determine the two tangent points of the inscribed circle 52 and the rounded corner 51, which are the tangent point 53 and the tangent point 54 respectively. Connect the two tangent points of the rounded corner 51 and the inscribed circle 52 to obtain the region X0, that is, the above-mentioned one third region, and this region X0 corresponds to a region X1 to be filled.

[0116] In one example, the electronic device can calculate the average pixel value of all pixel points in a third region, and then determine this average pixel value as the first pixel value and fill it into the pixel points of the corresponding region to be filled. By analogy, determine the average pixel value of each third region as a first pixel value respectively, and fill it into the pixel points of the region to be filled corresponding to the third region.

[0117] For example, taking one of the rounded corners as an example, connect the two tangent points of the inscribed circle to cut out the region X0, sample the pixel points of the region X0, calculate the average pixel value of the region X0 after sampling, and fill the region X1 with this average pixel value. In this way, when performing Gaussian blur on the pixel points of the region X0, since the region X1 is already the average pixel value of the region X0, the pixel value of the pixel points in the region X1 has little influence on the Gaussian calculation result of the region X0 and can be ignored. In this way, the problem of blackening after Gaussian blur calculation of the region X0 can be effectively avoided.

[0118] In another example, the electronic device calculates the average pixel value of all pixel points in all third regions, then determines this average pixel value as the first pixel value, and performs pixel filling on all regions to be filled based on this first pixel value.

[0119] It should be noted that for some devices with poor computing performance, it is impossible to calculate the average value of all pixel points in the above-mentioned A0, B0, C0, D0, and X0. Then, methods such as randomly selecting some pixel points for calculation, calculating at interval pixel points, or using the image processor to reduce the region image can be used to reduce the amount of calculation, thereby reducing the consumption of the electronic device.

[0120] In this way, usually there are regions to be filled along the irregular edges of non-rectangular images. Determining the region near the irregular edge as the target region to find the average pixel value and performing pixel filling on the adjacent regions to be filled based on this average pixel value can better smooth the image, reduce the difference between the pixel values filled in the regions to be filled and the non-rectangular image, and thus improve the Gaussian blur processing effect on non-rectangular images.

[0121] Optionally, in some embodiments of the present application, the above step 203 "the electronic device performs Gaussian blur processing on the pixel matrix to generate a Gaussian blurred image" can be specifically implemented by the following step 203a.

[0122] Step 203a: The electronic device performs Gaussian blur processing on the pixel matrix based on a preset Gaussian blur radius to obtain a processed pixel matrix, and generates a Gaussian blurred image based on the processed pixel matrix.

[0123] In some embodiments of the present application, the value of the above preset Gaussian blur radius is related to the degree of blur of the expected Gaussian blurred image to be generated.

[0124] Exemplarily, the larger the value of the above preset Gaussian blur radius, the greater the degree of image blur; conversely, the smaller the value, the smaller the degree of image blur.

[0125] In some embodiments of the present application, the electronic device determines the size of the first weight matrix according to the preset Gaussian blur radius.

[0126] In some embodiments of the present application, the above Gaussian blur radius is the number of neighboring pixel points extracted when performing Gaussian blur algorithm calculation.

[0127] Exemplarily, when the Gaussian blur radius is 1, taking the center coordinate point of a weight matrix with a coordinate (0, 0) as an example, 1 surrounding coordinate position point is taken to determine a weight matrix size.

[0128] For example:

[0129] (-1,1) (0,1) (1,1) (-1,0) (0,0) (1,0) (-1,-1) (0,-1) (1,-1)

[0130] In some embodiments of the present application, the weight values in the above first weight matrix are related to the distance between pixel points.

[0131] Exemplarily, the weight values in the above first weight matrix are related to the distance between neighboring pixel points and the central pixel point.

[0132] Exemplarily, the closer the distance between the neighboring pixel point and the central pixel point, the greater the weight value; conversely, the farther the distance, the smaller the weight value.

[0133] In some embodiments of the present application, the electronic device uses the above first weight matrix to perform weighted average calculation on each pixel point in the pixel matrix to obtain a new pixel value corresponding to each matrix element in the pixel matrix, so as to obtain a processed pixel matrix.

[0134] In some embodiments of the present application, the electronic device converts the processed pixel matrix into a Gaussian blurred image.

[0135] Exemplarily, the electronic device may adopt the Gaussian algorithm formula, i.e., the following formula 6, to calculate the new pixel value of each pixel point in the pixel matrix.

[0136] Exemplarily, the above formula 6 is:

[0137]

[0138] where r is the blur radius and σ is the standard deviation of the normal distribution. The value of each pixel is the weighted average of the values of the surrounding adjacent pixels. The value of the original pixel has the largest Gaussian distribution value, so it has the largest weight. As the adjacent pixels are farther and farther away from the original pixel, their weights become smaller and smaller. In this way, the edge effect is retained higher than that of other equalization blur filters during the blurring process.

[0139] Example 6, combined with the above weight matrix size, assuming σ = 1.5, the weight matrix with a blur radius of 1 is:

[0140] 0.0453542 0.0566406 0.0453542 0.0566406 0.0707355 0.0566406 0.0453542 0.0566406 0.0453542

[0141] The sum of the weights of these 9 points is equal to 0.04787147. If only the weighted average of these 9 points is calculated, their weight sum must also be equal to 1. Therefore, the above 9 values also need to be divided by 0.04787147 respectively to obtain the final weight matrix:

[0142] 0.0947416 0.118318 0.0947416 0.118318 0.147761 0.118318 0.0947416 0.118318 0.0947416

[0143] With the weight matrix, the Gaussian blur value can be calculated. Assume the pixel values of the existing 9 pixel points are as follows:

[0144] 14 15 16 24 25 26 34 35 36

[0145] Multiply each pixel point by the weight value at the corresponding position in the weight matrix to obtain the following pixel matrix:

[0146] 1.32638 1.77477 1.51587 2.83963 3.69403 3.07627 3.22121 4.14113 3.4107

[0147] Add up these 9 values and take the average, which is the Gaussian blur value of the center point. Repeat this process for each point to obtain the Gaussian blur image.

[0148] Optionally, after generating the Gaussian blur image as described above, since the pixel matrix is a rectangular area while the image is a non-rectangular image, the electronic device may crop the Gaussian blur image according to the size of the non-rectangular image to further obtain the Gaussian blur image corresponding to the non-rectangular image.

[0149] In this way, after the electronic device performs Gaussian blur processing on the pixel matrix, a non-rectangular image with a blur effect is obtained, thereby improving the beautification effect of the image.

[0150] Each of the above method embodiments, or various possible implementation manners in each method embodiment, can be executed independently, or any two or more of them can be combined and executed. Specifically, it can be determined according to actual usage requirements, and the embodiments of the present application do not limit this.

[0151] For the image processing method provided by the embodiments of the present application, the execution subject can be an electronic device or an image processing device. In the embodiments of the present application, taking the image processing device executing the image processing method as an example, the image processing device provided by the embodiments of the present application is described.

[0152] Figure 6 A possible structural schematic diagram of the image processing device involved in the embodiments of the present application is shown. As Figure 6 shown, the image processing device 700 may include: a processing module 701, a filling module 702, and a generating module 703.

[0153] Among them, the above-mentioned processing module 701 is used to determine a first pixel value based on the pixel values of the pixel points in the non-rectangular image; the above-mentioned filling module 702 is used to perform pixel filling on the area to be filled in the Gaussian blur area corresponding to the non-rectangular image based on the first pixel value determined by the processing module 701 to obtain a pixel matrix; the above-mentioned generating module 703 is used to perform Gaussian blur processing on the pixel matrix filled by the filling module 702 to generate a Gaussian blur image; wherein, the Gaussian blur area is the circumscribed rectangle of the non-rectangular image, and the area to be filled is the area in the circumscribed rectangle except the non-rectangular image.

[0154] Optionally, in some embodiments of the present application, in combination with Figure 6 , as Figure 7 shown, the above-mentioned device 700 further includes: a calculation module 704; the above-mentioned processing module 701 is further used to determine a target area from the non-rectangular image based on the image parameters of the non-rectangular image before the filling module 702 performs pixel filling on the area to be filled in the Gaussian blur area corresponding to the non-rectangular image based on the first pixel value; the calculation module 704 is used to calculate the average pixel value of the target area according to the pixel values of each pixel point in the target area determined by the processing module 701; the processing module 701 is further used to determine the average pixel value as the first pixel value.

[0155] Optionally, in some embodiments of the present application, the non-rectangular image is a circular image, and the image parameters include the position information of four target endpoints in the circular image. The four target endpoints include the two endpoints of the horizontal diameter of the circular image and the two endpoints of the vertical diameter of the circular image. The processing module 701 is specifically configured to sequentially connect adjacent endpoints among the four target endpoints to obtain four second regions, and determine the four second regions as target regions. A second region is a region enclosed by a line segment formed by connecting any adjacent endpoints and the minor arc corresponding to the adjacent endpoints in the circular image.

[0156] Optionally, in some embodiments of the present application, the non-rectangular image is a square image with four rounded corners, and the image parameters include the radian of the rounded corners of the square image.

[0157] The processing module 701 is specifically configured to:

[0158] respectively determine the inscribed circle corresponding to each rounded corner according to the radian of each rounded corner;

[0159] For each rounded corner, connect the rounded corner with the two tangent points of the inscribed circle corresponding to the rounded corner in the square image to obtain a third region, and determine the third region corresponding to each rounded corner as a target region. A third region is a region enclosed by a line segment formed by connecting a rounded corner with the two tangent points of the inscribed circle corresponding to the rounded corner in the square image and the rounded corner.

[0160] Optionally, in some embodiments of the present application, the generating module 703 is specifically configured to perform Gaussian blur processing on the pixel matrix based on a preset Gaussian blur radius to obtain a processed pixel matrix, and generate a Gaussian blur image based on the processed pixel matrix. The value of the preset Gaussian blur radius is related to the degree of blur of the expected generated Gaussian blur image.

[0161] In the image processing apparatus provided in the embodiments of the present application, a first pixel value is determined based on the pixel values of the pixel points in the non-rectangular image; based on the first pixel value, pixel filling is performed on the area to be filled in the Gaussian blur area corresponding to the non-rectangular image to obtain a pixel matrix; the pixel matrix is subjected to Gaussian blur processing to generate a Gaussian blur image; wherein, the Gaussian blur area is the circumscribed rectangle of the non-rectangular image, and the area to be filled is the area in the circumscribed rectangle except the non-rectangular image. In this solution, since the first pixel value is determined according to the pixel values of the pixel points in the non-rectangular image, therefore, using the first pixel value to perform pixel filling on the area to be filled can make the imaging effect of the area to be filled similar to that of the non-rectangular image, so that when the pixel matrix obtained after filling is subjected to Gaussian blur processing, the phenomenon of blackening or darkening caused by too large a difference in pixel values between the area to be filled and the non-rectangular image can be avoided, thereby improving the Gaussian blur effect of the image processing apparatus on the non-rectangular image.

[0162] The image processing apparatus in the embodiments of the present application may be an electronic device or a component in an electronic device, such as an integrated circuit or a chip. The electronic device may be a terminal or other devices other than the terminal. Exemplarily, the electronic device may be a mobile phone, a tablet computer, a laptop computer, a palm computer, a vehicle-mounted electronic device, a Mobile Internet Device (MID), an augmented reality (AR) / virtual reality (VR) device, a robot, a wearable device, an ultra-mobile personal computer (UMPC), a netbook, or a personal digital assistant (PDA), etc., and may also be a server, a Network Attached Storage (NAS), a personal computer (PC), a television (TV), a teller machine, or a self-service machine, etc. The embodiments of the present application do not make specific limitations.

[0163] The image processing apparatus in the embodiments of the present application may be a device with an operating system. The operating system may be an Android operating system, an iOS operating system, or other possible operating systems. The embodiments of the present application do not make specific limitations.

[0164] The image processing apparatus provided in the embodiments of the present application can implement each process implemented by the embodiments of the image processing method and achieve the same technical effect. To avoid repetition, it will not be elaborated here.

[0165] Optionally, asFigure 8 As shown in the figure, an embodiment of the present application further provides an electronic device 800, including a processor 801 and a memory 802. A program or instruction that can run on the processor 801 is stored on the memory 802. When the program or instruction is executed by the processor 801, each step of the above-mentioned embodiment of the image processing method is implemented, and the same technical effect can be achieved. To avoid repetition, it will not be elaborated here.

[0166] It should be noted that the electronic device in the embodiment of the present application includes the above-mentioned mobile electronic device and non-mobile electronic device.

[0167] Figure 9 It is a schematic diagram of the hardware structure of an electronic device according to an embodiment of the present application.

[0168] The electronic device 100 includes but is not limited to: a radio frequency unit 101, a network module 102, an audio output unit 103, an input unit 104, a sensor 105, a display unit 106, a user input unit 107, an interface unit 108, a memory 109, and a processor 110, etc.

[0169] Those skilled in the art can understand that the electronic device 100 may further include a power supply (such as a battery) for supplying power to each component. The power supply can be logically connected to the processor 110 through a power management system, so as to realize functions such as management of charging, discharging, and power consumption management through the power management system. Figure 9 The structure of the electronic device shown in the figure does not constitute a limitation on the electronic device. The electronic device may include more or fewer components than shown in the figure, or combine certain components, or have different component arrangements, which will not be elaborated here.

[0170] Among them, the above-mentioned processor 110 is used to determine a first pixel value based on the pixel values of the pixel points in the non-rectangular image; the above-mentioned processor 110 is further used to perform pixel filling on the area to be filled in the Gaussian blur area corresponding to the non-rectangular image based on the above-mentioned first pixel value to obtain a pixel matrix; the above-mentioned processor 110 is further used to perform Gaussian blur processing on the above-mentioned pixel matrix to generate a Gaussian blur image; wherein, the Gaussian blur area is the circumscribed rectangle of the non-rectangular image, and the area to be filled is the area in the circumscribed rectangle except the non-rectangular image.

[0171] Optionally, in some embodiments of the present application, the above-mentioned processor 110 is further used to determine a target area from the non-rectangular image based on the image parameters of the non-rectangular image before performing pixel filling on the area to be filled in the Gaussian blur area corresponding to the non-rectangular image based on the first pixel value; the above-mentioned processor 110 is further used to calculate the average pixel value of the target area according to the pixel values of each pixel point in the above-mentioned target area; the above-mentioned processor 110 is further used to determine the average pixel value as the first pixel value.

[0172] Optionally, in some embodiments of the present application, the non-rectangular image is a circular image, and the image parameters include the position information of four target endpoints in the circular image. The four target endpoints include two endpoints of the horizontal diameter of the circular image and two endpoints of the vertical diameter of the circular image. The processor 110 is specifically configured to sequentially connect adjacent endpoints among the four target endpoints to obtain four second regions, and determine the four second regions as target regions. A second region is a region enclosed by a line segment formed by connecting any two adjacent endpoints and the inferior arc corresponding to the adjacent endpoints in the circular image.

[0173] Optionally, in some embodiments of the present application, the non-rectangular image is a square image with four rounded corners, and the image parameters include the angular radian of the rounded corners of the square image.

[0174] The processor 110 is specifically configured to:

[0175] According to the angular radian of each rounded corner, respectively determine the inscribed circle corresponding to each rounded corner.

[0176] For each rounded corner, connect the rounded corner with the two tangent points of the inscribed circle corresponding to the rounded corner in the square image to obtain a third region, and determine the third region corresponding to each rounded corner as a target region. A third region is a region enclosed by a line segment formed by connecting a rounded corner with the two tangent points of the inscribed circle corresponding to the rounded corner in the square image and the rounded corner.

[0177] Optionally, in some embodiments of the present application, the processor 110 is specifically configured to perform Gaussian blur processing on the pixel matrix based on a preset Gaussian blur radius to obtain a processed pixel matrix, and generate a Gaussian blur image based on the processed pixel matrix. Wherein, the value of the preset Gaussian blur radius is related to the degree of blur of the expected generated Gaussian blur image.

[0178] In the electronic device provided in the embodiment of the present application, a first pixel value is determined based on the pixel values of the pixel points in the non-rectangular image; based on the first pixel value, pixel filling is performed on the area to be filled in the Gaussian blur area corresponding to the non-rectangular image to obtain a pixel matrix; the pixel matrix is subjected to Gaussian blur processing to generate a Gaussian blur image; wherein, the Gaussian blur area is the circumscribed rectangle of the non-rectangular image, and the area to be filled is the area in the circumscribed rectangle except the non-rectangular image. In this solution, since the first pixel value is determined according to the pixel values of the pixel points in the non-rectangular image, therefore, using the first pixel value to perform pixel filling on the area to be filled can make the imaging effect of the area to be filled similar to that of the non-rectangular image, so that when performing Gaussian blur processing on the pixel matrix obtained after filling, the phenomenon of blackening or darkening caused by too large a difference in pixel values between the area to be filled and the non-rectangular image can be avoided, thereby improving the Gaussian blur effect of the electronic device on the non-rectangular image.

[0179] It should be understood that in the embodiment of the present application, the input unit 104 may include a Graphics Processing Unit (GPU) 1041 and a microphone 1042. The graphics processor 1041 processes the image data of the static pictures or videos obtained by the image capture device (such as a camera) in the video capture mode or the image capture mode. The display unit 106 may include a display panel 1061, and the display panel 1061 may be configured in the form of a liquid crystal display, an organic light emitting diode, etc. The user input unit 107 includes at least one of a touch panel 1071 and other input devices 1072. The touch panel 1071 is also called a touch screen. The touch panel 1071 may include two parts, a touch detection device and a touch controller. The other input devices 1072 may include, but are not limited to, a physical keyboard, function keys (such as volume control keys, power on / off keys, etc.), a trackball, a mouse, and a joystick, which will not be elaborated here.

[0180] The memory 109 can be used to store software programs and various data. The memory 109 may mainly include a first storage area for storing programs or instructions and a second storage area for storing data. Among them, the first storage area can store an operating system, application programs or instructions required for at least one function (such as a sound playback function, an image playback function, etc.). In addition, the memory 109 can include volatile memory or non-volatile memory, or the memory 109 can include both volatile and non-volatile memory. Among them, the non-volatile memory can be a Read-Only Memory (ROM), a Programmable ROM (PROM), an Erasable PROM (EPROM), an Electrically Erasable PROM (EEPROM), or a flash memory. The volatile memory can be a Random Access Memory (RAM), a Static RAM (SRAM), a Dynamic RAM (DRAM), a Synchronous DRAM (SDRAM), a Double Data Rate SDRAM (DDR SDRAM), an Enhanced SDRAM (ESDRAM), a Synch link DRAM (SLDRAM), and a Direct Rambus RAM (DRRAM). The memory 109 in the embodiments of the present application includes but is not limited to these and any other suitable types of memory.

[0181] The processor 110 may include one or more processing units; optionally, the processor 110 integrates an application processor and a modem processor. Among them, the application processor mainly processes operations related to the operating system, user interface, and application programs, etc., and the modem processor mainly processes wireless communication signals, such as a baseband processor. It can be understood that the above modem processor may not be integrated into the processor 110 either.

[0182] The embodiments of the present application also provide a readable storage medium, on which a program or instruction is stored. When the program or instruction is executed by a processor, it implements each process of the above embodiment of the image processing method and can achieve the same technical effect. To avoid repetition, it will not be elaborated here.

[0183] Among them, the processor is the processor in the electronic device described in the above embodiments. The readable storage medium includes computer-readable storage media such as computer read-only memory ROM, random access memory RAM, magnetic disks, or optical discs, etc.

[0184] Another embodiment of the present application provides a chip, which includes a processor and a communication interface. The communication interface is coupled to the processor. The processor is used to run programs or instructions to implement each process of the above embodiment of the image processing method and can achieve the same technical effects. To avoid repetition, it will not be elaborated here.

[0185] It should be understood that the chip mentioned in the embodiments of the present application may also be referred to as a system-on-chip, system chip, chip system, or system-on-chip, etc.

[0186] The embodiments of the present application provide a computer program product. The program product is stored in a storage medium and is executed by at least one processor to implement each process of the above embodiment of the image processing method and can achieve the same technical effects. To avoid repetition, it will not be elaborated here.

[0187] It should be noted that in this article, the term "including", "comprising", or any other variant thereof is intended to cover non-exclusive inclusion, so that a process, method, article, or device including a series of elements not only includes those elements but also includes other elements not explicitly listed, or further includes elements inherent to such process, method, article, or device. Without more limitations, the element defined by the statement "including one..." does not exclude the existence of additional identical elements in the process, method, article, or device including that element. In addition, it should be pointed out that the scope of the methods and devices in the embodiments of the present application is not limited to performing functions in the order shown or discussed. It may also include performing functions in a substantially simultaneous manner or in the reverse order according to the functions involved. For example, the described method may be executed in an order different from that described, and various steps may be added, omitted, or combined. Additionally, the features described with reference to certain examples may be combined in other examples.

[0188] Through the description of the above embodiments, those skilled in the art can clearly understand that the methods of the above embodiments can be implemented by means of software plus a necessary general hardware platform. Of course, they can also be implemented by hardware, but in many cases the former is a better implementation method. Based on such an understanding, the technical solution of the present application, in essence or the part that contributes to the prior art, can be embodied in the form of a computer software product. The computer software product is stored in a storage medium (such as ROM / RAM, magnetic disk, optical disk), and includes several instructions for causing a terminal (which can be a mobile phone, computer, server, or network device, etc.) to execute the methods described in various embodiments of the present application.

[0189] The embodiments of the present application have been described above in conjunction with the accompanying drawings. However, the present application is not limited to the above specific embodiments. The above specific embodiments are merely illustrative and not restrictive. Under the inspiration of the present application, those of ordinary skill in the art can also make many forms without departing from the purpose of the present application and the scope protected by the claims, and all of them belong to the protection scope of the present application.

Claims

1. An image processing method, characterized in that: The method comprises: Determining a first pixel value based on pixel values ​​of pixels in the non-rectangular image; Based on the first pixel value, performing pixel filling on the area to be filled in the Gaussian blur area corresponding to the non-rectangular image to obtain a pixel matrix; Performing Gaussian blur processing on the pixel matrix to generate a Gaussian blurred image; The Gaussian blur area is a circumscribed rectangle of the non-rectangular image, and the area to be filled is an area in the circumscribed rectangle excluding the non-rectangular image.

2. The method according to claim 1, characterized in that Before performing pixel filling on the area to be filled in the Gaussian blur area corresponding to the non-rectangular image based on the first pixel value, the method further includes: determining a target area from the non-rectangular image based on image parameters of the non-rectangular image; Calculating an average pixel value of the target area according to the pixel value of each pixel point in the target area; The average pixel value is determined as the first pixel value.

3. The method according to claim 2, characterized in that The non-rectangular image is a circular image, and the image parameters include position information of four target endpoints in the circular image, and the four target endpoints include two endpoints of a horizontal diameter of the circular image and two endpoints of a vertical diameter of the circular image; The determining the target area from the non-rectangular image based on the image parameters of the non-rectangular image comprises: Connecting adjacent endpoints of the four target endpoints in sequence to obtain four second areas, and determining the four second areas as the target areas; A second area is an area enclosed by a line segment formed by connecting any of the adjacent endpoints and a minor arc corresponding to the adjacent endpoints in the circular image.

4. The method according to claim 2, characterized in that: The non-rectangular image is a square image with four arc corners, the image parameters include the radians of the arc corners of the square image, and determining the target area from the non-rectangular image based on the image parameters of the non-rectangular image includes: Determine the inscribed circle corresponding to each arc angle according to the angular radian of each arc angle; For each arc angle, connect the two tangent points of the arc angle and the inscribed circle corresponding to the arc angle in the square image to obtain a third area, and determine the third area corresponding to each arc angle as the target area; a third area is the area enclosed by a line segment formed by connecting an arc angle and the two tangent points of the inscribed circle corresponding to the arc angle in the square image, and the area enclosed by the arc angle.

5. The method according to claim 1, characterized in that: The performing Gaussian blur processing on the pixel matrix to generate a Gaussian blurred image includes: Based on a preset Gaussian blur radius, performing Gaussian blur processing on the pixel matrix to obtain the processed pixel matrix, and generating the Gaussian blurred image based on the processed pixel matrix; The value of the preset Gaussian blur radius is related to the blur degree of the Gaussian blurred image to be generated.

6. An image processing device, characterized in that: The image processing device comprises: a processing module, a filling module and a generating module; The processing module is used to determine a first pixel value based on the pixel value of the pixel point in the non-rectangular image; The filling module is used to perform pixel filling on the area to be filled in the Gaussian blur area corresponding to the non-rectangular image based on the first pixel value determined by the processing module to obtain a pixel matrix; The generating module is used to perform Gaussian blur processing on the pixel matrix filled by the filling module to generate a Gaussian blurred image; The Gaussian blur area is a circumscribed rectangle of the non-rectangular image, and the area to be filled is an area in the circumscribed rectangle excluding the non-rectangular image.

7. The device according to claim 6, characterized in that The device further comprises: a calculation module; The processing module is further configured to determine a target area from the non-rectangular image based on image parameters of the non-rectangular image before the filling module performs pixel filling on the area to be filled in the Gaussian blur area corresponding to the non-rectangular image based on the first pixel value; The calculation module is used to calculate the average pixel value of the target area according to the pixel value of each pixel point in the target area determined by the processing module; The processing module is further configured to determine the average pixel value as the first pixel value.

8. The device according to claim 7, characterized in that The non-rectangular image is a circular image, and the image parameters include position information of four target endpoints in the circular image, and the four target endpoints include two endpoints of a horizontal diameter of the circular image and two endpoints of a vertical diameter of the circular image; The processing module is specifically configured to sequentially connect adjacent endpoints of the four target endpoints to obtain four second areas, and determine the four second areas as the target area; A second area is an area enclosed by a line segment formed by connecting any of the adjacent endpoints and a minor arc corresponding to the adjacent endpoint in the circular image.

9. The device according to claim 7, characterized in that The non-rectangular image is a square image with four arc corners, and the image parameters include the radians of the arc corners of the square image; The processing module is specifically used for: Determine the inscribed circle corresponding to each arc angle according to the angular radian of each arc angle; For each arc angle, connect the arc angle and two tangent points of the inscribed circle corresponding to the arc angle in the square image to obtain a third area, and determine the third area corresponding to each arc angle as the target area; A third area is an area enclosed by a line segment formed by connecting an arc angle and two tangent points of an inscribed circle corresponding to the arc angle in the square image, and the arc angle.

10. The device according to claim 6, characterized in that The generating module is specifically configured to perform Gaussian blur processing on the pixel matrix based on a preset Gaussian blur radius to obtain the processed pixel matrix, and generate the Gaussian blurred image based on the processed pixel matrix; The value of the preset Gaussian blur radius is related to the blur degree of the Gaussian blurred image to be generated.