Method and apparatus for eliminating moire in an image

By acquiring the overall grayscale value and the grayscale value in the direction of moiré pattern in the image of the display panel's photosensitive element, grayscale compensation is performed, which solves the problem of moiré pattern affecting imaging accuracy and improves the working accuracy of the photosensitive element and image quality.

CN116524839BActive Publication Date: 2025-11-28HEFEI VISIONOX TECH CO LTD +1
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202310485190.X
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-04-27
Publication Date
2025-11-28
Estimated Expiration
2043-04-27

AI Technical Summary

Technical Problem

Moiré patterns generated in the photosensitive element of the display panel affect the accuracy of the image from the imaging unit and reduce the operating precision of the photosensitive element.

Method used

The technical means to crack moiré patterns include: obtaining the overall grayscale value of the image to be processed and the overall grayscale value of the pixel rows parallel to the direction of moiré pattern extension, and then performing grayscale compensation.

Benefits of technology

Accurately eliminate moiré patterns in images, improve the working accuracy of photosensitive elements, enhance image quality, and reduce false recognition rates.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116524839B_ABST
    Figure CN116524839B_ABST
Patent Text Reader

Abstract

The application provides a method and device for eliminating moire in an image. Specifically, the method for eliminating moire in an image comprises: obtaining a to-be-processed image, the to-be-processed image comprising moire, and the moire being a strip-shaped moire; determining a first gray value of the to-be-processed image, wherein the first gray value represents the overall gray of the to-be-processed image; determining a current pixel row in the to-be-processed image and a second gray value of the current pixel row, wherein the second gray value represents the overall gray of the pixel row, and the current pixel row is parallel to the extension direction of the moire; and performing gray compensation on the pixel points of the current pixel row according to the first gray value and the second gray value. The above method can accurately eliminate the moire in the to-be-processed image.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application belongs to the technical field of display, and particularly relates to a method and device for eliminating moire in an image. BACKGROUND

[0002] At present, moire may occur in an image formed by a photosensitive element of a display panel. The moire may affect the accuracy of an image obtained by an imaging unit, and thus reduce the accuracy of the operation of the photosensitive element.

[0003] Therefore, it is urgent to eliminate the moire in the image to improve the operation accuracy of the photosensitive element. SUMMARY

[0004] The present application provides a method and device for eliminating moire in an image to accurately eliminate the moire in a to-be-processed image.

[0005] To solve the above technical problem, one technical solution adopted by the present application is a method for eliminating moire in an image, which comprises the following steps: obtaining a to-be-processed image, wherein the to-be-processed image comprises moire, and the moire is a strip-shaped moire; determining a first gray value of the to-be-processed image, wherein the first gray value represents the overall gray value of the to-be-processed image; determining a current pixel row in the to-be-processed image, and determining a second gray value of the current pixel row, wherein the second gray value represents the overall gray value of the pixel row, and the current pixel row is parallel to the extension direction of the moire; and performing gray compensation on the pixel points of the current pixel row according to the first gray value and the second gray value.

[0006] Further, before the step of performing gray compensation on the pixel points of the current pixel row according to the first gray value and the second gray value, the method further comprises the following steps: determining whether the current pixel row comprises the moire according to the first gray value and the second gray value; and if the current pixel row comprises the moire, performing the step of performing gray compensation on the pixel points of the current pixel row according to the first gray value and the second gray value.

[0007] Further, the step of determining whether the current pixel row comprises the moire according to the first gray value and the second gray value comprises the following step: in response to the second gray value being less than the first gray value, determining that the current pixel row comprises the moire.

[0008] Further, the step of performing gray compensation on the pixel points of the current pixel row comprises the following steps: calculating the difference between the first gray value and the second gray value; and performing gray compensation on the pixel points of the current pixel row according to the difference.

[0009] Preferably, the step of performing gray compensation on the pixel points of the current pixel row according to the difference comprises the following step: compensating the gray value of the pixel points of the current pixel row by the difference.

[0010] Further, if it is determined that the current pixel row has the moire, the step of performing the gray scale compensation on the pixel points of the current pixel row comprises: performing the gray scale compensation on each pixel point of the current pixel row.

