A method, device, equipment and storage medium for determining jagged points on image edges

By determining the edge direction and target direction of edge pixel points in image processing and accurately identifying edge sawtooth points, the problem of excessive edge blur in the prior art is solved and the image quality is improved.

CN112308868BActive Publication Date: 2024-11-12TENCENT TECHNOLOGY (SHENZHEN) CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN201910683536.0
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2019-07-26
Publication Date
2024-11-12
Estimated Expiration
2039-08-27

AI Technical Summary

Technical Problem

The existing anti-aliasing algorithms perform indiscriminate softening of image edges, resulting in blurring of edges without sawtooth, resulting in excessive blurring of the image and the inability to accurately determine the edge sawtooth points.

Method used

By determining the edge pixel points of the target object in the target image, determining the edge direction based on the brightness value of the adjacent pixel points, further determining the target direction based on the direction of the edge direction away from the target object, and finding the pixel points with large brightness changes in this direction As edge jagged point.

Benefits of technology

Accurate identification of edge serrated points is achieved, excessive blurring of non-serrated edges is avoided, and image quality is improved.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN112308868B_ABST
    Figure CN112308868B_ABST
Patent Text Reader

Abstract

The present application discloses a method, device, equipment and storage medium for determining edge jagged points of an image, the method comprising: determining edge pixel points of a target object in a target image; determining the edge direction of the edge pixel point based on the brightness values ​​of a plurality of pixel points surrounding the edge pixel point and adjacent to the edge pixel point; determining the target direction of the edge pixel point based on the edge direction of the edge pixel point, the target direction being the direction away from the target object in the edge direction; determining the edge jagged points based on the brightness values ​​of the pixel points within a preset range in the target direction of the edge pixel point and the edge pixel points. By adopting the technical solution of the present application, the edge pixel points corresponding to the target direction with a large change in the brightness of the pixel points within the preset range are determined as edge jagged points, so that the edge jagged points among the edge pixel points can be accurately determined.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of image processing technology, and in particular to a method, device, equipment and storage medium for determining jagged points on an image edge. Background Art

[0002] With the continuous development of computer technology and image processing technology, users can easily use electronic devices to view various image information, and high-quality images can often bring users a good visual experience. If jagged objects appear in the image, it will affect the user's visual experience.

[0003] The existing anti-aliasing algorithm uses a post-processing method to perform anti-aliasing optimization on the edge of the image. However, this method performs indiscriminate softening (blurring) on ​​all edges of the image, and performs bidirectional iterative calculations on edge pixels for dozens of times, resulting in multiple blurring of all pixels in an edge area; edges without aliasing (vertical lines, horizontal lines, etc.) are also blurred, resulting in excessive blurring of the image.

[0004] Therefore, it is necessary to provide a method, device, equipment and storage medium for determining edge jagged points of an image, so as to accurately determine the edge jagged points in edge pixels. Summary of the invention

[0005] The present application provides a method, device, equipment and storage medium for determining edge jagged points of an image, which can accurately determine edge jagged points in edge pixel points.

[0006] In one aspect, the present application provides a method for determining image edge jagged points, the method comprising:

[0007] Determine edge pixel points of a target object in a target image;

[0008] Determine the edge direction of the edge pixel point based on the brightness values ​​of a plurality of pixel points surrounding the edge pixel point and adjacent to the edge pixel point;

[0009] Determining a target direction of the edge pixel point based on the edge direction of the edge pixel point, wherein the target direction is a direction in the edge direction away from the target object;

[0010] The edge jagged points are determined based on the pixel points within a preset range in the target direction of the edge pixel points and the brightness values ​​of the edge pixel points.

[0011] On the other hand, a device for determining jagged points on an image edge is provided, the device comprising:

[0012] An edge pixel point determination module is used to determine the edge pixel points of the target object in the target image;

[0013] An edge direction determination module, used to determine the edge direction of the edge pixel point based on the brightness values ​​of a plurality of pixel points surrounding the edge pixel point and adjacent to the edge pixel point;

[0014] A target direction determination module, used to determine a target direction of the edge pixel point based on the edge direction of the edge pixel point, wherein the target direction is a direction in the edge direction away from the target object;

[0015] The edge jagged point determination module is used to determine the edge jagged point based on the pixel points within a preset range in the target direction of the edge pixel point and the brightness value of the edge pixel point.

[0016] On the other hand, a device for determining image edge jagged points is provided, the device comprising a processor and a memory, the memory storing at least one instruction, at least one program, a code set or an instruction set, the at least one instruction, the at least one program, the code set or the instruction set being loaded and executed by the processor to implement the image edge jagged point determination method as described above.

[0017] On the other hand, a computer-readable storage medium is provided, in which at least one instruction, at least one program, a code set or an instruction set is stored, and the at least one instruction, the at least one program, the code set or the instruction set is loaded and executed by a processor to implement the image edge jagged point determination method as described above.

[0018] The image edge jagged point determination method, device, equipment and storage medium provided by the present application have the following technical effects:

