An image filtering method, device, chip and module equipment
By identifying the color jagged line regions in the image and filtering only them, the color distortion problem caused by filtering color jagged line regions in the prior art is solved, thus improving image quality.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- UNISOC CHONGQING TECH CO LTD
- Filing Date
- 2022-12-12
- Publication Date
- 2026-07-24
AI Technical Summary
Existing technologies, when deinterlacing non-interlaced images, cause color distortion due to filtering of areas with color jagged lines, and cannot effectively avoid filtering image areas without color jagged lines.
Color jagged lines are identified based on pixel target parameters in the image to be processed. Only these regions are filtered. Target parameters include brightness, chroma, or saturation. The location of the color jagged lines is determined using specific thresholds and conditions, and then filtered.
It effectively avoids unnecessary filtering in image areas without color or jagged edges, reduces color distortion, and improves image quality.
Smart Images

Figure CN116012268B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of communications, and more particularly to an image filtering method, apparatus, chip, and module device. Background Technology
[0002] Images can generally be categorized into interlaced and progressive images. Monitors displaying interlaced images typically use interlaced scanning, meaning half of the scan lines are displayed at a time, specifically alternating between even and odd-numbered scan lines. Due to the persistence of vision, the human eye doesn't notice only half of the scan lines and sees a complete frame. Monitors displaying progressive images use non-interlaced scanning, meaning all scan lines continuously display the image. When a monitor used to play non-interlaced images plays interlaced images, because only half of the corresponding scan lines are displayed at a time (even and odd lines are alternately displayed), reduced brightness and severe flickering occur. Therefore, deinterlacing processing is necessary for non-interlaced images.
[0003] Deinterlacing, also known as "anti-interlacing," is a method of converting interlaced images into progressive images. However, because interlaced images only display half of the scan lines at a time, they contain half the information of progressive images. For example, consider an interlaced digital camera that captures 60 fields per second. The first field is captured at 1 / 60th of a second, and the second at 2 / 60th of a second. If the object being filmed moves during the filming process, the resulting image frame after deinterlacing these two fields will exhibit jagged edges, a condition known as color blurring. These jagged edges refer to the jagged boundary lines between adjacent color blocks in the image, resulting in color blurring. Figure 1 As shown, the first field corresponds to odd-numbered scan lines, used to display the pixels corresponding to odd-numbered scan lines, and the second field corresponds to even-numbered scan lines, used to display the pixels corresponding to even-numbered scan lines. The first and second fields were captured by an interlaced camera at two consecutive time units. Assuming the time unit is 1 / 60 second, the first field was captured at 1 / 60 second, and the second field was captured at 2 / 60 second. From the images corresponding to the first and second fields, it can be seen that the color block corresponding to the gray pixel has shifted two pixels to the left. Image frame A is an image captured at the same time as the first field using a non-interlaced camera. It can be seen that the boundary line between the color block corresponding to the gray pixel and the color block corresponding to the white pixel is a straight line. Image frame B is the image obtained after deinterlacing the first and second fields. Because the object was moving during the capture, the boundary line between the color blocks corresponding to the gray pixel and the white pixel in the deinterlaced image frame B is no longer a straight line, but a jagged line, which can be called a color jagged line.
[0004] Because colored jagged lines can negatively impact image quality, the common approach is to filter the entire image using a filter. However, this method can affect areas without colored jagged lines, leading to color distortion. Therefore, avoiding filtering areas without colored jagged lines is a crucial problem that needs to be solved. Summary of the Invention
[0005] This application provides an image filtering method, apparatus, chip, and module device, which helps to avoid filtering image areas without color or jagged lines.
[0006] In a first aspect, this application provides an image filtering method, which includes: determining a first pixel in the image to be processed based on target parameters of each pixel in the image to be processed, wherein the target parameters include one or more of the following: brightness, chroma or saturation, the image to be processed is an image obtained after deinterlacing, and the region corresponding to the first pixel includes color jagged lines, wherein color jagged lines refer to the dividing line between two adjacent color blocks being jagged; and performing filtering processing on the first pixel.
[0007] Based on the method described in the first aspect, since the first pixel includes colored jagged lines, filtering is only performed on the first pixel. This can be understood as filtering only on the image area with colored jagged lines generated after deinterlacing. This helps to avoid unnecessary filtering of image areas without colored jagged lines, which would lead to color distortion.
[0008] In one possible implementation, the target parameter is chroma or saturation. The first pixel in the image to be processed is determined based on the target parameters of each pixel. Specifically, if one of the M second pixels in the image satisfies a first condition, then the M second pixels are determined as the first pixel, where M is an integer greater than or equal to 1. The first condition is that the absolute value of the difference in target parameters between the second and third pixels is greater than a first threshold, the absolute value of the difference in target parameters between the second and fourth pixels is greater than a first threshold, the third and fourth pixels are adjacent to the second pixel, and the target parameter of the second pixel is the maximum or minimum value among the target parameters of the second, third, and fourth pixels. The second, third, and fourth pixels are pixels in the same column. The first pixel is then filtered, specifically by filtering the target parameters of the first pixel. The electronic device uses this method to traverse all pixels in the entire image to determine the first pixel. Because colored jagged lines appear jagged, if the absolute value of the difference in chroma or saturation between three consecutive pixels is greater than a first threshold, and the chroma or saturation of the middle pixel among the three consecutive pixels is the minimum or maximum value among the three pixels, then the area corresponding to these three pixels can be determined as a colored jagged line. This implementation method helps to identify colored jagged lines more accurately.
[0009] In one possible implementation, the first pixel in the image to be processed is determined based on the target parameters of each pixel in the image to be processed. Specifically, if there is a second pixel among the M second pixels in the image to be processed that satisfies a first condition, then the M second pixels are determined as the first pixel, where M is an integer greater than or equal to 1. The target parameters include chroma and saturation, wherein the first condition includes one or more of the following conditions: the absolute value of the chroma difference between the second pixel and the third pixel is greater than a first threshold; the absolute value of the chroma difference between the second pixel and the fourth pixel is greater than a first threshold; both the third pixel and the fourth pixel are second pixels. The first pixel is determined by filtering the chroma and saturation of three consecutive pixels. The first pixel is defined as follows: adjacent pixels, and the chroma of the second pixel is the maximum or minimum value among the chroma of the second, third, and fourth pixels; the absolute value of the saturation difference between the second and third pixels is greater than a first threshold; the absolute value of the saturation difference between the second and fourth pixels is greater than the first threshold; the third and fourth pixels are adjacent to the second pixel; and the saturation of the second pixel is the maximum or minimum value among the saturation of the second, third, and fourth pixels. The first pixel is then filtered, specifically by filtering both its saturation and chroma. The electronic device uses this method to traverse all pixels in the entire image to determine the first pixel. Since colored jagged lines are jagged, if the absolute value of the chroma and / or saturation difference between three consecutive pixels is greater than the first threshold, and the chroma and / or saturation of the middle pixel among the three consecutive pixels is the minimum or maximum value among the three pixels, then the area corresponding to these three pixels can be determined as a colored jagged line. This implementation method facilitates more accurate identification of colored jagged lines.
[0010] In one possible implementation, if any of the M second pixels in the image to be processed satisfies a first condition, then the M second pixels are determined to be the first pixel. Specifically, if any of the M second pixels in the image to be processed satisfies the first condition and none of the M second pixels satisfy the second condition, then the M second pixels are determined to be the first pixel. The second condition is that the absolute value of the brightness difference between the second and third pixels is greater than a third threshold, and the absolute value of the brightness difference between the second and fourth pixels is greater than the third threshold. The brightness of the second pixel is the maximum or minimum value among the brightness of the second, third, and fourth pixels. The electronic device uses this method to traverse all pixels in the entire image to be processed, thereby determining the first pixel. Since colored jagged lines appear jagged, if the absolute value of the difference in chroma or saturation between three consecutive pixels is greater than the first threshold, and the chroma or saturation of the middle pixel among the three consecutive pixels is the minimum or maximum value among the three pixels, then the area corresponding to these three pixels can be determined to be a colored jagged line. Since jagged lines in color are mainly caused by errors in the chroma and saturation of some pixels during deinterlacing, and luminance may interfere with chroma or saturation, it is necessary to exclude cases where luminance itself has jagged lines, which will help to more accurately identify jagged lines in color.
[0011] In one possible implementation, M second pixels are determined as the first pixel. Specifically, a target region is determined based on the M second pixels. The target region includes N pixels, and the M second pixels are located within the target region, where N is an integer greater than M. These N pixels are then determined as the first pixel. Based on this implementation, since colored jagged lines typically appear within a single area, this method can completely determine the location of the colored jagged lines.
[0012] In one possible implementation, the target parameter is chroma. The target parameter of the first pixel is filtered, specifically by filtering the chroma of the first pixel based on the following formula:
[0013]
[0014] Where Bu2 represents the chromaticity of the first pixel before filtering, Bu1 represents the chromaticity of the first pixel after filtering, Au represents the sixth pixel adjacent to the first pixel, Cu represents the seventh pixel adjacent to the first pixel, and Alpha is the value set by the register.
[0015] Secondly, this application proposes an apparatus comprising a determining unit and a processing unit. The determining unit is used to determine a first pixel in the image to be processed based on target parameters of each pixel in the image to be processed. The target parameters include one or more of the following: brightness, chroma, or saturation. The image to be processed is an image obtained by deinterlacing a first image and a second image. The first image and the second image are two adjacent frames. The first image is used to display pixels in odd-numbered rows, and the second image is used to display pixels in even-numbered rows. The region corresponding to the first pixel includes color jagged lines, where the color jagged lines refer to the serrated boundary lines between two adjacent color blocks. The processing unit is used to perform filtering processing on the first pixel.
[0016] Thirdly, this application provides a chip including a processor configured to cause the chip to perform the methods described in the first aspect or any possible implementation thereof.
[0017] Fourthly, this application provides a module device, which includes a communication module, a power module, a storage module, and a chip, wherein: the power module is used to provide electrical energy to the module device; the storage module is used to store data and instructions; the communication module is used for internal communication within the module device, or for communication between the module device and external devices; and the chip is used to execute the methods in the first aspect above or any possible implementation thereof.
[0018] Fifthly, embodiments of the present invention disclose an electronic device including a memory and a processor. The memory is used to store a computer program, the computer program including program instructions, and the processor is configured to invoke the program instructions to execute the method described in the first aspect or any possible implementation thereof.
[0019] In a sixth aspect, this application provides a computer-readable storage medium storing computer-readable instructions that, when executed on a device, cause the device to perform the methods described in the first aspect or any possible implementation thereof.
[0020] In a seventh aspect, this application provides a computer program or computer program product, including code or instructions that, when executed on a computer, cause the computer to perform the method as described in the first aspect or any possible implementation thereof. Attached Figure Description
[0021] To more clearly illustrate the technical solutions in the embodiments of this application, the drawings used in the description of the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0022] Figure 1 This is a deinterlacing schematic diagram provided in an embodiment of this application;
[0023] Figure 2 This is a schematic diagram of an averaging filter provided in an embodiment of this application;
[0024] Figure 3 This is a schematic diagram of a weighted filter provided in an embodiment of this application;
[0025] Figure 4 This is a schematic flowchart of an image filtering method provided in an embodiment of this application;
[0026] Figure 5 This is a schematic diagram of a second pixel provided in an embodiment of this application;
[0027] Figure 6 This is a schematic diagram of a target area provided in an embodiment of this application;
[0028] Figure 7 This is a schematic diagram of the structure of a communication device provided in an embodiment of this application;
[0029] Figure 8 This is a schematic diagram of the structure of another communication device provided in the embodiments of this application;
[0030] Figure 9 This is a schematic diagram of the structure of a module device provided in an embodiment of this application. Detailed Implementation
[0031] The technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.
[0032] The terminology used in the following embodiments of this application is for the purpose of describing particular embodiments only and is not intended to be limiting of this application. As used in the specification and appended claims of this application, the singular expressions “a,” “an,” “the,” “the,” “the,” and “this” are intended to include the plural expressions as well, unless the context clearly indicates otherwise. It should also be understood that the term “and / or” as used in this application refers to and includes any or all possible combinations of one or more of the listed items.
[0033] It should be noted that the terms "first," "second," "third," etc., used in the specification, claims, and accompanying drawings of this application are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It should be understood that such data can be interchanged where appropriate so that the embodiments of this application described herein can be implemented in orders other than those illustrated or described herein. Furthermore, the term "comprising" and any variations thereof are intended to cover a non-exclusive inclusion; 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 explicitly listed, but may include other steps or units not explicitly listed or inherent to these processes, methods, products, or devices.
[0034] The background of the embodiments of this application is introduced below:
[0035] Emerging high-definition television standards come in two types: interlaced and non-interlaced. Interlaced displays are used to support the playback of interlaced images, while non-interlaced displays are used to support the playback of progressive images. Most broadcast video is interlaced. Interlaced images consist of two scan fields, which make up each image frame. Each scan field contains half the number of horizontal lines in a frame; the upper scan field (or scan field 1) contains all odd-numbered lines, and the lower scan field (or scan field 2) contains all even-numbered lines. Interlaced image displays (such as televisions) first draw all the lines in one scan field, then draw all the lines in the other scan field. Therefore, when displaying an image frame, the two scan fields are displayed interlaced; for example, the scan field corresponding to even-numbered scan lines is displayed first, followed by the scan field corresponding to odd-numbered scan lines. Progressive images do not distinguish between the two scan fields. Progressive scan displays draw all the horizontal lines in one pass from top to bottom to display progressive images. Therefore, the two scan fields that make up a video frame are displayed simultaneously.
[0036] Deinterlacing, also known as "anti-interlacing," refers to a method of converting interlaced images into progressive images. Because only one of the two scan fields in an interlaced image is displayed at a time, directly playing an interlaced image on a non-interlaced display device will result in severe flickering and a reduction in brightness by half. Due to these problems, all modern display devices using progressive scanning need to have deinterlacing capabilities.
[0037] Due to limitations in hardware speed and buffer size, conventional digital cameras cannot continuously capture progressive images. Instead, they typically capture interlaced images. Interlaced images contain half the information of progressive images, reducing hardware speed and buffer size requirements by nearly half. However, the timing of each frame's capture is not uniform, so the corresponding images in two frames may not be identical. For example, a digital camera capturing 60 frames per second might capture the first frame at 1 / 60th of a second and the second at 2 / 60th of a second. Combining these frames will result in a smooth image frame without jagged edges if the subject remains stationary. However, if the subject moves, the combined image will exhibit a jagged effect, or jagged edges. To address this, a low-pass filter (LPF) is typically used to remove these high-frequency components. However, this results in a slightly blurry image.
[0038] A low-pass filter can be an average filter, which preserves low-frequency components while reducing or eliminating high-frequency components. High-frequency components refer to pixels with large grayscale value variations over short distances (e.g., edges or noise). Low-frequency components refer to pixels with small grayscale value variations over short distances (e.g., background or skin texture). An average filter works by summing the grayscale values of all neighboring pixels for each pixel and then replacing the pixel's grayscale value with the average value. The effect is to reduce the value of pixels with large grayscale variations, thus reducing image sharpness. For example, ... Figure 2 As shown, Figure 2 It includes 9 pixels, and the weight of each pixel is 1. Therefore, the grayscale values of each pixel are added together and then divided by 9 to eliminate the high-frequency part.
[0039] A low-pass filter can be a weighted average filter, where the strength of the low-pass filter is determined by controlling the weights. A weighted average filter works by multiplying the grayscale values of all neighboring pixels of each pixel by their respective weight values, summing these sums, and then replacing the original grayscale value with the average. If the weights are controlled to preserve low-frequency components, the effect will be to reduce the value of pixels with large grayscale variations, thus reducing image sharpness. For example, ... Figure 3 As shown, Figure 3 It includes 9 pixels, of which 4 pixels have a weight of 1, 4 pixels have a weight of 2, and 1 pixel has a weight of 4. Therefore, the grayscale values of each pixel are added together and then divided by the total weight value of 16 to eliminate the high-frequency part.
[0040] However, the method described above filters the entire image, which can affect image areas without colored jagged edges, leading to color distortion. Therefore, avoiding filtering image areas without colored jagged edges is a problem that urgently needs to be solved.
[0041] The image filtering method provided in the embodiments of this application will be described in detail below:
[0042] Please see Figure 4 , Figure 4 This is a flowchart illustrating an image filtering method provided in an embodiment of this application. Figure 4 The subject of the method shown can be an electronic device or a chip in an electronic device. This application does not limit the subject of the method. Figure 4 The method will be explained using an electronic device as the executing subject. The executing subjects of the image filtering methods shown in other figures of this application are similar and will not be repeated hereafter. Figure 4 The image filtering method shown includes steps 401 to 402.
[0043] 401. Determine the first pixel in the image to be processed based on the target parameters of each pixel in the image to be processed. The target parameters include one or more of the following: brightness, chroma or saturation.
[0044] 402. Perform filtering on the first pixel.
[0045] In this embodiment, the image to be processed refers to the image obtained after deinterlacing, specifically the image obtained after deinterlacing two adjacent fields captured by the camera. In these two adjacent fields, one field displays the scan lines of odd-numbered rows, and the other field displays the scan lines of even-numbered rows. Luminance, chroma, and saturation refer to the Y, U, and V values in YUV color coding. Specifically, luminance (Luminance or Luma) refers to the Y value, also known as grayscale value; chroma refers to the U value; and saturation refers to the V value. The region corresponding to the first pixel determined by the electronic device includes color jagged lines. Because the object captured by the camera in the two fields corresponding to the deinterlacing has moved, the content captured at the corresponding shooting time in the two fields is different, thus producing color jagged lines. Color jagged lines refer to the jagged boundary lines between two adjacent color blocks. The electronic device determines the first pixel in the image to be processed based on the target parameters of each pixel in the image to be processed. This can be understood as the electronic device determining the location of the colored jagged lines in the image to be processed based on the target parameters of each pixel, and then filtering the pixels at the locations of the colored jagged lines. Based on the method described in this application, since the first pixel includes colored jagged lines, filtering is only performed on the first pixel. This can be understood as filtering only the image area with colored jagged lines generated after deinterlacing, which helps avoid unnecessary filtering of image areas without colored jagged lines, thus preventing color distortion.
[0046] The following will mainly introduce three methods for determining the first pixel in the image to be processed based on the target parameters of each pixel in the image to be processed:
[0047] Method 1: The target parameter is chroma or saturation. The specific method for determining the first pixel is as follows: If there is a second pixel among the M second pixels in the image to be processed that satisfies a first condition, then the M second pixels are determined as the first pixel, where M is an integer greater than or equal to 1. The first condition is: the absolute value of the difference in target parameters between the second and third pixels is greater than a first threshold; the absolute value of the difference in target parameters between the second and fourth pixels is greater than the first threshold; the third and fourth pixels are adjacent to the second pixel; and the target parameter of the second pixel is the maximum or minimum value among the target parameters of the second, third, and fourth pixels; the second, third, and fourth pixels are pixels in the same column. Optionally, the M pixels are consecutive pixels in the same column. M and the first threshold can be preset by the electronic device. The electronic device uses this method to traverse all pixels in the entire image to be processed, thereby determining the first pixel. Because colored jagged lines appear jagged, if the absolute value of the difference in chroma or saturation between three consecutive pixels is greater than a first threshold, and the chroma or saturation of the middle pixel among the three consecutive pixels is the minimum or maximum value among the three pixels, then the area corresponding to these three pixels can be determined as a colored jagged line. This implementation method helps to identify colored jagged lines more accurately.
[0048] by Figure 5 For example, the image to be processed includes two second pixels, namely pixel B and pixel C. If either pixel B or pixel C satisfies the first condition, then pixel B and pixel C can be determined as first pixels. The third and fourth pixels refer to two pixels that are in the same column and adjacent to the second pixels. For example, pixels B and C are both second pixels. For pixel B, pixels A and C are two adjacent pixels in the same column, so pixels A and C can be considered as the third and fourth pixels of pixel B. For pixel C, pixels B and D are two adjacent pixels in the same column, so pixels B and D can be considered as the third and fourth pixels of pixel C.
[0049] Determining whether pixel B satisfies the first condition can be understood as determining whether pixel B satisfies the following conditions: the absolute value of the difference between the target parameters of pixel B and pixel A is greater than the first threshold; the absolute value of the difference between the target parameters of pixel B and pixel C is greater than the first threshold; pixel A and pixel C are adjacent to pixel B; and the target parameter of pixel B is the maximum or minimum value among the target parameters of pixel B, pixel A, and pixel C.
[0050] Determining whether pixel C satisfies the first condition can be understood as determining whether pixel C satisfies the following conditions: the absolute value of the difference between the target parameters of pixel C and pixel B is greater than the first threshold, the absolute value of the difference between the target parameters of pixel C and pixel D is greater than the first threshold, and the target parameter of pixel B is the maximum or minimum value among the target parameters of pixel B, the target parameters of pixel A, and the target parameters of pixel C.
[0051] Optionally, when the target pixel is chroma, pixel B satisfies the first condition, which means that pixel B satisfies the following formula (1), and pixel C satisfies the first condition, which means that pixel C satisfies the following formula (2).
[0052] (Au-Bu>th1)&(Cu-Bu>th1)||(Bu-Au>th1)&(Bu-Cu>th1)(1)
[0053] (Bu-Cu>th1)&(Du-Cu>th1)||(Cu-Bu>th1)&(Cu-Du>th1)(2)
[0054] Where Au represents the chromaticity of pixel A, Bu represents the chromaticity of pixel B, Cu represents the chromaticity of pixel C, Du represents the chromaticity of pixel D, and th1 represents the first threshold. The mathematical symbol "||" represents OR, and the mathematical symbol "&" represents AND.
[0055] Optionally, when the target pixel is saturated, pixel B satisfies the first condition, which means that pixel B satisfies the following formula (3), and pixel C satisfies the first condition, which means that pixel C satisfies the following formula (4).
[0056] (Av-Bv>th1)&(Cv-Bv>th1)||(Bv-Av>th1)&(Bv-Cv>th1)(3)
[0057] (Bv-Cv>th1)&(Dv-Cv>th1)||(Cv-Bv>th1)&(Cv-Dv>th1)(4)
[0058] Where Av represents the saturation of pixel A, Bv represents the saturation of pixel B, Cv represents the saturation of pixel C, Dv represents the saturation of pixel D, and th1 represents the first threshold.
[0059] Optionally, when the target parameter is chroma, the specific implementation of filtering the first pixel is to filter the chroma of the first pixel. The chroma of the first pixel can be filtered based on the following formula (5):
[0060]
[0061] Where Bu2 represents the chromaticity of the first pixel before filtering, Bu1 represents the chromaticity of the first pixel after filtering, Au represents the sixth pixel adjacent to the first pixel, Cu represents the seventh pixel adjacent to the first pixel, the first pixel, the sixth pixel, and the seventh pixel are all in the same column, and Alpha is the value set by the register.
[0062] Optionally, when the target parameter is saturation, the specific implementation of filtering the first pixel is to filter the saturation of the first pixel. The saturation of the first pixel can be filtered based on the following formula (6):
[0063]
[0064] Where Bv2 represents the saturation of the first pixel before filtering, Bv1 represents the saturation of the first pixel after filtering, Av represents the sixth pixel adjacent to the first pixel, Cv represents the seventh pixel adjacent to the first pixel, the first pixel, the sixth pixel, and the seventh pixel are all in the same column, and Alpha is the value set by the register.
[0065] Method 2: The target parameter is chroma or saturation. The specific method for determining the first pixel is as follows: If there is a second pixel among the M second pixels in the image to be processed that satisfies the first condition, then the M second pixels are determined as the first pixel, where M is an integer greater than or equal to 1; the target parameters include chroma and saturation; wherein, the first condition includes one or more of the following conditions: Condition 1: The absolute value of the difference in chroma between the second pixel and the third pixel is greater than the first threshold, the absolute value of the difference in chroma between the second pixel and the fourth pixel is greater than the first threshold, the third pixel and the fourth pixel are both adjacent to the second pixel, and the chroma of the second pixel is the maximum or minimum value among the chroma of the second pixel, the chroma of the third pixel, and the chroma of the fourth pixel; Condition 2: The absolute value of the difference in saturation between the second pixel and the third pixel is greater than the first threshold, the absolute value of the difference in saturation between the second pixel and the fourth pixel is greater than the first threshold, the third pixel and the fourth pixel are both adjacent to the second pixel, and the saturation of the second pixel is the maximum or minimum value among the saturation of the second pixel, the saturation of the third pixel, and the saturation of the fourth pixel. The second pixel satisfies the first condition, which can be understood as the second pixel satisfying either condition 1 or condition 2. Optionally, the M pixels are consecutive pixels in the same column. M and the first threshold can be preset by the electronic device. The electronic device uses this method to traverse all pixels in the entire image to be processed, thereby determining the first pixel. Since the colored jagged lines are jagged, if the absolute value of the difference in chroma and / or saturation between three consecutive pixels is greater than the first threshold, and the chroma and / or saturation of the middle pixel among the three consecutive pixels is the minimum or maximum of the three pixels, then the area corresponding to these three pixels can be determined as a colored jagged line. This implementation method facilitates more accurate identification of colored jagged lines.
[0066] Same as above, with Figure 5 For example, if either pixel B or pixel C satisfies the first condition, then pixel B and pixel C can be determined as the first pixel. The first condition includes condition 1 and / or condition 2. Pixel B satisfying condition 1 means that pixel B satisfies the above formula (1); pixel C satisfying condition 1 means that pixel C satisfies the above formula (2); pixel B satisfying condition 2 means that pixel B satisfies the above formula (3); and pixel C satisfying condition 2 means that pixel C satisfies the above formula (4). For a detailed description, please refer to Method 1; the embodiments of this application will not be repeated here.
[0067] Optionally, in this method, the filtering of the first pixel is specifically implemented by filtering both the saturation and chroma of the first pixel. This can be done by filtering both the chroma and saturation of the first pixel simultaneously, or by filtering them separately in a specific order; this embodiment does not limit this approach. Further optionally, the chroma of the first pixel can be filtered based on the above formula (5), and the saturation of the first pixel can be filtered based on the above formula (6). For a detailed description, please refer to Method 1; this embodiment will not repeat the details here.
[0068] Method 3: The target parameter is chroma or saturation. The specific method for determining the first pixel is as follows: If among the M second pixels in the image to be processed, there is a second pixel that satisfies the first condition and none of the M second pixels satisfies the second condition, then the M second pixels are determined as the first pixel. The second condition is that the absolute value of the difference in brightness between the second pixel and the third pixel is greater than a second threshold, and the absolute value of the difference in brightness between the second pixel and the fourth pixel is greater than the second threshold. The brightness of the second pixel is the maximum or minimum value among the brightness of the second pixel, the brightness of the third pixel, and the brightness of the fourth pixel. The first condition can refer to the first condition in Method 1 or Method 2, which will not be elaborated further in this embodiment. Optionally, the M pixels are consecutive pixels in the same column. M and the first threshold can be preset by the electronic device. The electronic device uses this method to traverse all pixels in the entire image to be processed, thereby determining the first pixel. Since colored jagged lines appear jagged, if the absolute value of the difference in chroma or saturation between three consecutive pixels is greater than a first threshold, and the chroma or saturation of the middle pixel among the three consecutive pixels is the minimum or maximum value among the three pixels, then the area corresponding to these three pixels can be identified as a colored jagged line. Because colored jagged lines are mainly caused by errors in the chroma and saturation of some pixels during deinterlacing, and luminance may interfere with chroma or saturation, it is necessary to exclude cases where luminance itself corresponds to jagged lines. Based on this implementation method, it is beneficial to more accurately identify colored jagged lines.
[0069] by Figure 5 For example, if one of pixels B and pixel C satisfies the first condition, and neither pixel B nor pixel C satisfies the second condition, then pixels B and C can be determined as the first pixel. The fact that neither pixel B nor pixel C satisfies the second condition can be understood as pixel B and pixel C not satisfying the following formula (7):
[0070] (Ay-By>th2)&(Cy-By>th2)&(Cy-Dy>th2)||(By-Ay>th2)&(By-Cy>th2)&(Dy-Cy>th2)(7)
[0071] Ay represents the brightness of pixel A, By represents the brightness of pixel B, Cy represents the brightness of pixel C, Dy represents the brightness of pixel D, and th2 represents the second threshold.
[0072] The method for filtering the first pixel is the same as that in Method 1 and Method 2 described above, and can be found in the descriptions in Method 1 and Method 2. The embodiments of this application will not be repeated here.
[0073] In summary, the specific method among the three methods described above can be determined by setting corresponding parameters in the registers of the electronic device. This application does not limit the specific method used. Based on the three methods described above, the first pixel containing the colored jagged lines can be identified. Filtering is performed only on the first pixel; that is, it can be understood as filtering only on the image area with colored jagged lines generated after deinterlacing. Therefore, this method avoids unnecessary filtering of image areas without colored jagged lines, which could lead to color distortion.
[0074] In combination with the above possible implementations, the specific implementation of determining the first pixel is as follows: A target region is determined based on M second pixels. This target region includes N pixels, with the M second pixels located within the target region, and N being an integer greater than M; the N pixels are then determined as the first pixel. Optionally, the N pixels may include a region formed by pixels spaced X pixels horizontally from the M second pixels and pixels spaced Y pixels vertically from the M second pixels, where N satisfies N = (2 × X + 1) × (M + 2 × Y). X and Y can be preset by an electronic device. The target region can also have other forms, which will not be elaborated upon here. Based on this implementation, since colored jagged lines usually appear within a single area, this implementation can completely determine the location of the colored jagged lines.
[0075] like Figure 6 As shown, Figure 6 The target region includes pixels B and C, both of which are second pixels. Using methods one, two, or three described above, when pixels B and C are determined as first pixels, all pixels in the target region are determined as first pixels. Based on the above description, the target region includes pixels spaced one pixel to the left and right of the two second pixels, and pixels spaced two pixels above and below the two second pixels. Therefore, N = (2 × 1 + 1) × (2 + 2 × 2) = 18.
[0076] Please see Figure 7 , Figure 7This is a schematic diagram of a device provided in an embodiment of the present invention. The device can be an electronic device or a device with electronic device functions (e.g., a chip). This device can perform the relevant steps of the electronic device in the aforementioned method embodiments. Specifically, as shown... Figure 7 As shown, the device 700 includes a determining unit 701 and a processing unit 702.
[0077] The determining unit 701 is used to determine the first pixel in the image to be processed based on the target parameters of each pixel in the image to be processed. The target parameters include one or more of the following: brightness, chroma or saturation. The image to be processed is an image obtained after deinterlacing. The region corresponding to the first pixel includes color jagged lines. Color jagged lines refer to the dividing line between two adjacent color blocks being jagged. The processing unit 702 is used to perform filtering processing on the first pixel.
[0078] In one possible implementation, the target parameter is chroma or saturation. When determining the first pixel in the image to be processed based on the target parameters of each pixel in the image to be processed, the determining unit 701 is specifically used to: if there is a second pixel among the M second pixels in the image to be processed that satisfies a first condition, then determine the M second pixels as the first pixel, where M is an integer greater than or equal to 1; wherein, the first condition is: the absolute value of the difference between the target parameters of the second pixel and the third pixel is greater than a first threshold, the absolute value of the difference between the target parameters of the second pixel and the fourth pixel is greater than the first threshold, the third pixel and the fourth pixel are both adjacent to the second pixel, and the target parameter of the second pixel is the maximum or minimum value among the target parameters of the second pixel, the target parameters of the third pixel and the target parameters of the fourth pixel, and the second pixel, the third pixel and the fourth pixel are pixels in the same column; when the processing unit 702 performs filtering processing on the first pixel, it is specifically used to: perform filtering processing on the target parameters of the first pixel.
[0079] In one possible implementation, when determining the first pixel in the image to be processed based on the target parameters of each pixel in the image to be processed, the determining unit 701 is specifically configured to: if there is a second pixel among the M second pixels in the image to be processed that satisfies a first condition, then determine the M second pixels as the first pixel, where M is an integer greater than or equal to 1; the target parameters include chroma and saturation; wherein, the first condition includes one or more of the following conditions: the absolute value of the chroma difference between the second pixel and the third pixel is greater than a first threshold, the absolute value of the chroma difference between the second pixel and the fourth pixel is greater than a first threshold, and both the third pixel and the fourth pixel are chroma differences between the second and third pixels. The pixels are adjacent, and the chroma of the second pixel is the maximum or minimum value among the chroma of the second pixel, the chroma of the third pixel, and the chroma of the fourth pixel; the absolute value of the difference in saturation between the second pixel and the third pixel is greater than a first threshold, the absolute value of the difference in saturation between the second pixel and the fourth pixel is greater than a first threshold, both the third pixel and the fourth pixel are adjacent to the second pixel, and the saturation of the second pixel is the maximum or minimum value among the saturation of the second pixel, the saturation of the third pixel, and the saturation of the fourth pixel; when the processing unit 702 performs filtering processing on the first pixel, it is specifically used to: perform filtering processing on both the saturation and chroma of the first pixel.
[0080] In one possible implementation, when processing unit 702 performs filtering on the first pixel, it specifically performs the following:
[0081] In one possible implementation, the determining unit 701 is used to determine the M second pixels as first pixels if there is a second pixel among the M second pixels in the image to be processed that satisfies the first condition. Specifically, it is used to determine the M second pixels as first pixels if there is a second pixel among the M second pixels in the image to be processed that satisfies the first condition and none of the M second pixels satisfy the second condition. The second condition is that the absolute value of the difference in brightness between the second pixel and the third pixel is greater than a second threshold, and the absolute value of the difference in brightness between the second pixel and the fourth pixel is greater than the second threshold. The brightness of the second pixel is the maximum or minimum value among the brightness of the second pixel, the brightness of the third pixel, and the brightness of the fourth pixel.
[0082] In one possible implementation, when determining M second pixels as first pixels, the determining unit 701 is specifically used to: determine a target region based on the M second pixels, the target region including N pixels, the M second pixels being located within the target region, and N being an integer greater than M; and determine the N pixels as first pixels.
[0083] In one possible implementation, the target parameter is chroma. When the processing unit 702 performs filtering on the target parameter of the first pixel, it specifically filters the chroma of the first pixel based on the following formula:
[0084]
[0085] Where Bu2 represents the chromaticity of the first pixel before filtering, Bu1 represents the chromaticity of the first pixel after filtering, Au represents the sixth pixel adjacent to the first pixel, Cu represents the seventh pixel adjacent to the first pixel, and Alpha is the value set by the register.
[0086] This application also provides a chip that can perform the relevant steps of the electronic device in the foregoing method embodiments. The chip includes a processor.
[0087] The processor is configured to cause the chip to perform the following operations: determine the first pixel in the image to be processed based on the target parameters of each pixel in the image to be processed, the target parameters including one or more of the following: brightness, chroma or saturation, the image to be processed is an image obtained after deinterlacing, and the region corresponding to the first pixel includes color jagged lines, the color jagged lines refer to the dividing line between two adjacent color blocks being jagged; and perform filtering processing on the first pixel.
[0088] In one possible implementation, the target parameter is chroma or saturation. The processor is configured to cause the chip to perform the following operation when determining the first pixel in the image to be processed based on the target parameters of each pixel in the image to be processed: if there is a second pixel among M second pixels in the image to be processed that satisfies a first condition, then the M second pixels are determined as the first pixel, where M is an integer greater than or equal to 1; wherein, the first condition is: the absolute value of the difference between the target parameters of the second pixel and the third pixel is greater than a first threshold, the absolute value of the difference between the target parameters of the second pixel and the fourth pixel is greater than a first threshold, the third pixel and the fourth pixel are both adjacent to the second pixel, and the target parameter of the second pixel is the maximum or minimum value among the target parameters of the second pixel, the third pixel and the fourth pixel, and the second pixel, the third pixel and the fourth pixel are pixels in the same column; the processor is configured to cause the chip to perform filtering processing on the first pixel when performing filtering processing on the target parameters of the first pixel.
[0089] In one possible implementation, the processor is configured to, when the chip determines the first pixel in the image to be processed based on the target parameters of each pixel in the image to be processed, specifically perform the following operation: if there is a second pixel among M second pixels in the image to be processed that satisfies a first condition, then the M second pixels are determined to be the first pixel, where M is an integer greater than or equal to 1; the target parameters include chroma and saturation; wherein, the first condition includes one or more of the following conditions: the absolute value of the chroma difference between the second pixel and the third pixel is greater than a first threshold, the absolute value of the chroma difference between the second pixel and the fourth pixel is greater than the first threshold, and both the third pixel and the fourth pixel are chroma differences between the second and third pixels. The pixels are adjacent, and the chroma of the second pixel is the maximum or minimum value among the chroma of the second pixel, the chroma of the third pixel, and the chroma of the fourth pixel; the absolute value of the difference in saturation between the second pixel and the third pixel is greater than a first threshold, the absolute value of the difference in saturation between the second pixel and the fourth pixel is greater than a first threshold, both the third pixel and the fourth pixel are adjacent to the second pixel, and the saturation of the second pixel is the maximum or minimum value among the saturation of the second pixel, the saturation of the third pixel, and the saturation of the fourth pixel; when the processor is configured to cause the chip to perform filtering processing on the first pixel, it is specifically configured to perform the following operations: filtering processing on both the saturation and chroma of the first pixel.
[0090] In one possible implementation, the processor is configured to determine the M second pixels as first pixels if the chip determines the M second pixels as first pixels if any of the M second pixels in the image to be processed satisfy a first condition. Specifically, the processor performs the following operation: if any of the M second pixels in the image to be processed satisfies the first condition and none of the M second pixels satisfy the second condition, then the M second pixels are determined as first pixels. The second condition is that the absolute value of the difference in brightness between the second pixel and the third pixel is greater than a second threshold, and the absolute value of the difference in brightness between the second pixel and the fourth pixel is greater than the second threshold. The brightness of the second pixel is the maximum or minimum value among the brightness of the second pixel, the brightness of the third pixel, and the brightness of the fourth pixel.
[0091] In one possible implementation, the processor is configured to, when the chip determines that M second pixels are first pixels, specifically perform the following operations: determine a target region based on the M second pixels, the target region comprising N pixels, the M second pixels being located within the target region, and N being an integer greater than M; determine the N pixels as first pixels.
[0092] In one possible implementation, the target parameter is chroma, and the processor is configured to perform the following operation when the chip filters the target parameter of the first pixel: filtering the chroma of the first pixel based on the following formula:
[0093]
[0094] Where Bu2 represents the chromaticity of the first pixel before filtering, Bu1 represents the chromaticity of the first pixel after filtering, Au represents the sixth pixel adjacent to the first pixel, Cu represents the seventh pixel adjacent to the first pixel, and Alpha is the value set by the register.
[0095] Please see Figure 8 , Figure 8 This is a schematic diagram of the structure of an electronic device provided in an embodiment of the present invention. The electronic device 800 may include a memory 801 and a processor 802. Optionally, the electronic device may also include a communication interface 803. The memory 801, processor 802, and communication interface 803 are connected via one or more communication buses. The communication interface 803 is controlled by the processor 802 for sending and receiving information.
[0096] Memory 801 may include read-only memory and random access memory, and provides instructions and data to processor 802. A portion of memory 801 may also include non-volatile random access memory.
[0097] The communication interface 803 is used to receive or send data.
[0098] The processor 802 can be a central processing unit (CPU), but it can also be other general-purpose processors, digital signal processors (DSPs), application-specific integrated circuits (ASICs), field-programmable gate arrays (FPGAs), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. The general-purpose processor can be a microprocessor; optionally, the processor 802 can also be any conventional processor. Wherein:
[0099] Memory 801 is used to store program instructions.
[0100] Processor 802 is used to call program instructions stored in memory 801.
[0101] The processor 802 calls the program instructions stored in the memory 801, causing the electronic device 800 to execute the method performed by the electronic device in the above method embodiment.
[0102] like Figure 9 As shown, Figure 9This is a schematic diagram of the structure of a module device provided in an embodiment of this application. The module device 900 can perform the relevant steps of the electronic device in the aforementioned method embodiment. The module device 900 includes: a communication module 901, a power module 902, a storage module 903, and a chip 904.
[0103] The power module 902 is used to provide power to the module device; the storage module 903 is used to store data and instructions; the communication module 901 is used for internal communication within the module device or for communication between the module device and external devices; and the chip 904 is used to execute the methods performed by the electronic device in the above method embodiments.
[0104] It should be noted that, Figure 8 and Figure 9 For details not mentioned in the corresponding embodiments and the specific implementation methods of each step, please refer to [link to relevant documentation]. Figure 1 The embodiments shown and the foregoing content will not be repeated here.
[0105] This application also provides a computer-readable storage medium storing instructions that, when executed on a processor, enable the implementation of the method flow described in the above method embodiments.
[0106] This application also provides a computer program product, which, when run on a processor, enables the implementation of the method flow described in the above method embodiments.
[0107] Regarding the modules / units included in the various devices and products described in the above embodiments, they can be software modules / units, hardware modules / units, or a combination of both. For example, for various devices and products applied to or integrated into a chip, all of their modules / units can be implemented using hardware methods such as circuits, or at least some modules / units can be implemented using software programs that run on the chip's integrated processor, while the remaining (if any) modules / units can be implemented using hardware methods such as circuits. For various devices and products applied to or integrated into a chip module, all of their modules / units can be implemented using hardware methods such as circuits. Different modules / units can be located in the same part (e.g., chip, circuit module, etc.) or different components of the chip module, or at least some modules / units... It can be implemented using software programs that run on the processor integrated within the chip module. The remaining (if any) modules / units can be implemented using hardware methods such as circuits. For various devices and products applied to or integrated into the terminal, the modules / units they contain can all be implemented using hardware methods such as circuits. Different modules / units can be located in the same component (e.g., chip, circuit module, etc.) or different components within the terminal. Alternatively, at least some modules / units can be implemented using software programs that run on the processor integrated within the terminal, while the remaining (if any) modules / units can be implemented using hardware methods such as circuits.
[0108] It should be noted that, for the sake of simplicity, the foregoing method embodiments are all described as a series of actions. However, those skilled in the art should understand that this application is not limited to the described order of actions, as some operations can be performed in other orders or simultaneously according to this application. Furthermore, those skilled in the art should also understand that the embodiments described in the specification are preferred embodiments, and the actions and modules involved are not necessarily essential to this application.
[0109] The descriptions of the various embodiments provided in this application can be referenced mutually. Each embodiment has its own emphasis, and parts not described in detail in a certain embodiment can be referred to the relevant descriptions of other embodiments. For the sake of convenience and brevity, for example, the functions and operations of the various devices and equipment provided in the embodiments of this application can be referred to the relevant descriptions of the method embodiments of this application. The method embodiments and the device embodiments can also be referenced, combined or cited from each other.
[0110] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of this application, and are not intended to limit them. Although this application has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some or all of the technical features therein. Such modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the scope of the technical solutions of the embodiments of this application.
Claims
1. An image filtering method, characterized in that, The method includes: The first pixel in the image to be processed is determined based on the target parameters of each pixel in the image to be processed. The first pixel includes M second pixels in the image to be processed. Among the M second pixels, there is a second pixel that satisfies a first condition and none of the M second pixels satisfies a second condition. The target parameters include one or more of the following: brightness, chroma, or saturation. The image to be processed is an image obtained after deinterlacing. The region corresponding to the first pixel includes color jagged lines. The color jagged lines refer to the serrated boundary lines between two adjacent color blocks. Perform filtering on the first pixel; When the target parameter is chroma or saturation, the first condition is: the absolute value of the difference between the target parameters of the second pixel and the third pixel is greater than a first threshold, the absolute value of the difference between the target parameters of the second pixel and the fourth pixel is greater than the first threshold, the third pixel and the fourth pixel are both adjacent to the second pixel, and the target parameter of the second pixel is the maximum or minimum value among the target parameters of the second pixel, the target parameters of the third pixel and the target parameters of the fourth pixel, and the second pixel, the third pixel and the fourth pixel are pixels in the same column; When the target parameters include chroma and saturation, the first condition includes a third condition and a fourth condition. The third condition is that the absolute value of the chroma difference between the second pixel and the third pixel is greater than a first threshold, and the absolute value of the chroma difference between the second pixel and the fourth pixel is greater than the first threshold, and the chroma of the second pixel is the maximum or minimum value among the chroma of the second pixel, the chroma of the third pixel, and the chroma of the fourth pixel. The fourth condition is that the absolute value of the saturation difference between the second pixel and the third pixel is greater than the first threshold, and the absolute value of the saturation difference between the second pixel and the fourth pixel is greater than the first threshold, and the saturation of the second pixel is the maximum or minimum value among the saturation of the second pixel, the saturation of the third pixel, and the saturation of the fourth pixel; both the third pixel and the fourth pixel are adjacent to the second pixel. The second condition is that the absolute value of the difference in brightness between the second pixel and the third pixel is greater than the third threshold, the absolute value of the difference in brightness between the second pixel and the fourth pixel is greater than the third threshold, and the brightness of the second pixel is the maximum or minimum value among the brightness of the second pixel, the brightness of the third pixel, and the brightness of the fourth pixel.
2. The method according to claim 1, characterized in that, When the target parameter is chroma or saturation, the filtering process for the first pixel includes: filtering the target parameter of the first pixel.
3. The method according to claim 1, characterized in that, When the target parameters include chroma and saturation, the filtering process for the first pixel includes: filtering both the saturation and chroma of the first pixel.
4. The method according to any one of claims 1 to 3, characterized in that, Determining the first pixel in the image to be processed based on the target parameters of each pixel in the image to be processed includes: A target region is determined based on the M second pixels, wherein the target region comprises N pixels, the M second pixels are located within the target region, and N is an integer greater than M; The N pixels are determined to be the first pixel.
5. The method according to claim 1 or 2, characterized in that, The target parameter is chromaticity, and the filtering process for the target parameter of the first pixel includes: The chromaticity of the first pixel is filtered based on the following formula: in, This represents the chromaticity of the first pixel before filtering. This represents the chromaticity of the first pixel after filtering. This represents the sixth pixel adjacent to the first pixel. This represents the seventh pixel adjacent to the first pixel. The value set for the register.
6. A communication device, characterized in that, The communication device includes a determining unit and a processing unit, wherein: The determining unit is configured to determine a first pixel in the image to be processed based on the target parameters of each pixel in the image to be processed. The first pixel includes M second pixels in the image to be processed. Among the M second pixels in the image to be processed, there is a second pixel that satisfies a first condition and none of the M second pixels satisfies a second condition. The target parameters include one or more of the following: brightness, chroma, or saturation. The image to be processed is an image obtained by deinterlacing a first image and a second image. The first image and the second image are two adjacent frames. The first image is used to display pixels in odd-numbered rows, and the second image is used to display pixels in even-numbered rows. The region corresponding to the first pixel includes color jagged lines, which refer to the jagged boundary lines between two adjacent color blocks. The processing unit is used to perform filtering processing on the first pixel; When the target parameter is chroma or saturation, the first condition is: the absolute value of the difference between the target parameters of the second pixel and the third pixel is greater than a first threshold, the absolute value of the difference between the target parameters of the second pixel and the fourth pixel is greater than the first threshold, the third pixel and the fourth pixel are both adjacent to the second pixel, and the target parameter of the second pixel is the maximum or minimum value among the target parameters of the second pixel, the target parameters of the third pixel and the target parameters of the fourth pixel, and the second pixel, the third pixel and the fourth pixel are pixels in the same column; When the target parameters include chroma and saturation, the first condition includes a third condition and a fourth condition. The third condition is that the absolute value of the chroma difference between the second pixel and the third pixel is greater than a first threshold, and the absolute value of the chroma difference between the second pixel and the fourth pixel is greater than the first threshold, and the chroma of the second pixel is the maximum or minimum value among the chroma of the second pixel, the chroma of the third pixel, and the chroma of the fourth pixel. The fourth condition is that the absolute value of the saturation difference between the second pixel and the third pixel is greater than the first threshold, and the absolute value of the saturation difference between the second pixel and the fourth pixel is greater than the first threshold, and the saturation of the second pixel is the maximum or minimum value among the saturation of the second pixel, the saturation of the third pixel, and the saturation of the fourth pixel; both the third pixel and the fourth pixel are adjacent to the second pixel. The second condition is that the absolute value of the difference in brightness between the second pixel and the third pixel is greater than the third threshold, the absolute value of the difference in brightness between the second pixel and the fourth pixel is greater than the third threshold, and the brightness of the second pixel is the maximum or minimum value among the brightness of the second pixel, the brightness of the third pixel, and the brightness of the fourth pixel.
7. A chip, characterized in that, Includes a processor, the chip being used for: The first pixel in the image to be processed is determined based on the target parameters of each pixel in the image to be processed. The first pixel includes M second pixels in the image to be processed. Among the M second pixels in the image to be processed, there is a second pixel that satisfies a first condition and none of the M second pixels satisfies a second condition. The target parameters include one or more of the following: brightness, chroma, or saturation. The image to be processed is an image obtained by deinterlacing a first image and a second image. The first image and the second image are two adjacent frames. The first image is used to display pixels in odd-numbered rows, and the second image is used to display pixels in even-numbered rows. The area corresponding to the first pixel includes color jagged lines. The color jagged lines refer to the serrated boundary lines between two adjacent color blocks. Perform filtering on the first pixel; When the target parameter is chroma or saturation, the first condition is: the absolute value of the difference between the target parameters of the second pixel and the third pixel is greater than a first threshold, the absolute value of the difference between the target parameters of the second pixel and the fourth pixel is greater than the first threshold, the third pixel and the fourth pixel are both adjacent to the second pixel, and the target parameter of the second pixel is the maximum or minimum value among the target parameters of the second pixel, the target parameters of the third pixel and the target parameters of the fourth pixel, and the second pixel, the third pixel and the fourth pixel are pixels in the same column; When the target parameters include chroma and saturation, the first condition includes a third condition and a fourth condition. The third condition is that the absolute value of the difference in chroma between the second pixel and the third pixel is greater than a first threshold, and the absolute value of the difference in chroma between the second pixel and the fourth pixel is greater than the first threshold. The chroma of the second pixel is the maximum or minimum value among the chroma of the second pixel, the chroma of the third pixel, and the chroma of the fourth pixel. The fourth condition is that the absolute value of the saturation difference between the second pixel and the third pixel is greater than the first threshold, and the absolute value of the saturation difference between the second pixel and the fourth pixel is greater than the first threshold, and the saturation of the second pixel is the maximum or minimum value among the saturation of the second pixel, the saturation of the third pixel and the saturation of the fourth pixel. Both the third pixel and the fourth pixel are adjacent to the second pixel; The second condition is that the absolute value of the difference in brightness between the second pixel and the third pixel is greater than the third threshold, the absolute value of the difference in brightness between the second pixel and the fourth pixel is greater than the third threshold, and the brightness of the second pixel is the maximum or minimum value among the brightness of the second pixel, the brightness of the third pixel, and the brightness of the fourth pixel.
8. A module device, characterized in that, The module device includes a communication module, a power module, a storage module, and a chip, wherein: The power module is used to provide electrical energy to the module device; The storage module is used to store data and instructions; The communication module is used for internal communication within the module device, or for communication between the module device and external devices; The chip is used to perform: The first pixel in the image to be processed is determined based on the target parameters of each pixel in the image to be processed. The first pixel includes M second pixels in the image to be processed. Among the M second pixels in the image to be processed, there is a second pixel that satisfies a first condition and none of the M second pixels satisfies a second condition. The target parameters include one or more of the following: brightness, chroma, or saturation. The image to be processed is an image obtained by deinterlacing a first image and a second image. The first image and the second image are two adjacent frames. The first image is used to display pixels in odd-numbered rows, and the second image is used to display pixels in even-numbered rows. The area corresponding to the first pixel includes color jagged lines. The color jagged lines refer to the serrated boundary lines between two adjacent color blocks. Perform filtering on the first pixel; When the target parameter is chroma or saturation, the first condition is: the absolute value of the difference between the target parameters of the second pixel and the third pixel is greater than a first threshold, the absolute value of the difference between the target parameters of the second pixel and the fourth pixel is greater than the first threshold, the third pixel and the fourth pixel are both adjacent to the second pixel, and the target parameter of the second pixel is the maximum or minimum value among the target parameters of the second pixel, the target parameters of the third pixel and the target parameters of the fourth pixel, and the second pixel, the third pixel and the fourth pixel are pixels in the same column; When the target parameters include chroma and saturation, the first condition includes a third condition and a fourth condition. The third condition is that the absolute value of the chroma difference between the second pixel and the third pixel is greater than a first threshold, and the absolute value of the chroma difference between the second pixel and the fourth pixel is greater than the first threshold, and the chroma of the second pixel is the maximum or minimum value among the chroma of the second pixel, the chroma of the third pixel, and the chroma of the fourth pixel. The fourth condition is that the absolute value of the saturation difference between the second pixel and the third pixel is greater than the first threshold, and the absolute value of the saturation difference between the second pixel and the fourth pixel is greater than the first threshold, and the saturation of the second pixel is the maximum or minimum value among the saturation of the second pixel, the saturation of the third pixel, and the saturation of the fourth pixel; both the third pixel and the fourth pixel are adjacent to the second pixel. The second condition is that the absolute value of the difference in brightness between the second pixel and the third pixel is greater than the third threshold, the absolute value of the difference in brightness between the second pixel and the fourth pixel is greater than the third threshold, and the brightness of the second pixel is the maximum or minimum value among the brightness of the second pixel, the brightness of the third pixel, and the brightness of the fourth pixel.
9. An electronic device, characterized in that, The device includes a memory and a processor, the memory being used to store a computer program, the computer program including program instructions, and the processor being configured to invoke the program instructions to cause the electronic device to perform the method as described in any one of claims 1 to 5.
10. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores computer-readable instructions that, when executed on the device, cause the device to perform the method of any one of claims 1 to 5.