[0011] Further, the step of determining the first gray scale value of the to-be-processed image comprises: determining a gray scale average value of the to-be-processed image to obtain the first gray scale value. And / or, the step of determining the second gray scale value of the current pixel row comprises: determining a gray scale average value of the current pixel row to obtain the second gray scale value of the current pixel row; or, determining a mode or a median of the gray scale values of the current pixel row to obtain the second gray scale value of the current pixel row.

[0012] Further, before the step of determining the current pixel row in the to-be-processed image, the method further comprises: obtaining an inclination angle of the moire; and rotating the to-be-processed image for a first time according to the inclination angle, so that the moire extends along a horizontal direction or a vertical direction; after the step of performing the gray scale compensation on the pixel points of the current pixel row, an initial processing image is obtained, and the method further comprises: rotating the initial processing image for a second time according to the inclination angle, wherein a direction of the second time rotation of the initial processing image is opposite to a direction of the first time rotation of the to-be-processed image.

[0013] Further, after the step of rotating the to-be-processed image for the first time according to the inclination angle, so that the moire extends along the horizontal direction or the vertical direction, the method further comprises: performing a marking processing of an invalid area at an outer periphery of the to-be-processed image, so that the marked to-be-processed image is a rectangle, wherein for the marked to-be-processed image, an area other than the invalid area is defined as a valid area; and the step of determining the current pixel row in the to-be-processed image comprises: determining the current pixel row in the valid area of the to-be-processed image; and after the step of rotating the initial processing image for the second time according to the inclination angle, the method further comprises: removing the invalid area in the initial processing image.

[0014] Preferably, the step of performing the marking processing of the invalid area at the outer periphery of the to-be-processed image comprises: setting a gray scale value of a pixel point in the invalid area as a target gray scale value, wherein the target gray scale value is different from a gray scale value of any pixel point in the to-be-processed image.

[0015] Further, after the step of performing the gray scale compensation on the pixel points of the current pixel row, the method further comprises:

[0016] The method further comprises: determining whether there is a pixel row which is not the current pixel row in the to-be-processed image; if there is, determining the pixel row which is not the current pixel row as the current pixel row, and returning to perform the step of determining the second gray scale value of the current pixel row.

[0017] Another technical solution adopted by the present application is to provide a moire elimination device, which comprises a processor and a memory, the processor and the memory are coupled, the memory stores program data, and the processor executes the program data in the memory to realize the steps in the method of any one of the above embodiments.

[0018] The present application has the following beneficial effects: due to the particularity of the moire, the characteristics of the pixel row where the moire is located are different from the overall characteristics of the image to be processed, therefore, according to the first gray value representing the overall gray of the image to be processed and the second gray value representing the overall gray of the current pixel row parallel to the extension direction of the moire, the pixel points of the current pixel row can be compensated for gray, and after the gray compensation of the current pixel row, the originally parallel arrangement of the strip-shaped moire is destroyed, so that the moire in the image to be processed can be accurately eliminated. BRIEF DESCRIPTION OF DRAWINGS

[0019] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings needed in the embodiment description will be briefly introduced as follows. Obviously, the drawings in the following description are only some embodiments of the present application, and other drawings can be obtained by those skilled in the art without creative labor.

[0020] Figure 1 is a flowchart of an embodiment of the moire elimination method of the present application;

[0021] Figure 2 is a structural schematic diagram of an embodiment of the image to be processed of the present application;

[0022] Figure 3 is Figure 1 is a flowchart of an embodiment of step S4 in the method;

[0023] Figure 4 is a structural schematic diagram of an embodiment of the rotation and marking processing of the image to be processed of the present application;

[0024] Figure 5 is Figure 1 is a flowchart of step S3 in the method;

[0025] Figure 6 is Figure 1 is a flowchart of another embodiment of step S4 in the method;

[0026] Figure 7 is Figure 1 is a flowchart of still another embodiment of step S4 in the method;

[0027] Figure 8 is a structural schematic diagram of an embodiment of the moire elimination device of the present application;

[0028] Figure 9 is a structural schematic diagram of another embodiment of the moire elimination device in the application;

[0029] Figure 10 is a structural schematic diagram of an embodiment of the computer readable storage medium in the application;