[0019] The present application determines the brightness values ​​of multiple adjacent pixel points of the edge pixel point based on the edge pixel point of the target object in the target image, and accurately determines the edge direction of the edge pixel point based on the brightness values ​​of the adjacent pixel points; then determines the direction of the edge direction away from the target object as the target direction, and then based on the brightness values ​​of the pixel points within a preset range in the target direction and the edge pixel points, determines the edge pixel points corresponding to the target direction with a larger brightness change of the pixel points within the preset range as edge jagged points, so that the edge jagged points among the edge pixel points can be accurately determined. BRIEF DESCRIPTION OF THE DRAWINGS

[0020] In order to more clearly illustrate the technical solutions and advantages in the embodiments of the present application or the prior art, the drawings required for use in the embodiments or the prior art descriptions are briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work.

[0021] Figure 1 is a schematic diagram of a system for determining jagged points on an image edge provided by an embodiment of the present application;

[0022] Figure 2 It is a flowchart of a method for determining jagged points on an image edge provided by an embodiment of the present application;

[0023] Figure 3 It is a flowchart of a method for determining edge pixel points of a target object in a target image provided by an embodiment of the present application;

[0024] Figure 4 It is a flowchart of a method for determining the edge direction of an edge pixel point provided by an embodiment of the present application;

[0025] Figure 5 is a flow chart of a method for determining a target direction of an edge pixel point provided in an embodiment of the present application;

[0026] Figure 6 is a flow chart of a method for determining edge sawtooth points provided in an embodiment of the present application;

[0027] Figure 7 is a schematic diagram of the structure of multiple pixel points of a target object provided in an embodiment of the present application;

[0028] Figure 8 is a schematic diagram of the structure of multiple edge pixels of a target object provided in an embodiment of the present application;

[0029] Fig. 9 is a schematic diagram of the structure of four pixels surrounding an edge pixel point and adjacent to the edge pixel point provided in an embodiment of the present application;

[0030] Fig.10 is a schematic diagram of the edge direction of edge pixels provided in an embodiment of the present application;

[0031] Fig.11 is a schematic diagram of the target direction of edge pixels provided in an embodiment of the present application;

[0032] Fig.12 is a schematic diagram of the structure of the edge sawtooth point provided in an embodiment of the present application;

[0033] Fig.13It is a structural schematic diagram of a device for determining jagged points on an image edge provided in an embodiment of the present application;

[0034] Fig.14 It is a structural diagram of a server provided in an embodiment of the present application. DETAILED DESCRIPTION

[0035] The following will be combined with the drawings in the embodiments of the present application to clearly and completely describe the technical solutions in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without making creative work are within the scope of protection of this application.

[0036] It should be noted that the terms "first", "second", etc. in the specification and claims of the present application and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchangeable where appropriate, so that the embodiments of the present application described herein can be implemented in an order other than those illustrated or described herein. In addition, the terms "including" and "having" and any of their variations are intended to cover non-exclusive inclusions, for example, a process, method, system, product or server that includes a series of steps or units is not necessarily limited to those steps or units clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.

[0037] See also Figure 1 , Figure 1 is a schematic diagram of a system for determining image edge jagged points provided by an embodiment of the present application, such as Figure 1 As shown, the image edge jagged point determination system may include at least a server 01 and a client 02 .

[0038] Specifically, in the embodiments of this specification, the server 01 may include an independently operated server, a distributed server, or a server cluster composed of multiple servers. The server 01 may include a network communication unit, a processor, a memory, etc. Specifically, the server 01 may be used to determine the edge jagged points of the image and soften the edge jagged points.

[0039] Specifically, in the embodiments of this specification, the client 02 may include physical devices such as smart phones, desktop computers, tablet computers, laptops, digital assistants, smart wearable devices, etc., and may also include software running in physical devices, such as web pages provided by some service providers to users, or applications provided by these service providers to users. Specifically, the client 02 may be used to send an image edge jagged point softening processing request to the server 01.

[0040] The following describes a method for determining jagged points on an image edge in the present application. Figure 2 It is a flowchart of a method for determining jagged points on image edges provided in an embodiment of the present application. This specification provides method operation steps as described in the embodiment or flowchart, but may include more or fewer operation steps based on conventional or non-creative labor. The order of steps listed in the embodiment is only one way of executing the steps among many orders, and does not represent the only order of execution. When the actual system or server product is executed, it can be executed in sequence or in parallel (for example, in a parallel processor or multi-threaded processing environment) according to the method shown in the embodiment or the accompanying drawings. Specifically, Figure 2 As shown, the method may include:

[0041] S201: Determine edge pixel points of a target object in a target image.

[0042] In the embodiments of the present specification, the target image may be an image determined by a user, and the target image may include a real object and a background; the real object may be a person, an animal, a plant, daily necessities, etc., and the background may be the environment in which the real object is currently located, and the background is used to set off the real object; the target object may be a real object in the target image.

[0043] In the embodiments of this specification, the target object may be composed of multiple pixels; in a specific embodiment, Figure 7 As shown in the figure, the first shaded portion (1) is a plurality of pixel points of the target object, wherein each square in the shaded portion represents a pixel point; the edge pixel points of the target object may be pixel points corresponding to the edge contour of the target object, and the target object may have a plurality of edge pixel points. In a specific embodiment, Figure 8 As shown, the second shaded portion (2) in the figure is a plurality of edge pixel points of the target object, wherein all squares represent pixel points, and each square in the shaded portion represents an edge pixel point.

[0044] In the embodiments of this specification, Figure 3 As shown, determining edge pixel points of a target object in a target image may include:

[0045] S2011: Determine a plurality of pixel points of a target object in a target image;

[0046] S2013: Determine a plurality of adjacent pixel points surrounding each pixel point;

[0047] S2015: sorting the brightness values ​​of each pixel and the multiple adjacent pixels around each pixel from high to low based on the brightness values ​​of each pixel and the multiple adjacent pixels around each pixel;

[0048] S2017: Calculate the brightness difference between the first pixel and the last pixel in the sorting order;

[0049] S2019: When the brightness difference is greater than a preset brightness threshold, the pixel point corresponding to the brightness difference is determined as an edge pixel point.

[0050] In the embodiments of this specification, the preset brightness threshold can be set according to actual conditions.

[0051] In the embodiments of the present specification, edge pixels can be accurately determined by the brightness values ​​of adjacent pixels around the pixel of the target object, thereby facilitating the subsequent determination of edge jagged points.

[0052] S203: Determine the edge direction of the edge pixel point based on the brightness values ​​of a plurality of pixel points surrounding the edge pixel point and adjacent to the edge pixel point.

[0053] In the embodiment of the present specification, the edge direction of the edge pixel point is a direction with a larger brightness change among multiple directions centered on the edge pixel point.

[0054] In the embodiments of this specification, Figure 4 As shown, determining the edge direction of the edge pixel point based on the brightness values ​​of a plurality of pixel points around the edge pixel point and adjacent to the edge pixel point may include:

[0055] S2031: Determine four pixel points around the edge pixel point and adjacent to the edge pixel point;

[0056] In a specific embodiment, Fig. 9 As shown, the edge pixel p is surrounded by four adjacent pixel points A, B, C, and D; wherein each square represents a pixel point.

[0057] S2033: Determine, based on the edge pixel point and the four pixel points, a first straight line and a second straight line whose intersection points are the edge pixel points;

[0058] In a specific embodiment, Fig. 9As shown, the first straight line of the edge pixel point p is the straight line where the pixel points A and B are located, and the second straight line is the straight line where the pixel points C and D are located;

[0059] S2035: Determine, based on the four pixels, an absolute value of a brightness difference between two pixels on the first straight line and an absolute value of a brightness difference between two pixels on the second straight line;

[0060] S2037: Determine the edge direction of the edge pixel point based on the absolute value of the brightness difference between two pixel points on the first straight line and the absolute value of the brightness difference between two pixel points on the second straight line.

[0061] Specifically, in some embodiments, determining the edge direction of the edge pixel point based on the absolute value of the brightness difference between two pixels on the first straight line and the absolute value of the brightness difference between two pixels on the second straight line may include:

[0062] Compare the absolute value of the brightness difference between two pixels on the first straight line with the absolute value of the brightness difference between two pixels on the second straight line;

[0063] The direction of the straight line corresponding to the larger absolute value of the brightness difference is determined as the edge direction.

[0064] In a specific embodiment, Fig. 9 As shown, let the brightness be luma, then the absolute value of the brightness difference between A and B is |lumaA-lumaB|, and the absolute value of the brightness difference between C and D is |lumaC-lumaD|.

[0065] In a specific embodiment, Fig.10 As shown, since |lumaA-lumaB|>|lumaC-lumaD|, the direction of the first straight line where the pixels A and B are located is determined as the edge direction of the edge pixel point.

[0066] In the embodiment of the present specification, the edge direction is accurately determined by the brightness of the pixels adjacent to the edge pixel.

[0067] S205: Determine a target direction of the edge pixel point based on the edge direction of the edge pixel point, where the target direction is a direction in the edge direction away from the target object.

[0068] In an embodiment of the present specification, the target direction may be the external direction of the edge pixel point, and the position of the pixel point in the image corresponds to the inside of the image; the target direction may be one of the edge directions, for example, if the edge direction is the east-west direction, the target direction may be the east direction.

[0069] In the embodiments of this specification, Figure 5 As shown, determining the target direction of the edge pixel point based on the edge direction of the edge pixel point may include:

[0070] S2051: Determine a first edge direction and a second edge direction based on the edge direction of the edge pixel point, where the first edge direction and the second edge direction are opposite directions to each other;

[0071] In an embodiment of the present specification, the first edge direction and the second edge direction are divided by the edge pixel point; for example, the edge direction may be a straight line, and the first edge direction and the second edge direction may be rays with the edge pixel point as a common starting point.

[0072] S2053: Obtaining an absolute value of a brightness difference in the first edge direction based on a brightness value of the edge pixel and brightness values ​​of pixels adjacent to the edge pixel in the first edge direction;

[0073] S2055: Obtaining an absolute value of a brightness difference in a second edge direction based on a brightness value of the edge pixel and brightness values ​​of pixels adjacent to the edge pixel in the second edge direction;

[0074] S2057: Determine the target direction of the edge pixel point based on the absolute value of the brightness difference between the first edge direction and the second edge direction.

[0075] Specifically, in some embodiments, determining the target direction of the edge pixel point based on the absolute value of the brightness difference between the first edge direction and the second edge direction may include:

[0076] Comparing the absolute value of the brightness difference in the first edge direction with the absolute value of the brightness difference in the second edge direction;