[0030] Reference signs: 1, the image to be processed; 2, moire; 3, valid area; 4, invalid area; 5, acquisition module; 6, processing module; 7, compensation module; 10, moire elimination device; 20, moire elimination device; 21, processor; 22, memory; 400, computer readable storage medium; 410, computer program. DETAILED DESCRIPTION

[0031] The technical solutions in the embodiments of the application will be clearly and completely described below with reference to the drawings in the embodiments of the application. Obviously, the described embodiments are only part of the embodiments of the application, rather than all the embodiments of the application. Based on the embodiments in the application, all other embodiments obtained by those skilled in the art without creative work fall within the scope of protection of the application.

[0032] At present, in the photosensitive element of a display panel, for example, a fingerprint acquisition device, moire phenomenon is caused due to the inconsistent periods of an imaging unit and a receiving unit. In addition, due to the inconsistent processing precision and process of the imaging unit and the receiving unit, there are problems of inconsistent periods, translation and rotation angle between the imaging unit array and the receiving unit array, and thus moire phenomenon is caused in the formed image. The moire affects the accuracy of the image obtained by the imaging unit, and further reduces the accuracy of the operation of the photosensitive element. The application eliminates the moire in the image by using the following method, so as to improve the operation precision of the photosensitive element.

[0033] Please refer to Figure 1 and Figure 2 The application provides a method for eliminating moire in an image, which comprises the following steps.

[0034] S1: acquiring an image to be processed 1, the image to be processed 1 comprising moire 2, and the moire 2 being strip-shaped moire.

[0035] In an embodiment, when the fingerprint is collected under the screen in a photosensitive element such as some fingerprint collection devices, due to the inconsistent arrangement period of the imaging unit (which can be an imaging pinhole for example) and the receiving unit (which can be an optical sensor for example), the collected fingerprint image contains moire 2. The moire 2 will interfere with the extraction of fingerprint features, increase the number of false features, and reduce the accuracy of fingerprint recognition. Therefore, removing the moire 2 is a very critical step in fingerprint recognition. As shown in practice, the moire 2 in the fingerprint image is mostly strip-shaped moire. Therefore, the purpose of the present application is to remove the strip-shaped moire 2 in the to-be-processed image 1.

[0036] It should be noted that the moire elimination method in the present application can also remove moire in other non-fingerprint images. In summary, the present application does not specifically limit the type of to-be-processed image 1, as long as it includes moire 2 and the moire 2 is strip-shaped moire.

[0037] S2: Determine the first gray value of the to-be-processed image 1, wherein the first gray value represents the overall gray value of the to-be-processed image. In an embodiment, the gray values of all pixel points in the to-be-processed image 1 can be obtained, and the first gray value can be determined by the gray values of all pixel points, so that the first gray value represents the overall gray value of the to-be-processed image 1, which can represent the overall features of the to-be-processed image 1.

[0038] In an embodiment, the step of determining the first gray value of the to-be-processed image 1 includes:

[0039] S21: Determine the gray average value of the to-be-processed image 1 to obtain the first gray value.

[0040] Specifically, the gray average value of all pixel points in the to-be-processed image 1 is obtained to obtain the first gray value.

[0041] In other embodiments, the first gray value can also be the mode, median, etc. of the gray values of all pixel points in the to-be-processed image 1. In summary, the present application does not limit the specific calculation process of the first gray value, as long as it can represent the overall gray value of the to-be-processed image 1.

[0042] S3: Determine the current pixel row in the to-be-processed image 1, and determine the second gray value of the current pixel row, wherein the second gray value represents the overall gray value of the pixel row, and the current pixel row is parallel to the extension direction of the moire 2.

[0043] In an embodiment, the to-be-processed image 1 is composed of a plurality of pixel groups arranged in an array. The to-be-processed image 1 is an image acquired by a photosensitive element, and the to-be-processed image 1 only has a gray value and is not a colorful image. Therefore, in a direction parallel to the extension direction of the moire 2, the to-be-processed image 1 has a plurality of pixel rows, each of which includes all pixel points in the same row, and the width of the pixel row is the same as the width of a single pixel point, and the arrangement direction of the plurality of pixel rows is the same as the arrangement direction of the moire 2. In other embodiments, a pixel row can also include all pixel points in adjacent multiple rows, for example, all pixel points in adjacent two rows or all pixel points in adjacent three rows, and the width of the pixel row will also increase accordingly. The extension direction of the current pixel row is parallel to the extension direction of the moire 2, for example, when the moire 2 extends along the horizontal direction in the to-be-processed image 1, the current pixel row also extends along the horizontal direction in the to-be-processed image 1, and when the moire 2 extends along the vertical direction in the to-be-processed image 1, the current pixel row also extends along the vertical direction in the to-be-processed image 1.