[0077] The edge direction corresponding to the larger absolute value of the brightness difference is determined as the target direction of the edge pixel point.

[0078] In a specific embodiment, Fig.11 As shown, since |lumaA-lumaP|>|lumaB-lumaP|, the direction of the edge pixel point P toward the pixel point A is determined as the target direction of the edge pixel point.

[0079] S207: Determine edge jagged points based on pixel points within a preset range in the target direction of the edge pixel point and brightness values ​​of the edge pixel point.

[0080] In the embodiments of this specification, the method may further include:

[0081] Obtain N target pixel points within a preset range in the target direction, where N ≥ 1 and N is an integer;

[0082] Accordingly, determining the edge jagged points based on the pixel points within a preset range in the target direction of the edge pixel points and the brightness values ​​of the edge pixel points may include:

[0083] S2071: Calculate the absolute value of the brightness difference between the edge pixel and the first target pixel to obtain a first absolute value of the brightness difference; the first target pixel is a target pixel adjacent to the edge pixel within a preset range in the target direction;

[0084] S2073: When the ratio of the absolute value of the first brightness difference to the brightness of the edge pixel point is greater than a preset value, determine the edge pixel point as the edge jagged point.

[0085] In the embodiment of the present specification, by acquiring N target pixel points within a preset range in the target direction and determining the edge jagged points by brightness changes of the multiple target pixel points, the accuracy of the edge jagged points is further improved.

[0086] Specifically, in some embodiments, when N ≥ 2, such as Figure 6 As shown, when the ratio of the absolute value of the first brightness difference to the brightness of the edge pixel point is greater than a preset value, determining the edge pixel point as the edge sawtooth point includes:

[0087] S20731: When the ratio of the first brightness difference absolute value to the brightness of the edge pixel is greater than a preset value, calculating the brightness difference absolute value between the M-1th target pixel and the Mth target pixel to obtain the Mth brightness difference absolute value, where M=2, ..., N, and M is an integer;

[0088] S20733: When the ratio of the absolute value of the Mth brightness difference to the brightness of the M-1th target pixel point is greater than the preset value, the edge pixel point is determined as the edge jagged point.

[0089] Specifically, in some embodiments, when N=4, when the ratio of the absolute value of the first brightness difference to the brightness of the edge pixel is greater than a preset value, determining the edge pixel as the edge jagged point includes:

[0090] When the ratio of the first brightness difference absolute value to the brightness of the edge pixel is greater than a preset value, the brightness difference absolute value of the first target pixel and the second target pixel is calculated to obtain a second brightness difference absolute value;

[0091] When the ratio of the second brightness difference absolute value to the brightness of the first target pixel is greater than the preset value, the brightness difference absolute value between the second target pixel and the third target pixel is calculated to obtain a third brightness difference absolute value;

[0092] When the ratio of the third brightness difference absolute value to the brightness of the second target pixel is greater than the preset value, the brightness difference absolute value between the third target pixel and the fourth target pixel is calculated to obtain a fourth brightness difference absolute value;

[0093] When the ratio of the absolute value of the fourth brightness difference to the brightness of the third target pixel point is greater than the preset value, the edge pixel point is determined as the edge jagged point.

[0094] In a specific embodiment, the preset value can be set to one quarter. The preset value can also be set according to actual conditions, such as Fig.12 As shown, the shaded parts (3) in the figure are all determined edge sawtooth points.

[0095] In the embodiments of this specification, the image edge jagged point determination method of the present application is highly adaptable to mobile devices that are susceptible to hardware constraints. Applying the method of the present application in an image rendering engine can achieve better image rendering capabilities and produce higher quality games. In addition, the image edge jagged point determination method of the present application can also be applied to the anti-aliasing optimization of products such as P-picture pendants and mini-games. Using the technical solution of the present application, edge jagged points are determined in edge pixel points, and subsequently only the edge jagged points can be anti-aliasing optimized, thereby avoiding anti-aliasing optimization of all edge pixel points, which facilitates subsequent anti-aliasing calculations and reduces a part of the amount of calculation, such as reducing the optimization calculation of non-jaggies.

[0096] It can be seen from the technical solutions provided by the above embodiments of this specification that the embodiments of this specification determine the brightness values ​​of multiple adjacent pixel points of the edge pixel points based on the edge pixel points of the target object in the target image, and accurately determine the edge direction of the edge pixel points based on the brightness values ​​of the adjacent pixel points; then the direction in the edge direction away from the target object is determined as the target direction, and then based on the brightness values ​​of the pixels within a preset range in the target direction and the edge pixel points, the edge pixel points corresponding to the target direction with a larger change in pixel brightness within the preset range are determined as edge jagged points, thereby accurately determining the edge jagged points in the edge pixel points.

[0097] The present application also provides a device for determining image edge jagged points. Fig.13 As shown, the device may include:

[0098] The edge pixel point determination module 1310 is used to determine the edge pixel points of the target object in the target image;

[0099] An edge direction determination module 1320, configured to determine an edge direction of the edge pixel point based on brightness values ​​of a plurality of pixel points surrounding the edge pixel point and adjacent to the edge pixel point;

[0100] A target direction determining module 1330 is used to determine a target direction of the edge pixel point based on the edge direction of the edge pixel point, wherein the target direction is a direction in the edge direction away from the target object;

[0101] The edge jagged point determination module 1340 is used to determine the edge jagged point based on the pixel points within a preset range in the target direction of the edge pixel point and the brightness value of the edge pixel point.

[0102] In some embodiments, the target direction determination module may include:

[0103] an edge direction determining unit, configured to determine a first edge direction and a second edge direction based on the edge direction of the edge pixel point, wherein the first edge direction and the second edge direction are opposite directions to each other;

[0104] A first determining unit, configured to obtain an absolute value of a brightness difference in a first edge direction based on a brightness value of the edge pixel and brightness values ​​of pixels adjacent to the edge pixel in the first edge direction;

[0105] A second determining unit, configured to obtain an absolute value of a brightness difference in a second edge direction based on a brightness value of the edge pixel and brightness values ​​of pixels adjacent to the edge pixel in the second edge direction;

[0106] A target direction determining unit is used to determine the target direction of the edge pixel point based on the absolute value of the brightness difference between the first edge direction and the second edge direction.

[0107] In some embodiments, the target direction determination unit may include:

[0108] A first comparison subunit, configured to compare an absolute value of a brightness difference in the first edge direction with an absolute value of a brightness difference in the second edge direction;

[0109] The target direction determination subunit is used to determine the edge direction corresponding to the larger absolute value of the brightness difference as the target direction of the edge pixel point.

[0110] In some embodiments, the edge direction determination module may include:

[0111] An adjacent pixel point determination unit, used to determine four pixel points surrounding the edge pixel point and adjacent to the edge pixel point;

[0112] A straight line determination unit, configured to determine, based on the edge pixel point and the four pixel points, a first straight line and a second straight line whose intersection points are the edge pixel points;

[0113] a brightness difference absolute value determining unit, configured to determine, based on the four pixels, an absolute value of a brightness difference between two pixels on the first straight line and an absolute value of a brightness difference between two pixels on the second straight line;

[0114] The edge direction determining unit is used to determine the edge direction of the edge pixel point based on the absolute value of the brightness difference between two pixel points on the first straight line and the absolute value of the brightness difference between two pixel points on the second straight line.

[0115] In some embodiments, the edge direction determining unit may include:

[0116] A second comparison subunit is used to compare the absolute value of the brightness difference between two pixels on the first straight line with the absolute value of the brightness difference between two pixels on the second straight line;

[0117] The edge direction determination subunit is used to determine the direction of the straight line corresponding to the larger absolute value of the brightness difference as the edge direction.

[0118] In some embodiments, the apparatus may further include:

[0119] The target pixel point acquisition module is used to acquire N target pixel points within a preset range in the target direction, where N≥1 and N is an integer.

[0120] Accordingly, the edge sawtooth point determination module may include:

[0121] A first brightness difference absolute value determining unit is used to calculate the brightness difference absolute value between the edge pixel point and the first target pixel point to obtain a first brightness difference absolute value; the first target pixel point is a target pixel point adjacent to the edge pixel point within a preset range in the target direction;

[0122] The edge jagged point determination unit is used to determine the edge pixel point as the edge jagged point when the ratio of the absolute value of the first brightness difference to the brightness of the edge pixel point is greater than a preset value.

[0123] In some embodiments, when N≥2, the edge sawtooth point determination unit may include:

[0124] an Mth brightness difference absolute value determining subunit, configured to calculate the brightness difference absolute value between the M-1th target pixel and the Mth target pixel when the ratio of the first brightness difference absolute value to the brightness of the edge pixel is greater than a preset value, to obtain the Mth brightness difference absolute value, wherein M=2, ..., N, and M is an integer;

[0125] The first edge jagged point determination subunit is used to determine the edge pixel point as the edge jagged point when the ratio of the absolute value of the Mth brightness difference value to the brightness of the M-1th target pixel point is greater than the preset value.

[0126] In some embodiments, when N=4, the edge sawtooth point determination unit may include:

[0127] a second brightness difference absolute value determining subunit, configured to calculate the brightness difference absolute value between the first target pixel and the second target pixel to obtain a second brightness difference absolute value when the ratio of the first brightness difference absolute value to the brightness of the edge pixel is greater than a preset value;

[0128] a third brightness difference absolute value determining subunit, configured to calculate the brightness difference absolute value between the second target pixel and the third target pixel when the ratio of the second brightness difference absolute value to the brightness of the first target pixel is greater than the preset value, to obtain a third brightness difference absolute value;

[0129] a fourth brightness difference absolute value determining subunit, configured to calculate the absolute value of the brightness difference between the third target pixel and the fourth target pixel when the ratio of the third brightness difference absolute value to the brightness of the second target pixel is greater than the preset value, to obtain a fourth brightness difference absolute value;

[0130] The second edge jagged point determination subunit is used to determine the edge pixel point as the edge jagged point when the ratio of the absolute value of the fourth brightness difference value to the brightness of the third target pixel point is greater than the preset value.

[0131] The device and method embodiments in the described device embodiments are based on the same inventive concept.

[0132] An embodiment of the present application provides a device for determining image edge jagged points, the device comprising a processor and a memory, the memory storing at least one instruction, at least one program, a code set or an instruction set, the at least one instruction, the at least one program, the code set or the instruction set being loaded and executed by the processor to implement a method for determining image edge jagged points as provided in the above method embodiment.