[0044] The gray values of the moire 2 in different pixel rows are different, and the gray values of the moire 2 in the same pixel row are also different. In the area where the pixel row with the moire 2 is located, in the direction perpendicular to the extension direction of the moire 2, that is, the arrangement direction of the moire 2, the gray values of the moire 2 on both sides are small, and the gray value of the moire 2 in the middle area is large. The gray value of the moire 2 in the middle area of the same pixel row is large, and the gray values on both sides are small. Therefore, in the elimination method, when the moire 2 in the pixel row is eliminated in parallel to the extension direction of the moire 2, the elimination effect is good.

[0045] Therefore, the current pixel row can be determined in the to-be-processed image 1 according to a preset strategy, for example, a pixel row with the same extension direction as the moire 2 is randomly determined in the to-be-processed image 1, and the pixel row is determined as the current pixel row, or a pixel row at a preset position and with the same extension direction as the moire 2 is determined as the current pixel row, or all pixel rows with the same extension direction as the moire 2 are sequentially determined as the current pixel row, and after each current pixel row is determined, all subsequent steps are performed for the current pixel row.

[0046] In the embodiment, the step of determining the second gray value of the current pixel row in step S3 includes:

[0047] S31: determining the gray average value of the current pixel row to obtain the second gray value of the current pixel row.

[0048] Specifically, the gray average value of all pixel points in the current pixel row is calculated to obtain the second gray value of the current pixel row.

[0049] In other embodiments, the mode or median of the gray scale values of the current pixel row can also be determined to obtain the second gray scale value of the current pixel row. That is, the second gray scale value can also be the mode or median of the gray scale values of all the pixels in the current pixel row. In the extension direction of the moire 2, the gray scale values on both sides of the moire 2 are smaller than the gray scale value at the middle position. Therefore, the mode or median of the gray scale values of the current pixel row can be selected as the second gray scale value, which can take into account the different gray scale values of the moire 2 in the current pixel row, and perform more fine compensation to eliminate the effect of the moire 2. In summary, the specific calculation process of the second gray scale value is not limited in the present application, as long as it can represent the overall gray scale value of the pixel row.

[0050] S4: performing gray scale compensation on the pixels in the current pixel row according to the first gray scale value and the second gray scale value.

[0051] In an embodiment, since the first gray scale value represents the overall gray scale of the to-be-processed image, and the second gray scale value represents the overall gray scale of the pixel row, the gray scale compensation is performed on the current pixel row according to the first gray scale value and the second gray scale value, which is beneficial to eliminate the gray scale influence of the moire 2 on the pixel row. After the compensation of the gray scale value of the pixel row, the originally parallel arrangement of the moire 2 is destroyed, thereby eliminating the moire 2 and accurately identifying the feature information in the fingerprint image, and eliminating the gray scale influence of the moire 2. For example, when the photosensitive element is an optical fingerprint sensor, the moire 2 in the fingerprint image can be removed by the elimination method in steps S1-S4, thereby obtaining a fingerprint image without the moire 2, effectively restoring the fingerprint information, greatly reducing the interference of the moire 2, improving the image quality, reducing the false recognition rate, and improving the accuracy of fingerprint recognition.

[0052] Specifically, before step S4, it further includes:

[0053] S41: determining whether the moire 2 exists in the current pixel row according to the first gray scale value and the second gray scale value.

[0054] Please refer to Figure 3 Because the moire 2 exists, the gray scale value of the pixel row where the moire 2 is located is different from the gray scale value in the entire to-be-processed image 1. Therefore, whether the moire 2 exists in the current pixel row can be determined according to the first gray scale value representing the overall gray scale of the to-be-processed image 1 and the second gray scale value representing the overall gray scale of the pixel row.

[0055] Specifically, S41 includes:

[0056] S411: in response to the second gray scale value being smaller than the first gray scale value, determining that the moire 2 exists in the current pixel row.

[0057] Specifically, considering that the gray value of the pixel row where the moire 2 is generally low, if the second gray value of the current pixel row is less than the first gray value, it is determined that the moire 2 exists in the current pixel row, otherwise it is determined that the moire 2 does not exist in the current pixel row.

[0058] Of course, in other embodiments, the standard for determining whether the moire 2 exists in the current pixel row can also be: in response to the second gray value being different from the first gray value, it is determined that the moire 2 exists in the current pixel row, that is, at this time, as long as it is determined that the second gray value is different from the first gray value, it is determined that the moire 2 exists in the current pixel row, otherwise it is determined that the moire 2 does not exist in the current pixel row.

[0059] Or it can also be: in response to the second gray value being less than the first gray value and the absolute difference between the second gray value and the first gray value being greater than a difference threshold, it is determined that the moire 2 exists in the current pixel row, otherwise it is determined that the moire 2 does not exist in the current pixel row. The difference threshold can be set according to actual needs, which is not limited here.

[0060] S42: If the moire exists, performing the step of performing gray compensation on the pixel points of the current pixel row according to the first gray value and the second gray value.

[0061] Specifically, if it is determined that the moire 2 exists in the current pixel row, the gray value of the pixel points in the current pixel row is adjusted to perform gray compensation on the pixel points in the current pixel row. By performing gray compensation on the current pixel row where the moire 2 exists, the influence of the moire on the gray value in the current pixel row is eliminated, and the purpose of removing the moire is achieved.

[0062] Please refer to Figure 6 , wherein the step of performing gray compensation on the pixel points of the current pixel row in S42 comprises:

[0063] S421: calculating the difference between the first gray value and the second gray value;

[0064] Specifically, let the first gray value be A and the second gray value be B, then the difference between the first gray value and the second gray value is equal to (A-B).

[0065] S422: performing gray compensation on the pixel points of the current pixel row according to the difference;

[0066] In an application scenario, S422 comprises:

[0067] S4221: compensating the gray value of the pixel points in the current pixel row by the difference.

[0068] Specifically, at this time, for the pixel points in the current pixel row, the difference calculated above is added to their gray values, so as to achieve the purpose of gray compensation.

[0069] In other embodiments, the process of step S422 can further include: determining the correspondence between the difference value and the compensation value in advance, for example, when the difference value is within a first preset range, the corresponding compensation value is a first compensation value; when the difference value is within a second preset range, the corresponding compensation value is a second compensation value; and when it is determined that the pixels in the current pixel row need to be compensated, determining the preset range in which the difference value is located, and compensating the pixels in the current pixel row using the compensation value corresponding to the preset range.

[0070] Or in other embodiments, step S42 can also not compensate the gray value of the pixels in the current pixel row according to the difference value. For example, if it is judged that the second gray value is less than the first gray value, a fixed value is used to compensate the gray value of the pixels in the pixel row, which can be set according to the needs, and is not limited here.

[0071] In the present embodiment, in step S42, if it is determined that the moire 2 exists in the current pixel row, the step of compensating the gray value of the pixels in the current pixel row includes:

[0072] S43: If it is determined that the moire 2 exists in the current pixel row, the gray value of each pixel in the current pixel row is compensated.

[0073] Specifically, when it is determined that the moire 2 exists in the current pixel row, the gray value of each pixel in the current pixel row is compensated, so that all the pixels in the current pixel row are compensated to eliminate the influence of the reduced gray value caused by the moire 2.

[0074] In other embodiments, the gray value of each pixel in the pixel row can not be compensated, for example, the pixels in the current pixel row are sorted according to the gray value, and then the pixels with lower gray value are selected for gray value compensation, which increases the pertinence of compensation for the pixels with lower gray value. Or, the pixels in the current pixel row with gray value lower than a preset range are compensated, and the pixels with gray value within a certain range are compensated, which focuses on improving the average gray value of the current pixel row and weakening or even eliminating the influence of the moire. In summary, the compensation methods are various, and the corresponding compensation method can be selected according to the compensation needs or the type of image, or the compensation can be performed according to the desired effect, and the compensation method is not limited thereto.