[0133] An embodiment of the present application also provides a storage medium, which can be set in a terminal to store at least one instruction, at least one program, code set or instruction set related to a method for determining image edge jagged points in a method embodiment. The at least one instruction, the at least one program, the code set or instruction set is loaded and executed by the processor to implement the method for determining image edge jagged points provided in the above method embodiment.

[0134] Optionally, in the embodiments of this specification, the storage medium may be located in at least one of the multiple network servers of the computer network. Optionally, in this embodiment, the storage medium may include, but is not limited to: a USB flash drive, a read-only memory (ROM), a random access memory (RAM), a mobile hard disk, a magnetic disk or an optical disk, and other media that can store program codes.

[0135] The memory described in the embodiments of this specification can be used to store software programs and modules, and the processor executes various functional applications and data processing by running the software programs and modules stored in the memory. The memory may mainly include a program storage area and a data storage area, wherein the program storage area may store an operating system, application programs required for functions, etc.; the data storage area may store data created according to the use of the device, etc. In addition, the memory may include a high-speed random access memory, and may also include a non-volatile memory, such as at least one disk storage device, a flash memory device, or other volatile solid-state storage device. Accordingly, the memory may also include a memory controller to provide the processor with access to the memory.

[0136] The method for determining the jagged points on the edge of an image provided in the present application can be executed in a mobile terminal, a computer terminal, a server or a similar computing device. For example, the method can be executed on a server. Fig.14 1 is a hardware structure block diagram of a server of a method for determining jagged points on an image edge provided by an embodiment of the present application. Fig.14As shown, the server 1400 may have relatively large differences due to different configurations or performances, and may include one or more central processing units (CPU) 1410 (the processor 1410 may include but is not limited to a processing device such as a microprocessor MCU or a programmable logic device FPGA), a memory 1430 for storing data, and one or more storage media 1420 (such as one or more mass storage devices) for storing application programs 1423 or data 1422. Among them, the memory 1430 and the storage medium 1420 can be short-term storage or permanent storage. The program stored in the storage medium 1420 may include one or more modules, each of which may include a series of instruction operations on the server. Furthermore, the central processing unit 1410 can be configured to communicate with the storage medium 1420 and execute a series of instruction operations in the storage medium 1420 on the server 1400. The server 1400 may also include one or more power supplies 1460, one or more wired or wireless network interfaces 1450, one or more input and output interfaces 1440, and / or one or more operating systems 1421, such as Windows ServerTM, Mac OS XTM, UnixTM, LinuxTM, FreeBSDTM, etc.

[0137] The input / output interface 1440 may be used to receive or send data via a network. The specific example of the network may include a wireless network provided by a communication provider of the server 1400. In one example, the input / output interface 1440 includes a network adapter (Network Interface Controller, NIC), which may be connected to other network devices via a base station so as to communicate with the Internet. In one example, the input / output interface 1440 may be a radio frequency (RF) module, which is used to communicate with the Internet wirelessly.

[0138] It can be understood by those skilled in the art that Fig.14 The structure shown is only for illustration and does not limit the structure of the above electronic device. Fig.14 More or fewer components as shown, or with Fig.14 Different configurations are shown.

[0139] It can be seen from the embodiments of the image edge jagged point determination method, device, server or storage medium provided by the present application that the present application determines the brightness values ​​of multiple adjacent pixel points of the edge pixel point based on the edge pixel point of the target object in the target image, and accurately determines the edge direction of the edge pixel point based on the brightness values ​​of the adjacent pixel points; then the direction in the edge direction away from the target object is determined as the target direction, and then based on the brightness values ​​of the pixels within a preset range in the target direction and the edge pixel points, the edge pixel points corresponding to the target direction with a larger pixel brightness change within the preset range are determined as edge jagged points, thereby accurately determining the edge jagged points among the edge pixel points.

[0140] It should be noted that the above-mentioned sequence of the embodiments of the present application is for description only and does not represent the advantages and disadvantages of the embodiments. The above-mentioned specific embodiments of this specification are described. Other embodiments are within the scope of the attached claims. In some cases, the actions or steps recorded in the claims can be performed in an order different from that in the embodiments and still achieve the desired results. In addition, the processes depicted in the drawings do not necessarily require the specific order or continuous order shown to achieve the desired results. In some embodiments, multitasking and parallel processing are also possible or may be advantageous.

[0141] Each embodiment in this specification is described in a progressive manner, and the same or similar parts between the embodiments can be referred to each other, and each embodiment focuses on the differences from other embodiments. In particular, for the device, equipment, and storage medium embodiments, since they are basically similar to the method embodiments, the description is relatively simple, and the relevant parts can be referred to the partial description of the method embodiment.

[0142] A person skilled in the art will understand that all or part of the steps to implement the above embodiments may be accomplished by hardware or by instructing related hardware through a program, and the program may be stored in a computer-readable storage medium, and the above-mentioned storage medium may be a read-only memory, a disk or an optical disk, etc.

[0143] The above description is only a preferred embodiment of the present application and is not intended to limit the present application. Any modifications, equivalent substitutions, improvements, etc. made within the spirit and principles of the present application should be included in the protection scope of the present application.