[0075] Please continue to refer to Figure 2 , refer to Figure 4 and Figure 5 , before step S3, further comprising:

[0076] S32: Obtain the inclination angle of the moire 2.

[0077] Specifically, as shown in Figure 2 The inclination angle θ of the moire 2 refers to the included angle between the extension direction of the moire 2 and the side of the image to be processed 1.

[0078] In an application scenario, the inclination angle θ of the moire 2 specifically refers to the included angle between the extension direction of the moire 2 and the side of the image to be processed 1 extending in the horizontal direction. In another application scenario, the inclination angle θ of the moire 2 can also specifically refer to the included angle between the extension direction of the moire 2 and the side of the image to be processed 1 extending in the vertical direction. However, for ease of description, in combination with Figure 2 , the inclination angle θ of the moire 2 is specifically taken as an example of the included angle between the extension direction of the moire 2 and the side of the image to be processed 1 extending in the horizontal direction.

[0079] S33: Rotating the image to be processed 1 according to the inclination angle for the first time, so that the moire 2 extends along the horizontal direction or the vertical direction.

[0080] Specifically, after determining the inclination angle θ, the image to be processed 1 is rotated according to the inclination angle θ, so that the moire 2 extends along the horizontal direction or the vertical direction. For ease of description, this rotation is defined as the first rotation.

[0081] By the above rotation, the moire 2 extends along the horizontal direction or the vertical direction, so that the pixel row extending along the horizontal direction or the vertical direction can be determined as the current pixel row, thereby improving the processing efficiency.

[0082] Correspondingly, after the first rotation and the gray compensation of the image to be processed 1, the first processed image is obtained, and after step S4, the method further comprises:

[0083] S34: Rotating the first processed image according to the inclination angle for the second time, wherein the direction of the second rotation of the first processed image is opposite to the direction of the first rotation of the image to be processed.

[0084] Specifically, since the image to be processed 1 is rotated for the first time before compensation, the first processed image obtained after compensation needs to be rotated for the second time. Since the direction of the second rotation of the first processed image is opposite to the direction of the first rotation of the image to be processed, the angle of the image to be processed 1 before compensation and the first processed image after compensation is the same.

[0085] It can be understood that if the image to be processed 1 is rotated clockwise for the first time, the first processed image is rotated counterclockwise for the second time.

[0086] After the first rotation of the image to be processed 1 according to the tilt angle so that the moire 2 extends along the horizontal direction or the vertical direction, the method further comprises:

[0087] S331: performing a marking process on the outer periphery of the image to be processed 1 to make the marked image to be processed 1 rectangular, wherein for the marked image to be processed 1, the other regions outside the invalid region 4 are defined as the valid region 3.

[0088] Please continue to refer to Figure 4 , by marking the outer periphery of the image to be processed 1 to make the marked image to be processed 1 rectangular, it is beneficial to subsequent positioning of the pixel row in the image to be processed 1. Wherein for the marked image to be processed 1, the other regions outside the invalid region 4 are defined as the valid region 3, that is, for the image after marking, it is composed of the invalid region 4 and the valid region 3.

[0089] At this time, the step of determining the current pixel row in the image to be processed 1 further comprises:

[0090] S332: determining the current pixel row in the valid region 3 of the image to be processed 1.

[0091] Specifically, since the invalid region has no valid pixel points, and the gray values of the pixel points in the invalid region and the valid region are obviously different, only determining the current pixel row in the valid region 3 can avoid introducing the gray value of the invalid region 4 in the calculation process, so that the calculation result is accurate and the gray compensation effect in the image is guaranteed.

[0092] At this time, after the second rotation of the image after the first processing according to the tilt angle, further comprising:

[0093] S341: removing the invalid region 4 in the image after the first processing.

[0094] After the gray compensation of the pixel points in the current pixel row, the image after the first processing is rotated a second time according to the tilt angle so that the image display of the image after the first processing is consistent with the direction of the original image to be processed 1, and after removing the invalid region 4 in the image after the first processing, only the valid region 3 is retained, and the processed image obtained is rectangular.

[0095] In step S331, the step of performing a marking process on the outer periphery of the image to be processed 1 to make the marked image to be processed 1 rectangular, comprises:

[0096] S3311: setting the gray value of the pixel points in the invalid region 4 to a target gray value, wherein the target gray value is different from the gray value of any pixel point in the image to be processed.

[0097] The gray value of the pixel in the invalid region 4 is set as the target gray value, and since the target gray value is different from the gray value of any pixel in the image to be processed, the valid region 3 and the invalid region 4 in the image to be processed can be distinguished. When the current pixel row in the image is compensated, only the valid region is compensated, and the invalid region is not compensated. In an embodiment, the gray value of the pixel in the valid region 3 is greater than 0, and by setting the gray value of the pixel in the invalid region 4 as 0, the invalid region 4 is not compensated in the compensation process, thereby effectively improving the compensation efficiency and the compensation effect.

[0098] Referring to Figure 7 In step S4, after the step of compensating the pixels in the current pixel row, the method further comprises:

[0099] S44: determining whether there is a pixel row in the image to be processed 1 which is not the current pixel row;

[0100] S45: if there is, determining the pixel row which is not the current pixel row as the current pixel row, and returning to execute the step of determining the second gray value of the current pixel row.

[0101] Specifically, if there is a pixel row in the image to be processed 1 which is not the current pixel row, it means that all the pixel rows with the same extension direction as the moire 2 have not been traversed, and the pixel row which is not the current pixel row is determined as the current pixel row, and the above process is repeated for the pixel row.

[0102] That is, all the pixel rows with the same extension direction as the moire 2 can be traversed by the above method, and in the traversal process, the above process is repeated for each pixel row with the same extension direction as the moire 2.

[0103] It should be noted that in other embodiments, only part of the pixel rows with the same extension direction as the moire 2 in the image to be processed 1 can be determined as the current pixel row in turn.

[0104] Referring to Figure 8In an embodiment, the moire elimination device 10 comprises a obtaining module 5, a processing module 6 and a compensation module 7 connected in sequence. The obtaining module 5 is configured to obtain a to-be-processed image, the to-be-processed image comprising a moire, and the moire is a strip-shaped moire. The processing module 6 is configured to determine a first gray value of the to-be-processed image, wherein the first gray value represents the overall gray value of the to-be-processed image; determine a current pixel row in the to-be-processed image, and determine a second gray value of the current pixel row, wherein the second gray value represents the overall gray value of the pixel row, and the current pixel row is parallel to the extension direction of the moire; determine whether the moire exists in the current pixel row according to the first gray value and the second gray value; and the compensation module 7 is configured to perform gray compensation on the pixel points of the current pixel row in which the moire exists.

[0105] The moire elimination device 10 executes the method steps in any of the above embodiments when working, and the detailed method steps can be referred to the above related content, which will not be repeated here.

[0106] The moire elimination device 10 can be a mobile phone, a computer or any other device with algorithm processing capability, which is not limited here.

[0107] Please refer to Figure 9 In another embodiment, the moire elimination device 20 comprises a memory 22 and a processor 21, the processor 21 and the memory 22 are coupled, the memory 22 stores program data, and the processor 21 executes the program data in the memory 22 to realize the steps in the method described in any of the above embodiments.

[0108] The moire elimination device 20 executes the method steps in any of the above embodiments when working, and the detailed method steps can be referred to the above related content, which will not be repeated here.

[0109] The moire elimination device 20 can be a mobile phone, a computer or any other device with algorithm processing capability, which is not limited here.

[0110] Please refer to Figure 10 , Figure 10 is a structural schematic diagram of an embodiment of the computer readable storage medium of the present application. The computer readable storage medium 400 stores a computer program 410, and the computer program 410 can be executed by a processor to realize the steps in any of the above methods.

[0111] The computer readable storage medium 400 can be a U disk, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk, or any device capable of storing the computer program 410, or a server storing the computer program 410, which can send the stored computer program 410 to other devices for running, or can run the stored computer program 410.

[0112] The above is only an embodiment of the present application, and does not limit the patent scope of the present application. Any equivalent structure or equivalent process transformation, or direct or indirect application in other related technical fields, which is made by using the content of the specification and drawings of the present application, is also included in the patent protection scope of the present application.

Claims