Claims

1. A method for determining jagged points on image edges, characterized in that: The method comprises: Determine edge pixel points of a target object in a target image; Determine the edge direction of the edge pixel point based on the brightness values ​​of a plurality of pixel points surrounding the edge pixel point and adjacent to the edge pixel point; Determining a target direction of the edge pixel point based on the edge direction of the edge pixel point, wherein the target direction is a direction in the edge direction away from the target object; Obtain N target pixel points within a preset range in the target direction, where N ≥ 1 and N is an integer; Calculating the absolute value of the brightness difference between the edge pixel point and the first target pixel point to obtain a first absolute value of the brightness difference; the first target pixel point is a target pixel point adjacent to the edge pixel point within a preset range in the target direction; When the ratio of the absolute value of the first brightness difference to the brightness of the edge pixel is greater than a preset value, the edge pixel is determined as an edge jagged point.

2. The method according to claim 1, characterized in that: The determining the target direction of the edge pixel point based on the edge direction of the edge pixel point comprises: Determine a first edge direction and a second edge direction based on the edge direction of the edge pixel point, wherein the first edge direction and the second edge direction are opposite directions to each other; Obtaining an absolute value of a brightness difference in the first edge direction based on a brightness value of the edge pixel and brightness values ​​of pixels adjacent to the edge pixel in the first edge direction; Obtaining an absolute value of a brightness difference in the second edge direction based on a brightness value of the edge pixel and brightness values ​​of pixels adjacent to the edge pixel in the second edge direction; The target direction of the edge pixel is determined based on the absolute value of the brightness difference between the first edge direction and the second edge direction.

3. The method according to claim 2, characterized in that The determining the target direction of the edge pixel point based on the absolute value of the brightness difference between the first edge direction and the second edge direction comprises: Comparing the absolute value of the brightness difference in the first edge direction with the absolute value of the brightness difference in the second edge direction; The edge direction corresponding to the larger absolute value of the brightness difference is determined as the target direction of the edge pixel point.

4. The method according to claim 1, characterized in that The step of determining the edge direction of the edge pixel point based on the brightness values ​​of a plurality of pixel points surrounding the edge pixel point and adjacent to the edge pixel point comprises: Determine four pixel points around the edge pixel point and adjacent to the edge pixel point; Based on the edge pixel point and the four pixel points, determining a first straight line and a second straight line whose intersection points are the edge pixel points; Based on the four pixels, determine an absolute value of a brightness difference between two pixels on the first straight line and an absolute value of a brightness difference between two pixels on the second straight line; The edge direction of the edge pixel point is determined based on the absolute value of the brightness difference between two pixel points on the first straight line and the absolute value of the brightness difference between two pixel points on the second straight line.

5. The method according to claim 4, characterized in that The determining the edge direction of the edge pixel point based on the absolute value of the brightness difference between two pixels on the first straight line and the absolute value of the brightness difference between two pixels on the second straight line comprises: Compare the absolute value of the brightness difference between two pixels on the first straight line with the absolute value of the brightness difference between two pixels on the second straight line; The direction of the straight line corresponding to the larger absolute value of the brightness difference is determined as the edge direction.

6. The method according to claim 1, characterized in that When N≥2, when the ratio of the absolute value of the first brightness difference to the brightness of the edge pixel is greater than a preset value, determining the edge pixel as the edge jagged point includes: When the ratio of the first brightness difference absolute value to the brightness of the edge pixel is greater than a preset value, the brightness difference absolute value between the M-1th target pixel and the Mth target pixel is calculated to obtain the Mth brightness difference absolute value, where M=2, ..., N, and M is an integer; When the ratio of the absolute value of the Mth brightness difference to the brightness of the M-1th target pixel point is greater than the preset value, the edge pixel point is determined as the edge jagged point.

7. The method according to claim 1, characterized in that When N=4, when the ratio of the absolute value of the first brightness difference to the brightness of the edge pixel is greater than a preset value, determining the edge pixel as the edge jagged point includes: When the ratio of the first brightness difference absolute value to the brightness of the edge pixel is greater than a preset value, the brightness difference absolute value between the first target pixel and the second target pixel is calculated to obtain a second brightness difference absolute value; When the ratio of the second brightness difference absolute value to the brightness of the first target pixel is greater than the preset value, the brightness difference absolute value between the second target pixel and the third target pixel is calculated to obtain a third brightness difference absolute value; When the ratio of the third brightness difference absolute value to the brightness of the second target pixel is greater than the preset value, the brightness difference absolute value between the third target pixel and the fourth target pixel is calculated to obtain a fourth brightness difference absolute value; When the ratio of the absolute value of the fourth brightness difference to the brightness of the third target pixel point is greater than the preset value, the edge pixel point is determined as the edge jagged point.

8. A device for determining jagged points on image edges, characterized in that: The device comprises: An edge pixel point determination module is used to determine the edge pixel points of the target object in the target image; An edge direction determination module, used to determine the edge direction of the edge pixel point based on the brightness values ​​of a plurality of pixel points surrounding the edge pixel point and adjacent to the edge pixel point; A target direction determination module, used to determine a target direction of the edge pixel point based on the edge direction of the edge pixel point, wherein the target direction is a direction in the edge direction away from the target object; An edge jagged point determination module is used to determine the edge jagged point based on the pixel points within a preset range in the target direction of the edge pixel point and the brightness value of the edge pixel point; A target pixel point acquisition module is used to acquire N target pixel points within a preset range in the target direction, where N≥1 and N is an integer; The edge sawtooth point determination module comprises: A first brightness difference absolute value determination unit is used to calculate the absolute value of the brightness difference between the edge pixel point and the first target pixel point to obtain the first brightness difference absolute value; the first target pixel point is a target pixel point adjacent to the edge pixel point within a preset range in the target direction; an edge jagged point determination unit is used to determine the edge pixel point as an edge jagged point when the ratio of the first brightness difference absolute value to the brightness of the edge pixel point is greater than a preset value.

9. The device according to claim 8, characterized in that The target direction determination module comprises: an edge direction determining unit, configured to determine a first edge direction and a second edge direction based on the edge direction of the edge pixel point, wherein the first edge direction and the second edge direction are opposite directions to each other; A first determining unit, configured to obtain an absolute value of a brightness difference in a first edge direction based on a brightness value of the edge pixel and brightness values ​​of pixels adjacent to the edge pixel in the first edge direction; A second determining unit, configured to obtain an absolute value of a brightness difference in a second edge direction based on a brightness value of the edge pixel and brightness values ​​of pixels adjacent to the edge pixel in the second edge direction; A target direction determining unit is used to determine the target direction of the edge pixel point based on the absolute value of the brightness difference between the first edge direction and the second edge direction.

10. The device according to claim 9, characterized in that The target direction determination unit comprises: A first comparison subunit, configured to compare an absolute value of a brightness difference in the first edge direction with an absolute value of a brightness difference in the second edge direction; The target direction determination subunit is used to determine the edge direction corresponding to the larger absolute value of the brightness difference as the target direction of the edge pixel point.

11. The device according to claim 8, characterized in that The edge direction determination module comprises: An adjacent pixel point determination unit, used to determine four pixel points surrounding the edge pixel point and adjacent to the edge pixel point; A straight line determination unit, configured to determine, based on the edge pixel point and the four pixel points, a first straight line and a second straight line whose intersection points are the edge pixel points; a brightness difference absolute value determining unit, configured to determine, based on the four pixels, an absolute value of a brightness difference between two pixels on the first straight line and an absolute value of a brightness difference between two pixels on the second straight line; The edge direction determining unit is used to determine the edge direction of the edge pixel point based on the absolute value of the brightness difference between two pixel points on the first straight line and the absolute value of the brightness difference between two pixel points on the second straight line.

12. The device according to claim 11, characterized in that The edge direction determining unit comprises: The second comparison subunit is used to compare the absolute value of the brightness difference between two pixels on the first straight line with the absolute value of the brightness difference between two pixels on the second straight line; the edge direction determination subunit is used to determine the direction of the straight line corresponding to the larger absolute value of the brightness difference as the edge direction.

13. The device according to claim 8, characterized in that When N≥2, the edge sawtooth point determination unit includes: The Mth brightness difference absolute value determining subunit is used to calculate the absolute value of the brightness difference between the M-1th target pixel and the Mth target pixel when the ratio of the first brightness difference absolute value to the brightness of the edge pixel is greater than a preset value, so as to obtain the Mth brightness difference absolute value, wherein M=2, ..., N, and M is an integer; the first edge jagged point determining subunit is used to determine the edge pixel as the edge jagged point when the ratio of the Mth brightness difference absolute value to the brightness of the M-1th target pixel is greater than the preset value.

14. The device according to claim 8, characterized in that When N=4, the edge sawtooth point determination unit includes: a second brightness difference absolute value determining subunit, configured to calculate the brightness difference absolute value between the first target pixel and the second target pixel to obtain a second brightness difference absolute value when the ratio of the first brightness difference absolute value to the brightness of the edge pixel is greater than a preset value; a third brightness difference absolute value determining subunit, configured to calculate the brightness difference absolute value between the second target pixel and the third target pixel when the ratio of the second brightness difference absolute value to the brightness of the first target pixel is greater than the preset value, to obtain a third brightness difference absolute value; a fourth brightness difference absolute value determining subunit, configured to calculate the absolute value of the brightness difference between the third target pixel and the fourth target pixel when the ratio of the third brightness difference absolute value to the brightness of the second target pixel is greater than the preset value, to obtain a fourth brightness difference absolute value; The second edge jagged point determination subunit is used to determine the edge pixel point as the edge jagged point when the ratio of the absolute value of the fourth brightness difference value to the brightness of the third target pixel point is greater than the preset value.

15. A device for determining jagged points on image edges, characterized in that: The device includes a processor and a memory, wherein the memory stores at least one instruction, at least one program, a code set or an instruction set, and the at least one instruction, the at least one program, the code set or the instruction set is loaded and executed by the processor to implement the image edge jagged point determination method as described in any one of claims 1-7.

16. A computer-readable storage medium, characterized in that: The storage medium stores at least one instruction, at least one program, a code set or an instruction set, and the at least one instruction, the at least one program, the code set or the instruction set is loaded and executed by the processor to implement the method for determining the image edge jagged points as described in any one of claims 1-7.