1. A method of eliminating moire in an image, characterized by, The method comprises the following steps: acquiring a to-be-processed image, wherein the to-be-processed image comprises moire patterns, and the moire patterns are strip-shaped moire patterns; determining a first gray value of the to-be-processed image, wherein the first gray value represents the overall gray value of the to-be-processed image; determining a current pixel row in the to-be-processed image, and determining a second gray value of the current pixel row, wherein the second gray value represents the overall gray value of the pixel row, and the current pixel row is parallel to the extension direction of the moire patterns; performing gray compensation on the pixel points of the current pixel row according to the first gray value and the second gray value; before the step of determining the current pixel row in the to-be-processed image, the method further comprises the following steps: acquiring an inclination angle of the moire patterns; rotating the to-be-processed image for the first time according to the inclination angle, so that the moire patterns extend along the horizontal direction or the vertical direction; after the step of performing gray compensation on the pixel points of the current pixel row, the method further comprises the following steps: rotating the image processed for the first time for the second time according to the inclination angle, wherein the direction of rotating the image processed for the first time for the second time is opposite to the direction of rotating the to-be-processed image for the first time.

2. The cancellation method as claimed in claim 1, characterized in that before the step of performing gray compensation on the pixel points of the current pixel row according to the first gray value and the second gray value, the method further comprises the following steps: determining whether the moire patterns exist in the current pixel row according to the first gray value and the second gray value; if the moire patterns exist, performing the step of performing gray compensation on the pixel points of the current pixel row according to the first gray value and the second gray value.

3. The cancellation method as claimed in claim 2, characterized in that The step of determining whether the moire patterns exist in the current pixel row according to the first gray value and the second gray value comprises the following step: in response to the second gray value being smaller than the first gray value, it is determined that the moire patterns exist in the current pixel row.

4. The cancellation method as claimed in claim 1, characterized in that The step of performing gray compensation on the pixel points of the current pixel row comprises the following steps: calculating the difference between the first gray value and the second gray value; performing gray compensation on the pixel points of the current pixel row according to the difference.

5. The cancellation method as claimed in claim 4, characterized in that The step of performing gray compensation on the pixel points of the current pixel row according to the difference comprises the following step: compensating the gray values of the pixel points of the current pixel row by the difference.

6. The cancellation method as claimed in claim 1, characterized in that The step of determining the first gray value of the to-be-processed image comprises the following step: determining the average gray value of the to-be-processed image to obtain the first gray value. The step of determining the second gray value of the current pixel row comprises the following steps: determining the average gray value of the current pixel row to obtain the second gray value of the current pixel row; or, determining the mode or the median of the gray values of the current pixel row to obtain the second gray value of the current pixel row.

7. The cancellation method as claimed in claim 1, characterized in that, after the step of rotating the to-be-processed image for the first time according to the inclination angle, so that the moire patterns extend along the horizontal direction or the vertical direction, the method further comprises the following steps: The step of marking an invalid region on the periphery of the image to be processed so that the marked image to be processed is a rectangle, wherein, for the marked image to be processed, the region other than the invalid region is defined as a valid region; The step of determining the current pixel row in the image to be processed comprises: Determining the current pixel row in the valid region of the image to be processed; After the step of rotating the image after the first processing according to the tilt angle for the second time, further comprising: Removing the invalid region in the image after the first processing.

8. The elimination method according to claim 7, wherein The step of marking an invalid region on the periphery of the image to be processed comprises: Setting the gray value of the pixel in the invalid region to a target gray value, wherein the target gray value is different from the gray value of any pixel in the image to be processed.

9. The elimination method according to claim 1, wherein After the step of compensating the gray value of the pixel in the current pixel row, further comprising: Determining whether there is a pixel row which is not the current pixel row in the image to be processed; If there is, determining the pixel row which is not the current pixel row as the current pixel row, and returning to the step of determining the second gray value of the current pixel row.

10. A moire elimination device characterized by comprising: A device comprising a processor and a memory, the processor and the memory are coupled, the memory stores program data, and the processor implements the steps in the method according to any one of claims 1-9 by executing the program data in the memory.

Citation Information

Patent Citations

  • Brightness compensation method, chip, device, equipment and storage medium

    CN112542137A