Image correction method, device, electronic device and storage medium

By acquiring the average brightness and brightness curves of each pixel column of the image, determining the acquisition quality and performing targeted corrections, the problem of low image acquisition quality when equipment abnormalities is solved, and image quality and processing efficiency are improved.

CN119671916BActive Publication Date: 2025-08-22BEIJING HONEST TECHNOLOGY CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202411741845.6
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-11-29
Publication Date
2025-08-22
Estimated Expiration
2044-11-29

AI Technical Summary

Technical Problem

When the equipment is abnormal, the low image acquisition quality leads to the inability to effectively detect, identify and classify materials, resulting in stagnation of the production line.

Method used

By acquiring the average brightness of each pixel column of the image to be processed, the acquisition quality is determined, and targeted corrections are performed based on the brightness curve and target correction parameters.

Benefits of technology

Improve image quality, ensure the efficiency and accuracy of subsequent processing, and avoid low image quality caused by ineffective correction in abnormal situations.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119671916B_ABST
    Figure CN119671916B_ABST
Patent Text Reader

Abstract

The present disclosure relates to the field of image processing technology, and in particular to an image correction method, device, electronic device, and storage medium. The image correction method includes: acquiring an image to be processed, the image to be processed including a plurality of pixel columns; determining the acquisition quality of the image to be processed based on the average brightness of each pixel column; determining the brightness curve of the image to be processed based on the average brightness of each pixel column; in response to an abnormal acquisition quality, determining a target correction parameter corresponding to the acquisition quality of the image to be processed based on the brightness curve; and correcting the image to be processed based on the target correction parameter to obtain a first target image. When the acquisition quality is abnormal, the brightness of the image to be processed can be targetedly corrected to improve the acquisition quality of the image to be processed, thereby improving the processing efficiency when the image to be processed is subsequently processed.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of image processing technology, and in particular to an image correction method, an image correction device, an electronic device, and a computer-readable storage medium. Background Art

[0002] During the production process, images are captured to detect, identify, and classify the materials being transported. Related technologies improve the quality of captured images during normal equipment operation by correcting and enhancing them, thereby enhancing processing accuracy during subsequent detection, identification, and classification. However, when equipment malfunctions, low image quality can prevent the effective detection, identification, and classification of materials, potentially leading to production line stalls and interruptions. Summary of the Invention

[0003] To overcome the problems existing in the related art, an exemplary embodiment of the present disclosure provides an image correction method, including: acquiring an image to be processed, the image to be processed including multiple pixel columns; determining the acquisition quality of the image to be processed based on the average brightness of each pixel column; determining a brightness curve of the image to be processed based on the average brightness of each pixel column; in response to abnormal acquisition quality, determining a target correction parameter corresponding to the acquisition quality of the image to be processed based on the brightness curve; and correcting the image to be processed based on the target correction parameter to obtain a first target image.

[0004] In some embodiments, the acquisition quality of the image to be processed is determined based on the average brightness of each pixel column, including: determining a baseline average brightness corresponding to the pixel column; comparing the average brightness of the pixel column with the baseline average brightness to obtain a comparison result; determining the pixel brightness state of the pixel column according to the comparison result; and determining the acquisition quality of the image to be processed based on the pixel brightness state of the pixel column.

[0005] In some embodiments, the pixel brightness state of a pixel column is determined based on a comparison result, including: in response to the comparison result indicating that the difference between the average brightness and the benchmark average brightness is not within a specified threshold range, determining that the pixel brightness state of the pixel column is abnormal; based on the historical pixel brightness state corresponding to the pixel column, counting the consecutive cumulative number of times that the pixel brightness state of the pixel column is abnormal, the historical pixel brightness state is determined based on at least one historical image to be processed, and the acquisition interval between the previous image to be processed and the next image to be processed specifies a step size; and in response to the consecutive cumulative number being greater than or equal to a specified number threshold, determining that the pixel brightness state of the pixel column is abnormal and sending an abnormal alarm; in response to the comparison result indicating that the difference between the average brightness and the benchmark average brightness is within a specified threshold range, determining that the pixel brightness of the pixel column is normal.

[0006] In some embodiments, the acquisition quality of the image to be processed is determined based on the pixel brightness status of the pixel column, including: if the pixel brightness status of the pixel column is abnormal, then determining the acquisition quality of the image to be processed is abnormal; if the pixel brightness status of the pixel column is normal, then determining the pixel brightness status of other pixel columns, and determining the acquisition quality of the image to be processed based on the pixel brightness status of other pixel columns.

[0007] In some embodiments, the acquisition quality of the image to be processed is determined based on the pixel brightness status of other pixel columns, including: in response to the existence of at least one pixel column with an abnormal pixel brightness status in other pixel columns, determining that the acquisition quality of the image to be processed is abnormal; in response to the absence of a pixel column with an abnormal pixel brightness status in other pixel columns, determining that the acquisition quality of the image to be processed is normal.

[0008] In some embodiments, determining a reference average brightness corresponding to a pixel column includes: acquiring a reference pixel image; and determining a reference average brightness corresponding to the pixel column based on the pixel brightness of each pixel in the pixel column in the reference pixel image.

[0009] In some embodiments, based on the brightness curve, a target correction parameter corresponding to the acquisition quality of the image to be processed is determined, including: matching the brightness curve with a plurality of preset abnormal brightness curves to obtain a first matching result; in response to the first matching result characterizing that there is a first target brightness curve that matches the brightness curve among the plurality of abnormal brightness curves, a first target correction parameter corresponding to the first target brightness curve is determined based on a first corresponding relationship between the preset abnormal brightness curve and the correction parameter, and the first target correction parameter is used as the target correction parameter corresponding to the acquisition quality of the image to be processed.

[0010] In some embodiments, based on the brightness curve, determining the target correction parameter corresponding to the acquisition quality of the image to be processed also includes: in response to the first matching result characterizing that there is no first target brightness curve matching the brightness curve among multiple abnormal brightness curves, taking the abnormal brightness curve with the highest matching degree among the multiple abnormal brightness curves as the second target brightness curve; based on the first corresponding relationship, determining the second target correction parameter corresponding to the second target brightness curve, and taking the second target correction parameter as the target correction parameter corresponding to the acquisition quality of the image to be processed.

[0011] In some embodiments, the target correction parameters include multiple flattening parameters and stretching parameters, and the flattening parameters correspond one-to-one to the pixel columns; based on the target correction parameters, the image to be processed is corrected to obtain a first target image, including: determining the maximum average brightness based on the average brightness of each pixel column; based on the maximum average brightness and each flattening parameter, respectively correcting the average brightness of each pixel column to obtain the corrected average brightness of each pixel column; based on the stretching parameters, respectively correcting the pixel brightness of each pixel in the image to be processed to obtain the corrected pixel brightness of each pixel; based on the corrected average brightness of each pixel column and the corrected pixel brightness of each pixel, the first target image is obtained.

[0012] In some embodiments, based on the brightness curve, the target correction parameters corresponding to the acquisition quality of the image to be processed are determined, and the method also includes: saving the average brightness and brightness curve of each pixel column, determining the correction parameters corresponding to the brightness curve based on the average brightness and brightness curve of each pixel column, and updating the first corresponding relationship based on the brightness curve and the corresponding correction parameters.

[0013] In some embodiments, after acquiring the image to be processed, the method further includes: segmenting the image to be processed to determine a foreground area image in the image to be processed; and determining an average brightness of each pixel column based on the pixel brightness of each pixel in the foreground area image.

[0014] In some embodiments, based on the pixel brightness of each pixel in the foreground area image, the average brightness of each pixel column is determined separately, including: performing brightness corrosion processing on the foreground area image to obtain an updated foreground area image; and determining the average brightness of the pixel column based on the pixel brightness of each pixel in the pixel column in the updated foreground area image.

[0015] In some embodiments, the method further includes: in response to the acquisition quality being normal, matching the brightness curve with a plurality of preset normal brightness curves to obtain a second matching result; in response to the second matching result indicating that there is a second target brightness curve that matches the brightness curve in the plurality of normal brightness curves, determining a third target correction parameter corresponding to the second target brightness curve based on a second correspondence between the preset normal brightness curve and the correction parameter; and correcting the image to be processed based on the third target correction parameter to obtain a second target image.

[0016] In a second aspect, the present disclosure also provides an image correction device, including: an acquisition module for acquiring an image to be processed, the image to be processed including multiple pixel columns; a first processing module for determining the acquisition quality of the image to be processed based on the average brightness of each pixel column; a second processing module for determining the brightness curve of the image to be processed based on the average brightness of each pixel column; a third processing module for determining, in response to abnormal acquisition quality, target correction parameters corresponding to the acquisition quality of the image to be processed based on the brightness curve; and a first correction module for correcting the image to be processed based on the target correction parameters to obtain a first target image.

[0017] In a third aspect, the present disclosure further provides an electronic device comprising: a memory and a processor, the memory and the processor being communicatively connected to each other, the memory storing computer instructions, and the processor executing the image correction method provided in any one of the above aspects by executing the computer instructions.

[0018] In a fourth aspect, the present disclosure further provides a computer-readable storage medium, which stores the following program, and the program is used to execute the image correction method provided by any of the above aspects.

[0019] It is to be understood that the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the disclosure.

[0020] The technical solutions provided by the embodiments of the present disclosure may include the following beneficial effects: According to the image correction method provided by the present disclosure, the acquisition quality of the image to be processed is determined based on the average brightness of each pixel column in the image to be processed, and it is possible to quickly identify whether the image to be processed is affected by the light source or the environment in which it is located during the image acquisition process, thereby avoiding the problem of using the original correction method under abnormal circumstances, which may result in the corrected image not being able to meet the requirements of subsequent recognition and classification processing. Moreover, in the case where it is determined that the acquisition quality is abnormal, based on the brightness curve of the image to be processed, the target correction parameters that match the image acquisition situation are determined to perform brightness correction, which can make the correction process more targeted and effective, thereby effectively improving the image quality, ensuring the clarity of the image, laying a good foundation for subsequent image processing work, and ensuring the efficiency and accuracy of image processing. BRIEF DESCRIPTION OF THE DRAWINGS

[0021] The present invention may be better understood by describing exemplary embodiments of the present invention in conjunction with the accompanying drawings, in which:

[0022] Figure 1 This is a flow chart of an image correction method according to an exemplary embodiment of the present disclosure;

[0023] Figure 2This is a flow chart of another image correction method according to an exemplary embodiment of the present disclosure;

[0024] Figure 3 The figure is a flowchart of another image correction method according to an exemplary embodiment of the present disclosure.

[0025] Figure 4 This is a flow chart of another image correction method according to an exemplary embodiment of the present disclosure;

[0026] Figure 5 This is a flow chart of an image correction method according to another exemplary embodiment of the present disclosure;

[0027] Figure 6 The figure is a flowchart of another image correction method shown in another exemplary embodiment of the present disclosure.

[0028] Figure 7 This is a schematic structural diagram of an image correction device according to an exemplary embodiment of the present disclosure;

[0029] Figure 8 It is a schematic structural diagram of an electronic device shown in an exemplary embodiment of the present disclosure. DETAILED DESCRIPTION

[0030] The specific embodiments of the present invention will be described below. It should be noted that in the specific description of these embodiments, in order to provide a concise description, this specification cannot provide a detailed description of all the features of the actual embodiments. It should be understood that in the actual implementation of any embodiment, just as in the process of any engineering project or design project, in order to achieve the specific goals of the developer and to meet system-related or business-related restrictions, various specific decisions are often made, and this will also change from one embodiment to another. In addition, it can also be understood that although the efforts made in this development process may be complex and lengthy, for ordinary technicians in the field related to the content disclosed by the present invention, some design, manufacturing or production changes based on the technical content disclosed in this disclosure are just conventional technical means and should not be understood as the content of this disclosure being insufficient.

[0031] Unless otherwise defined, the technical or scientific terms used in the claims and description shall have the usual meaning understood by persons of ordinary skill in the technical field to which the invention belongs. The words "first", "second" and similar terms used in the description and claims of the patent application of the present invention do not indicate any order, quantity or importance, but are only used to distinguish different components. Words such as "one" or "a" do not indicate a quantity limitation, but rather indicate the existence of at least one. Words such as "include" or "comprising" mean that the elements or objects appearing before "include" or "comprising" cover the elements or objects listed after "include" or "comprising" and their equivalent elements, and do not exclude other elements or objects. Words such as "connected" or "connected" and similar terms are not limited to physical or mechanical connections, nor are they limited to direct or indirect connections.

[0032] During the material production process, the currently transmitted materials are inspected, identified and classified through image acquisition.

[0033] In related technologies, during normal equipment operation, the quality of captured images is improved by correcting and enhancing them, thereby enhancing processing accuracy during subsequent detection, identification, and classification. However, when the equipment's lighting device or the environment in which it is located experiences an anomaly, the light source assisting image acquisition will dim, affecting the image acquisition quality. Using existing correction methods in this state will result in low-quality images after correction, which in turn makes it impossible to effectively identify and classify produced materials, which can easily lead to production line stagnation and interrupt the production process.

[0034] To solve the above problems, an exemplary embodiment of the present disclosure provides an image correction method, which can judge the acquisition quality of the image to be processed based on the average brightness of each pixel column, so that when the acquisition quality is abnormal, the brightness of the image to be processed can be corrected in a targeted manner, thereby improving the acquisition quality of the image to be processed, thereby improving the processing efficiency when the image to be processed is subsequently processed.

[0035] like Figure 1 As shown, the image correction method may include the following steps S110 to S150:

[0036] Step S110: obtaining an image to be processed.

[0037] During the image acquisition process, pixels from multiple pixel columns are collected row by row, and as the acquisition time varies, an image to be processed is generated. The image to be processed includes multiple pixel columns, each containing the same number of pixels. The number of pixel columns can be determined based on the corresponding image acquisition device. For example, the image to be processed can be composed of pixels from 1024 pixel columns. The image to be processed can be understood as an image captured by the image acquisition device during the actual operation of the material equipment.

[0038] In some implementations, the image to be processed can be obtained by capturing images of materials currently being transmitted by an image acquisition device during the operation of a material sorting machine. The materials may include, but are not limited to, ore, cotton, plastic, metal, etc., and the specific materials can be determined based on the actual production line.

[0039] In other implementation scenarios, the image to be processed may also be an image collected by the endoscope during its movement within the body.

[0040] Step S120 : determining the acquisition quality of the image to be processed based on the average brightness of each pixel column.

[0041] For any pixel column, the average brightness of the pixel column can be determined according to the brightness and number of each pixel in the pixel column.

[0042] The average brightness of each pixel column can be used to determine the brightness of each pixel column, and then it can be determined whether the brightness or environment has changed during the image acquisition process, thereby determining whether the acquisition quality of the image to be processed is abnormal. For example, if the average brightness of the pixel column is too low, it may be due to insufficient light source or environmental changes, and then it can be determined that the acquisition quality of the image to be processed is abnormal. Alternatively, if the average brightness of the pixel column is too high, it may be due to overexposure or an overly strong light source, and then it can be determined that the acquisition quality of the image to be processed is abnormal. If the average brightness of the pixel column is relatively stable and close to the expected brightness level, it may be that the image acquisition was performed under normal light source, and then it can be determined that the acquisition quality of the image to be processed is normal.

[0043] Step S130 : determining a brightness curve of the image to be processed based on the average brightness of each pixel column.

[0044] Based on the average brightness of each pixel column and the order of each pixel column in the image to be processed, a brightness curve for the image to be processed is determined. This brightness curve is then used to analyze the brightness distribution of the image to be processed. For example, a smooth brightness curve without obvious peaks or valleys indicates a uniform brightness distribution in the image to be processed. Significant fluctuations in the brightness curve may indicate uneven brightness or exposure issues in the image to be processed.

[0045] In some optional implementation scenarios, if a brightness curve is to be displayed on a display device, the horizontal axis of the brightness curve is the order in which the pixels are arranged, and the vertical axis is the average brightness of the pixels. The curve formed by connecting the discrete average brightness values ​​is the brightness curve.

[0046] Step S140 : In response to the acquisition quality being abnormal, a target correction parameter corresponding to the acquisition quality of the image to be processed is determined based on the brightness curve.

[0047] Abnormal acquisition quality indicates an abnormality in the light source or environment during image acquisition. To ensure the reliability of brightness correction, target correction parameters are determined based on the brightness curve to address this abnormality. This improves the effectiveness of subsequent brightness correction and enhances image quality.

[0048] Step S150 : Correcting the brightness of the image to be processed based on the target correction parameter to obtain a first target image.

[0049] Through the target correction parameters, targeted adjustments can be made based on the average brightness of each pixel column and the brightness of each pixel in the image to be processed to reduce or eliminate the brightness impact caused by the light source or the environment in which the image is acquired, so that the brightness distribution of the corrected first target image is more in line with expectations, and the image content is clearer and more natural, thereby achieving the purpose of improving image quality.

[0050] In some examples, when performing brightness correction based on target correction parameters, the image being processed can be locally corrected, meaning only pixel columns with abnormal average brightness are corrected, thereby saving correction time and improving correction efficiency. In other examples, when performing brightness correction based on target correction parameters, the image being processed can be globally corrected, meaning brightness correction is performed on each pixel column to ensure overall brightness consistency and quality.

[0051] According to the image correction method provided by the present disclosure, the acquisition quality of the image to be processed is determined based on the average brightness of each pixel column in the image to be processed. This method can quickly identify whether the image to be processed is affected by the light source or the environment in which it is located during the image acquisition process, thereby avoiding the problem of using the original correction method under abnormal circumstances, which may result in the corrected image not meeting the requirements for subsequent recognition and classification processing. Moreover, when it is determined that the acquisition quality is abnormal, based on the brightness curve of the image to be processed, the target correction parameters that match the image acquisition situation are determined to perform brightness correction, which can make the correction process more targeted and effective, thereby effectively improving image quality and ensuring image clarity, laying a good foundation for subsequent image processing work, and ensuring the efficiency and accuracy of image processing.

[0052] In some embodiments, as Figure 2 As shown, the above step S120 may include:

[0053] Step S121 , determining a reference average brightness corresponding to a pixel column.

[0054] The baseline average brightness can be understood as the average brightness reference value corresponding to a pixel column under ideal conditions. By determining the baseline average brightness corresponding to a pixel column, it is possible to determine whether there are any abnormalities in the average brightness of the pixel column during the actual acquisition process.

[0055] In some examples, step S121 includes:

[0056] Step a1, obtaining a reference pixel image;

[0057] Step a2: determining a reference average brightness corresponding to a pixel column based on the pixel brightness of each pixel in the pixel column in the reference pixel image.

[0058] Specifically, the reference pixel image can be understood as an image captured by a material device when transporting a target object under ideal conditions. Because the reference pixel image is captured under ideal conditions, the brightness corresponding to each pixel in the reference pixel image can be understood as the pixel brightness. Furthermore, for any pixel column in the reference pixel image, the reference average brightness corresponding to that pixel column can be determined based on the brightness of each pixel in that pixel column and the number of pixels in that pixel column.

[0059] In some examples, to improve the reliability of the baseline average brightness, after obtaining the baseline pixel image, the baseline pixel image may be subjected to regional segmentation processing to distinguish the foreground and background regions of the baseline pixel image, thereby obtaining a foreground region image of the baseline pixel image and eliminating interference from the background region's pixel brightness on the baseline average brightness. Based on the pixel brightness and number of pixels corresponding to each pixel column in the foreground region image of the baseline pixel image, the baseline average brightness corresponding to each pixel column is determined, thereby effectively improving the accuracy of determining the baseline average brightness.

[0060] In other examples, in order to enhance the accuracy of determining the baseline average brightness, after obtaining the foreground area image of the baseline pixel image, brightness corrosion processing can be performed on pixels with abnormal brightness in the foreground area image of the baseline pixel image, so that the brightness of the pixel can smoothly transition with the brightness of adjacent pixels, making the brightness distribution of the foreground area image more uniform, thereby determining the baseline average brightness corresponding to each pixel column based on the corrected foreground area image of the baseline pixel image, which can be more accurate and reliable.

[0061] Step S122 : comparing the average brightness of the pixel column with the reference average brightness to obtain a comparison result.

[0062] The average brightness of the pixel column is compared with its reference average brightness to determine the difference between the average brightness and the reference brightness, thereby obtaining a comparison result.

[0063] Step S123: Determine the pixel brightness state of the pixel column according to the comparison result.

[0064] The baseline average brightness is used to measure whether the average brightness of a pixel column is within a normal range. Therefore, based on the comparison result, it is possible to determine whether the pixel brightness of that pixel column is normal. For example, if the comparison result indicates a large difference between the average brightness and the baseline average brightness, then the average brightness of the pixel column is abnormal, and the pixel brightness of the pixel column can be determined to be abnormal. If the comparison result indicates a small difference between the average brightness and the baseline average brightness, then the average brightness of the pixel column is relatively normal, and the pixel brightness of the pixel column can be determined to be normal.

[0065] In some examples, step S123 may include:

[0066] Step b1, in response to the comparison result indicating that the difference between the average brightness and the reference average brightness is not within a specified threshold range, determining that the pixel brightness state of the pixel column is abnormal;

[0067] Step b2, counting the continuous cumulative number of times the pixel brightness state of the pixel column is abnormal based on the historical pixel brightness state corresponding to the pixel column; and

[0068] Step b3: in response to the continuous cumulative number being greater than or equal to a specified number threshold, determining that the pixel brightness state of the pixel column is abnormal and sending an abnormality alarm;

[0069] Step b4: in response to the comparison result indicating that the difference between the average brightness and the reference average brightness is within a specified threshold range, determining that the pixel brightness of the pixel column is normal.

[0070] Specifically, the specified threshold range can be understood as a brightness interval in which brightness differences are allowed to exist. If the comparison result indicates that the difference between the average brightness and the benchmark average brightness is not within the specified threshold range, then the difference between the average brightness of the pixel column and the benchmark average brightness is too large, and therefore, it can be determined that the pixel brightness state of the pixel column is abnormal. If the comparison result indicates that the difference between the average brightness and the benchmark average brightness is within the specified threshold range, then the difference between the average brightness of the pixel column and the benchmark average brightness is allowed, and therefore, it can be determined that the pixel brightness of the pixel column is normal. For example, the specified threshold range can be ±2 nits. If the difference between the average brightness and the benchmark average brightness is between [-2,2], then the pixel brightness of the pixel column can be considered normal. If the difference between the average brightness and the benchmark average brightness is not between [-2,2], then the pixel brightness of the pixel column can be considered abnormal.

[0071] When it is determined that the pixel brightness state of a pixel column is abnormal, in order to determine whether the abnormality is an isolated occurrence, the continuous cumulative number of times the pixel brightness state of the pixel column is abnormal is counted based on the historical pixel brightness state corresponding to the pixel column. The historical pixel brightness state is determined based on at least one historical image to be processed, and the acquisition interval between the previous image to be processed and the next image to be processed has a specified step size. In response to the continuous cumulative number being greater than or equal to the specified number threshold, it is indicated that the abnormality of the pixel brightness state of the pixel column is not an isolated occurrence, and there may be an abnormality in the material equipment. Therefore, the pixel brightness state of the pixel column is determined to be abnormal, and an abnormality alert is sent so that relevant personnel can perform targeted maintenance on the material equipment in a timely manner to prevent production line stagnation.

[0072] In other examples, in response to the continuous cumulative number of times being less than a specified threshold, the pixel brightness state of the pixel column being abnormal is an occasional situation, the material equipment may not be abnormal, and the pixel brightness state of the pixel column may be normal. Therefore, the current pixel brightness state can be recorded and used as the historical pixel brightness state corresponding to the pixel column in the next image to be processed to determine whether the pixel brightness state corresponding to the pixel column in the next image to be processed is normal, thereby reducing the occurrence of false alarms and improving the reliability of image correction.

[0073] In some other examples, if the pixel brightness state of a pixel column is abnormal, it is also possible to determine whether the pixel brightness state of the pixel column is truly abnormal or an accidental event through the pixel brightness states of a specified number of adjacent pixel columns. Specifically, the pixel brightness states of a specified number of adjacent pixel columns can be obtained. If the pixel brightness states of the specified number of adjacent pixel columns are all normal, the pixel brightness state of the pixel column may be a misjudgment, and therefore, the pixel brightness state of the pixel column can be corrected to be normal. If the pixel brightness states of the specified number of adjacent pixel columns are all abnormal, the pixel brightness state of the pixel column is determined to be abnormal, thereby ensuring the reliability of the detection of the pixel brightness state.

[0074] Step S124: determining the acquisition quality of the image to be processed based on the pixel brightness status of the pixel column.

[0075] If the pixel brightness status of a pixel column is normal, it indicates that the corresponding light source brightness or environment of the pixels in this pixel column is in a normal state during the image acquisition process. If the pixel brightness status of other pixel columns is normal, it can be determined that the acquisition quality of the image to be processed is qualified. If the pixel brightness status of other pixel columns includes a pixel column with an abnormal pixel brightness status, the acquisition quality of the image to be processed may be abnormal.

[0076] Similarly, if the pixel brightness state of a pixel column is abnormal, it indicates that during the image acquisition process, the corresponding light source brightness or environment of the pixels in the pixel column is in an abnormal state, which affects the acquisition quality of the pixel column. Therefore, the acquisition quality of the image to be processed may be abnormal. The pixel brightness state of other pixel columns can be combined to jointly judge the acquisition quality of the image to be processed, thereby improving the accuracy and reliability of determining the acquisition quality.

[0077] In some examples, step S124 may include:

[0078] Step c1: if the pixel brightness state of the pixel column is abnormal, determining that the acquisition quality of the image to be processed is abnormal;

[0079] Step c2: If the pixel brightness state of the pixel column is normal, determine the pixel brightness states of other pixel columns, and determine the acquisition quality of the image to be processed based on the pixel brightness states of other pixel columns.

[0080] Specifically, if the pixel brightness state of a pixel column is abnormal, then the acquisition quality of the image to be processed is directly determined to be abnormal, thereby improving determination efficiency. If the pixel brightness state of a pixel column is normal, it indicates that the corresponding light source brightness or environment of the pixels in the pixel column is in a normal state during the image acquisition process. Therefore, it is necessary to combine the pixel brightness states of other pixel columns to jointly determine whether the acquisition quality of the image to be processed is qualified.

[0081] For example, in response to the presence of at least one pixel column with an abnormal pixel brightness state among other pixel columns, the acquisition quality of the image to be processed is determined to be abnormal; in response to the absence of a pixel column with an abnormal pixel brightness state among other pixel columns, the acquisition quality of the image to be processed is determined to be normal, thereby improving the efficiency of determining the acquisition quality of the image to be processed.

[0082] In some embodiments, as Figure 3 As shown, in the case of abnormal acquisition quality, the above step S140 may include:

[0083] Step S141 : Match the brightness curve with a plurality of preset abnormal brightness curves to obtain a first matching result.

[0084] Multiple abnormal brightness curves obtained from image acquisition under abnormal conditions of material equipment are pre-stored. Different abnormal brightness curves correspond to different abnormal acquisition conditions. If the acquisition quality of the image to be processed is determined to be abnormal, the brightness curve of the image to be processed is matched with multiple preset abnormal brightness curves to determine whether there is an abnormal brightness curve that matches the brightness curve, thereby obtaining a first matching result. By matching the brightness curve with the multiple preset abnormal brightness curves, it is possible to quickly determine whether there are correction parameters suitable for adjusting the brightness of the image to be processed, thereby improving correction efficiency.

[0085] Step S142: In response to the first matching result indicating that there is a first target brightness curve that matches the brightness curve among the multiple abnormal brightness curves, a first target correction parameter corresponding to the first target brightness curve is determined based on a first corresponding relationship between a preset abnormal brightness curve and the correction parameter, and the first target correction parameter is used as a target correction parameter corresponding to the acquisition quality of the image to be processed.

[0086] In response to the first matching result indicating that there is a first target brightness curve that matches the brightness curve among the multiple abnormal brightness curves, it indicates that there is a target parameter that can perform brightness correction on the image to be processed under the acquisition quality. The first target correction parameter corresponding to the first target brightness curve is determined by a first correspondence between the preset abnormal brightness curves and the correction parameters. Among them, the correction parameter corresponding to each abnormal brightness curve in the first correspondence is a parameter for performing targeted correction on the pixel brightness corresponding to the abnormal acquisition condition. The first target correction parameter is used as the target correction parameter corresponding to the acquisition quality of the image to be processed, so that when the target correction parameter is subsequently used for brightness correction, the correction efficiency can be effectively improved, invalid correction can be avoided, and the image quality can be effectively improved.

[0087] In some embodiments, the correction parameters corresponding to the multiple abnormal brightness curves may be determined based on reference abnormal images corresponding to multiple abnormal acquisition conditions, wherein the reference abnormal images are images acquired when the material equipment is transporting the target object under abnormal acquisition conditions.

[0088] In some examples, the target correction parameters include a plurality of flattening parameters and stretching parameters, and the flattening parameters correspond one-to-one to pixel columns. Then, based on the target correction parameters, the process of correcting the brightness of the image to be processed may include:

[0089] Step d1, determining the maximum average brightness based on the average brightness of each pixel column;

[0090] Step d2: correcting the average brightness of each pixel column based on the maximum average brightness and each leveling parameter to obtain a corrected average brightness of each pixel column;

[0091] Step d3, correcting the brightness of each pixel in the brightness of the image to be processed based on the stretching parameter to obtain the corrected pixel brightness of each pixel;

[0092] Step d4: obtaining a first target image based on the corrected average brightness of each pixel column and the corrected pixel brightness of each pixel.

[0093] Specifically, to properly correct the average brightness of each pixel column and ensure the overall brightness balance of the processed image, the maximum average brightness among multiple average brightness values ​​is determined based on the average brightness of each pixel column. The ratio between the maximum average brightness and each average brightness value is used as the average brightness standard value for the corresponding pixel column. That is, for a pixel column, the average brightness standard value for that pixel column = maximum average brightness / average brightness for that pixel column.

[0094] For each pixel column, targeted correction is performed according to the corresponding average brightness, average brightness standard value and leveling parameters, thereby obtaining the corrected average brightness of each pixel column. The process of correcting the average brightness of each pixel column can be expressed by the following formula:

[0095]

[0096] Among them, i represents the order of the current pixel column, lightness i Indicates the average brightness of the current pixel column, L i Indicates the average brightness standard value of the current pixel column, correct indicates the leveling parameter corresponding to the current pixel column, lightness i ′ represents the average brightness of the current pixel column after correction. correct is a positive number greater than 0. The specific value can be determined according to the actual working conditions.

[0097] The pixel brightness of each pixel in the image to be processed is determined respectively, and then the pixel brightness of each pixel is corrected by the stretching parameter, thereby obtaining the corrected pixel brightness of each pixel. The process of correcting the brightness of each pixel can be expressed by the following formula:

[0098] j′=(j / 255) enhance *255, j=0,1,2,...,255;

[0099] Where j represents the current pixel brightness, enhance represents the stretching parameter, and j′ represents the corrected pixel brightness. enhance is a positive number greater than 0, and its specific value can be determined based on actual working conditions.

[0100] An intermediate image of the image to be processed is obtained according to the corrected average brightness of each pixel column and the corrected pixel brightness of each pixel.

[0101] For the intermediate image, determine the maximum average brightness and minimum average brightness in all pixel columns, and determine the brightness difference between the maximum average brightness and the minimum average brightness. Detect whether the average brightness standard deviation of each pixel column is less than a first threshold, and whether the brightness difference and the maximum average brightness are less than a second threshold. If the average brightness standard deviation of each pixel column is less than the first threshold, and the brightness difference and the maximum average brightness are less than the second threshold, then the result of the brightness correction is effective, and the intermediate image can be determined as the first target image after the image to be processed is corrected. Among them, the first threshold and the second threshold are both preset thresholds, the first threshold is a positive number greater than 0, and the second threshold is between 0 and 1. The specific values ​​of the first threshold and the second threshold can be determined according to the actual working conditions.

[0102] If there is at least one pixel column whose average brightness standard deviation is greater than or equal to the first threshold, and / or the brightness difference and the maximum average brightness are greater than or equal to the second threshold, then the result of the brightness correction is invalid correction and further correction is required. Based on the average brightness of each pixel column in the intermediate image and the corresponding brightness curve, the brightness of the intermediate image is continued to be corrected until the average brightness standard deviation of each pixel column is less than the first threshold, and the brightness difference and the maximum average brightness are less than the second threshold, thereby obtaining the first target image after the image to be processed is corrected.

[0103] In some examples, before detecting whether the intermediate image is the first target image after correction of the image to be processed, the abnormal brightness in the intermediate image (image edge or known noise in the image) can also be corroded, so that when subsequent detection is performed, noise interference can be reduced and detection accuracy can be improved, thereby effectively reducing false alarms and missed alarms caused by noise or abnormal brightness, and improving the reliability and efficiency of detection.

[0104] By correcting the brightness of the image to be processed in the above manner, the brightness distribution of the obtained first target image can be made more natural and clear, and the brightness distortion caused by uneven exposure or other reasons can be reduced, thereby effectively improving the brightness and contrast of the image to be processed and improving the overall image quality.

[0105] In other embodiments, Figure 3 As shown, the above step S140 may further include:

[0106] Step S143: in response to the first matching result indicating that there is no first target brightness curve matching the brightness curve among the multiple abnormal brightness curves, the abnormal brightness curve with the highest matching degree among the multiple abnormal brightness curves is selected as the second target brightness curve;

[0107] In response to the first matching result indicating that no first target brightness curve matches the brightness curve among the multiple abnormal brightness curves, this indicates that no target parameters exist among the preset correction parameters that can perform brightness correction on the image to be processed at the acquisition quality. To maximize image quality, based on the matching result, the abnormal brightness curve with the highest degree of matching among the multiple abnormal brightness curves is selected as the second target brightness curve.

[0108] Step S144 : determining a second target correction parameter corresponding to the second target brightness curve based on the first corresponding relationship, and using the second target correction parameter as a target correction parameter corresponding to the acquisition quality of the image to be processed.

[0109] The second target correction parameter corresponding to the second target brightness curve is used as the target correction parameter corresponding to the acquisition quality of the image to be processed, so as to attempt to correct the brightness of the image to be processed through the second target correction parameter, thereby improving the image quality as much as possible, thereby helping to improve the robustness and flexibility of image processing.

[0110] In some other embodiments, Figure 3 As shown, the above step S140 may further include:

[0111] Step S145 , saving the average brightness and brightness curve of each pixel column, determining a correction parameter corresponding to the brightness curve based on the average brightness and brightness curve of each pixel column, and updating the first correspondence based on the brightness curve and the corresponding correction parameter.

[0112] Since the preset correction parameters do not contain a target correction curve for performing targeted correction on the acquisition quality, to improve the reliability of the first correspondence, the average brightness and brightness curve of each pixel column are saved so that the image acquisition environment corresponding to the acquisition quality can be simulated based on the average brightness and brightness curve of each pixel column. The correction parameters suitable for performing targeted brightness correction on the acquisition quality can then be determined through testing, and a correspondence between the correction parameters and the brightness curve is established. The brightness curve and its corresponding correction parameters are added to the first correspondence, and the first correspondence is updated to make the first correspondence more comprehensive and better able to cope with different image acquisition qualities. This can effectively improve the accuracy and efficiency of image processing when brightness correction is subsequently performed.

[0113] In some embodiments, as Figure 4 As shown, the image correction method may include the following steps:

[0114] Step S210: obtaining an image to be processed.

[0115] Step S220 , segmenting the image to be processed and determining a foreground area image in the image to be processed.

[0116] Image segmentation is performed on the image to distinguish which areas of the image are foreground and which are background, thereby obtaining an image of the foreground area of ​​the image. The foreground area generally refers to the important areas of the image that require special processing, while the background is non-important or distracting. The segmentation criteria can be based on brightness, color, texture, or other image features, depending on the image segmentation algorithm used. Image segmentation algorithms include, but are not limited to, threshold segmentation, edge detection, region growing, and clustering algorithms.

[0117] Step S230 : determining the average brightness of each pixel column based on the pixel brightness of each pixel in the foreground area image.

[0118] Based on the pixel brightness and the corresponding number of pixels corresponding to each pixel column in the foreground area image, the average brightness corresponding to each pixel column is determined, which can effectively improve the accuracy of determining the average brightness and reduce noise interference, thereby improving the accuracy of brightness correction when performing subsequent brightness correction.

[0119] In some examples, step S230 may include the following steps:

[0120] Step e1, performing brightness erosion processing on the foreground area image to obtain an updated foreground area image;

[0121] Step e2: determining the average brightness of the pixel column according to the pixel brightness of each pixel in the pixel column in the updated foreground area image.

[0122] Specifically, in order to enhance the accuracy of determining the average brightness, after obtaining the foreground area image of the pixel image, brightness corrosion processing can be performed on the pixels with abnormal brightness in the foreground area image, so that the brightness of the pixel can smoothly transition with the brightness of the adjacent pixels, making the brightness distribution of the foreground area image more uniform, thereby determining the average brightness corresponding to each pixel column based on the corrected foreground area image, which can be more accurate and reliable.

[0123] In another example, an outlier detection algorithm can be used to detect abnormal pixel brightness in the foreground image, and then brightness erosion can be performed on the detected abnormal pixel brightness, effectively improving the quality of the foreground image and the accuracy of subsequent processing. The outlier detection algorithm can be any of the following: 3 sigma method, boxplot, KNN, etc.

[0124] Step S240 : determining the acquisition quality of the image to be processed based on the average brightness of each pixel column.

[0125] Step S250 : determining a brightness curve of the image to be processed based on the average brightness of each pixel column.

[0126] Step S260 : In response to the acquisition quality being abnormal, a target correction parameter corresponding to the acquisition quality of the image to be processed is determined based on the brightness curve.

[0127] Step S270: Correct the brightness of the image to be processed based on the target correction parameter to obtain a first target image.

[0128] According to the image correction method provided by the present disclosure, the acquisition quality is evaluated based on the foreground area image of the image to be processed, which can reduce errors or misjudgments caused by noise, blur or other acquisition problems. Then, by determining the corresponding correction parameters based on the brightness curve determined based on the foreground area image, the accuracy and effectiveness of correcting the brightness of the image to be processed can be improved, which can effectively improve the image quality and reduce the workload in subsequent processing steps, thereby making the obtained first target image more reliable and helping to save time and resources.

[0129] In some embodiments, as Figure 5 As shown, the image correction method may include the following steps:

[0130] Step S310: Obtain an image to be processed.

[0131] Step S320: determining the acquisition quality of the image to be processed based on the average brightness of each pixel column.

[0132] Step S330 : determining a brightness curve of the image to be processed based on the average brightness of each pixel column.

[0133] Step S340 : In response to the acquisition quality being abnormal, a target correction parameter corresponding to the acquisition quality of the image to be processed is determined based on the brightness curve.

[0134] Step S350: Correct the brightness of the image to be processed based on the target correction parameter to obtain a first target image.

[0135] Step S360: In response to the acquisition quality being normal, the brightness curve is matched with a plurality of preset normal brightness curves to obtain a second matching result.

[0136] Normal brightness curves obtained from image acquisition under normal conditions of the material equipment are pre-stored. Different abnormal brightness curves correspond to different normal acquisition conditions. When acquisition quality is normal, the brightness curve is matched against multiple preset normal brightness curves to determine whether a matching normal brightness curve exists among the multiple normal brightness curves, thereby obtaining a second matching result. By matching the brightness curve against the multiple preset normal brightness curves, it is possible to quickly determine whether correction parameters are suitable for adjusting the brightness of the image to be processed, thereby improving correction efficiency.

[0137] Step S370: In response to the second matching result indicating that there is a second target brightness curve matching the brightness curve among the multiple normal brightness curves, a third target correction parameter corresponding to the second target brightness curve is determined based on a second corresponding relationship between the preset normal brightness curve and the correction parameter.

[0138] In response to the second matching result indicating that a second target brightness curve matching the brightness curve exists among the multiple normal brightness curves, it indicates that target parameters exist that can be used to perform brightness correction on the image to be processed at the acquisition quality. A third target correction parameter corresponding to the second target brightness curve is determined based on a preset second correspondence between the normal brightness curves and the correction parameters. The correction parameters corresponding to the normal brightness curves in the second correspondence are used to perform targeted correction on pixel brightness corresponding to normal acquisition conditions.

[0139] Step S380: Correct the brightness of the image to be processed based on the third target correction parameter to obtain a second target image.

[0140] Correcting the brightness of the image to be processed by using the third target correction parameter can effectively improve the correction efficiency, thereby improving the image quality.

[0141] According to the image correction method provided by the present disclosure, it is possible to use different correction parameters to perform targeted correction on the image brightness of the image to be processed according to the acquisition quality of the image to be processed. This can not only effectively improve the image quality, but also make the correction process more flexible and reliable, thereby helping to improve the image correction performance.

[0142] In some embodiments, the correction parameters corresponding to the multiple normal brightness curves may be determined based on multiple reference normal images corresponding to normal acquisition conditions, wherein the reference normal images are images acquired when the material equipment is transporting the target object under normal acquisition conditions.

[0143] In some optional implementation scenarios, such as Figure 6 As shown, the process of image correction for the image to be processed can be as follows:

[0144] An image to be processed is obtained, and an average brightness of each pixel column in the image to be processed is determined.

[0145] The acquisition quality of the image to be processed is determined based on the average brightness of each pixel column.

[0146] In response to the acquisition quality of the image to be processed being abnormal, the brightness curve of the image to be processed is matched with a plurality of abnormal brightness curves in a preset abnormal brightness curve library to determine a first matching result.

[0147] In response to the first matching result characterizing that there is a first target brightness curve that matches the brightness curve among multiple abnormal brightness curves, based on the first corresponding relationship between the preset abnormal brightness curve and the correction parameter, the first target correction parameter corresponding to the first target brightness curve is determined, and the brightness of the image to be processed is corrected using the first target correction parameter to obtain a first target image.

[0148] Image analysis processing is performed on the first target image to detect, identify and classify the material.

[0149] In response to the first matching result indicating that there is no first target brightness curve matching the brightness curve among the multiple abnormal brightness curves, the abnormal brightness curve with the highest matching degree among the multiple abnormal brightness curves is used as the second target brightness curve, and based on the first corresponding relationship, the second target correction parameter corresponding to the second target brightness curve is determined, and the brightness of the image to be processed is corrected using the second target correction parameter to obtain the first target image.

[0150] The average brightness and brightness curve of each pixel column in the image to be processed are saved. Based on the average brightness and brightness curve of each pixel column, a corresponding abnormal acquisition condition is constructed. Based on the abnormal condition, correction parameters corresponding to the brightness curve are determined. The brightness curve and corresponding correction parameters are added to the abnormal brightness curve library offline to update the first correspondence.

[0151] In response to the acquisition quality being normal, the brightness curve is matched with a plurality of preset normal brightness curves to obtain a second matching result. In response to the second matching result indicating that a second target brightness curve matching the brightness curve exists among the plurality of normal brightness curves, a third target correction parameter corresponding to the second target brightness curve is determined based on a second correspondence between the preset normal brightness curves and the correction parameter, and the brightness of the image to be processed is corrected using the third target correction parameter to obtain a second target image.

[0152] Through the image correction method provided by the present invention, corresponding correction parameters can be used to perform brightness correction for different acquisition conditions, so as to reduce the occurrence of equipment stagnation due to abnormal working conditions, ensure image acquisition quality, and thus improve production stability.

[0153] Based on the same inventive concept, the present disclosure also provides an image correction device. Figure 7 As shown, the image correction device 400 may include: an acquisition module 401 , a first processing module 402 , a second processing module 403 , a third processing module 404 and a first correction module 405 .

[0154] An acquisition module 401 is configured to acquire an image to be processed, where the image to be processed includes a plurality of pixel columns;

[0155] A first processing module 402 is configured to determine the acquisition quality of the image to be processed based on the average brightness of each pixel column;

[0156] A second processing module 403 is configured to determine a brightness curve of the image to be processed based on the average brightness of each pixel column;

[0157] The third processing module 404 is configured to determine, in response to the abnormal acquisition quality, a target correction parameter corresponding to the acquisition quality of the image to be processed based on the brightness curve;

[0158] The first correction module 405 is configured to correct the brightness of the image to be processed based on the target correction parameter to obtain a first target image.

[0159] In some embodiments, the first processing module 402 includes:

[0160] A first determining unit, configured to determine a reference average brightness corresponding to a pixel column;

[0161] A comparison unit, used to compare the average brightness of the pixel column with the reference average brightness to obtain a comparison result;

[0162] a second determining unit, configured to determine a pixel brightness state of the pixel column according to the comparison result;

[0163] The third determining unit is configured to determine the acquisition quality of the image to be processed based on the pixel brightness state of the pixel column.

[0164] In some embodiments, the second determining unit includes:

[0165] a first processing unit, configured to determine that a pixel brightness state of the pixel column is abnormal in response to a comparison result indicating that a difference between the average brightness and the reference average brightness is not within a specified threshold range;

[0166] a statistical unit, configured to count the number of consecutive times that the pixel brightness state of the pixel column is abnormal based on a historical pixel brightness state corresponding to the pixel column, wherein the historical pixel brightness state is determined based on at least one historical image to be processed, and a specified step length is set between the acquisition interval between the previous image to be processed and the next image to be processed; and

[0167] a second processing unit, configured to determine that the pixel brightness state of the pixel column is abnormal and send an abnormality alarm in response to the continuous cumulative number being greater than or equal to a specified number threshold;

[0168] The third processing unit is configured to determine that the pixel brightness of the pixel column is normal in response to the comparison result indicating that the difference between the average brightness and the reference average brightness is within a specified threshold range.

[0169] In some embodiments, the third determining unit includes:

[0170] a fourth processing unit, configured to determine that the acquisition quality of the image to be processed is abnormal if the pixel brightness state of the pixel column is abnormal;

[0171] The fifth processing unit is configured to determine the pixel brightness states of other pixel columns if the pixel brightness state of the pixel column is normal, and determine the acquisition quality of the image to be processed based on the pixel brightness states of the other pixel columns.

[0172] In some embodiments, the fifth processing unit includes:

[0173] a first execution unit, configured to determine that the acquisition quality of the image to be processed is abnormal in response to the presence of at least one pixel column in the other pixel columns having an abnormal pixel brightness state;

[0174] The second execution unit is configured to determine that the acquisition quality of the to-be-processed image is normal in response to the absence of a pixel column with an abnormal pixel brightness state in other pixel columns.

[0175] In some embodiments, the first determining unit includes:

[0176] an acquisition unit, configured to acquire a reference pixel image;

[0177] The sixth processing unit is configured to determine a reference average brightness corresponding to a pixel column based on the pixel brightness of each pixel in the pixel column in the reference pixel image.

[0178] In some embodiments, the third processing module 404 includes:

[0179] a matching unit, configured to match the brightness curve with a plurality of preset abnormal brightness curves to obtain a first matching result;

[0180] The third execution unit is used to determine, in response to the first matching result characterizing that there is a first target brightness curve matching the brightness curve among the multiple abnormal brightness curves, a first target correction parameter corresponding to the first target brightness curve based on a first corresponding relationship between a preset abnormal brightness curve and the correction parameter, and use the first target correction parameter as a target correction parameter corresponding to the acquisition quality of the image to be processed.

[0181] In some embodiments, the third processing module 404 further includes:

[0182] a fourth execution unit, configured to, in response to the first matching result indicating that there is no first target brightness curve matching the brightness curve among the plurality of abnormal brightness curves, select the abnormal brightness curve with the highest matching degree among the plurality of abnormal brightness curves as the second target brightness curve;

[0183] The seventh processing unit is configured to determine, based on the first corresponding relationship, a second target correction parameter corresponding to the second target brightness curve, and use the second target correction parameter as a target correction parameter corresponding to the acquisition quality of the image to be processed.

[0184] In some embodiments, the target correction parameters include a plurality of flattening parameters and stretching parameters, and the flattening parameters correspond one-to-one to the pixel columns. The first correction module 405 includes:

[0185] a fourth determining unit, configured to determine a maximum average brightness according to the average brightness of each pixel column;

[0186] A first correction unit is configured to correct the average brightness of each pixel column based on the maximum average brightness and each leveling parameter to obtain a corrected average brightness of each pixel column;

[0187] A second correction unit is configured to correct the pixel brightness of each pixel in the brightness of the image to be processed based on the stretching parameter to obtain a corrected pixel brightness of each pixel;

[0188] The eighth processing unit is configured to obtain a first target image based on the corrected average brightness of each pixel column and the corrected pixel brightness of each pixel.

[0189] In some embodiments, the third processing module 404 further includes:

[0190] The storage unit is used to store the average brightness and brightness curve of each pixel column, determine the correction parameter corresponding to the brightness curve based on the average brightness and brightness curve of each pixel column, and update the first corresponding relationship based on the brightness curve and the corresponding correction parameter.

[0191] In some embodiments, after acquiring the image to be processed, the apparatus 400 further includes:

[0192] An image segmentation module is used to segment the image to be processed and determine the foreground area image in the image to be processed;

[0193] The fourth processing module is used to determine the average brightness of each pixel column based on the pixel brightness of each pixel in the foreground area image.

[0194] In some embodiments, the fourth processing module includes:

[0195] a ninth processing unit, configured to perform brightness erosion processing on the foreground area image to obtain an updated foreground area image;

[0196] The fifth determining unit is configured to determine an average brightness of the pixel column according to the pixel brightness of each pixel in the pixel column in the updated foreground area image.

[0197] In some embodiments, the apparatus 400 further includes:

[0198] a fifth processing module, configured to, in response to the acquisition quality being normal, match the brightness curve with a plurality of preset normal brightness curves to obtain a second matching result;

[0199] a sixth processing module, configured to, in response to the second matching result indicating that a second target brightness curve matching the brightness curve exists among the plurality of normal brightness curves, determine a third target correction parameter corresponding to the second target brightness curve based on a preset second correspondence between the normal brightness curves and the correction parameters;

[0200] The second correction module is used to correct the brightness of the image to be processed based on the third target correction parameter to obtain a second target image.

[0201] Regarding the image correction device in the above embodiment, the specific manner in which each module performs operations has been described in detail in the embodiment of the method, and will not be elaborated here.

[0202] Based on the same inventive concept, Figure 8 As shown, one embodiment of the present disclosure provides an electronic device 500. The electronic device 500 includes a memory 510, a processor 520, and an input / output (I / O) interface 530. The memory 510 is used to store instructions. The processor 520 is used to call the instructions stored in the memory 510 to execute the image correction method of the embodiment of the present disclosure. The processor 520 is connected to the memory 510 and the I / O interface 530, respectively, for example, through a bus system and / or other forms of connection mechanisms (not shown). The memory 510 can be used to store programs and data, including the program of the image segmentation method involved in the embodiment of the present disclosure. The processor 520 executes various functional applications and data processing of the electronic device 500 by running the program stored in the memory 510.

[0203] In the embodiment of the present disclosure, the processor 520 can be implemented in at least one hardware form of a digital signal processor (DSP), a field-programmable gate array (FPGA), or a programmable logic array (PLA). The processor 520 can be a central processing unit (CPU) or one or a combination of other forms of processing units with data processing capabilities and / or instruction execution capabilities.

[0204] The memory 510 in the embodiments of the present disclosure may include one or more computer program products, which may include various forms of computer-readable storage media, such as volatile memory and / or non-volatile memory. Volatile memory may include, for example, random access memory (RAM) and / or cache memory. Non-volatile memory may include, for example, read-only memory (ROM), flash memory, hard disk drive (HDD), or solid-state drive (SSD).

[0205] In the embodiment of the present disclosure, the I / O interface 530 may be used to receive input commands (e.g., digital or character information, and to generate key signal input related to user settings and function control of the electronic device 500), and may also output various information (e.g., images or sounds) to the outside. In the embodiment of the present disclosure, the I / O interface 530 may include one or more of a physical keyboard, function keys (e.g., volume control keys, power keys, etc.), a mouse, a joystick, a trackball, a microphone, a speaker, and a touch panel.

[0206] Based on the same inventive concept, the present disclosure further provides a computer-readable storage medium, which stores the following program, which is used to execute the image correction method of any of the aforementioned embodiments.

[0207] This application uses specific terms to describe the embodiments of this application. For example, "one embodiment," "an embodiment," and / or "some embodiments" refer to a certain feature, structure, or characteristic associated with at least one embodiment of this application. Therefore, it should be emphasized and noted that "one embodiment," "an embodiment," or "an alternative embodiment" mentioned twice or multiple times in different locations in this specification does not necessarily refer to the same embodiment. In addition, certain features, structures, or characteristics in one or more embodiments of this application may be appropriately combined.

[0208] In the context of this application, unless the context clearly indicates an exception, the words "a," "an," "an," and / or "the" do not refer to the singular and may include the plural. Generally speaking, the terms "comprise" and "include" only indicate the inclusion of the steps and elements specifically identified, and these steps and elements do not constitute an exclusive list. A method or device may also include other steps or elements.

[0209] Similarly, it should be noted that, in order to simplify the description of this application and thus facilitate understanding of one or more embodiments of the application, the foregoing description of the embodiments of this application sometimes combines multiple features into a single embodiment, figure, or description thereof. However, this disclosure method does not mean that the subject matter of this application requires more features than those recited in the claims. In fact, the features of an embodiment may be fewer than all the features of the individual embodiments disclosed above.

[0210] The basic concepts have been described above. It will be apparent to those skilled in the art that the above disclosure is merely illustrative and does not constitute a limitation of the present application. Although not explicitly stated herein, those skilled in the art may make various modifications, improvements, and amendments to the present application. Such modifications, improvements, and amendments are suggested in the present application and remain within the spirit and scope of the embodiments of the present application.

Claims

1. An image correction method, comprising: Acquire an image to be processed, where the image to be processed includes a plurality of pixel columns; determining the acquisition quality of the image to be processed based on the average brightness of each pixel column; determining a brightness curve of the image to be processed based on the average brightness of each pixel column; In response to the acquisition quality being abnormal, determining a target correction parameter corresponding to the acquisition quality of the image to be processed based on the brightness curve, including: matching the brightness curve with a plurality of preset abnormal brightness curves to obtain a first matching result; in response to the first matching result indicating that a first target brightness curve matching the brightness curve exists among the plurality of abnormal brightness curves, determining a first target correction parameter corresponding to the first target brightness curve based on a first corresponding relationship between the preset abnormal brightness curves and correction parameters, and using the first target correction parameter as the target correction parameter corresponding to the acquisition quality of the image to be processed; Correcting the brightness of the image to be processed based on the target correction parameter to obtain a first target image; Wherein, the target correction parameters include multiple flattening parameters and stretching parameters, and the flattening parameters correspond one-to-one to the pixel columns; based on the target correction parameters, the brightness of the image to be processed is corrected to obtain the first target image, including: determining the maximum average brightness according to the average brightness of each pixel column; based on the maximum average brightness and each of the flattening parameters, respectively correcting the average brightness of each pixel column to obtain the corrected average brightness of each pixel column; based on the stretching parameters, respectively correcting the pixel brightness of each pixel in the brightness of the image to be processed to obtain the corrected pixel brightness of each pixel; based on the corrected average brightness of each pixel column and the corrected pixel brightness of each pixel, the first target image is obtained.

2. The image correction method according to claim 1, wherein: The determining the acquisition quality of the image to be processed based on the average brightness of each pixel column includes: Determining a reference average brightness corresponding to the pixel column; comparing the average brightness of the pixel column with the reference average brightness to obtain a comparison result; determining a pixel brightness state of the pixel column according to the comparison result; The acquisition quality of the image to be processed is determined based on the pixel brightness state of the pixel column.

3. The image correction method according to claim 2, wherein: Determining the pixel brightness state of the pixel column according to the comparison result includes: In response to the comparison result indicating that the difference between the average brightness and the reference average brightness is not within a specified threshold range, determining that the pixel brightness state of the pixel column is abnormal; counting, based on a historical pixel brightness state corresponding to the pixel column, a continuous cumulative number of times the pixel brightness state of the pixel column is abnormal, wherein the historical pixel brightness state is determined based on at least one historical image to be processed, and an acquisition interval between a previous image to be processed and a next image to be processed is a specified step size; and In response to the continuous cumulative number being greater than or equal to a specified number threshold, determining that the pixel brightness state of the pixel column is abnormal and sending an abnormality alarm; In response to the comparison result indicating that the difference between the average brightness and the reference average brightness is within the specified threshold range, it is determined that the pixel brightness of the pixel column is normal.

4. The image correction method according to claim 2 or 3, wherein: The determining the acquisition quality of the image to be processed based on the pixel brightness state of the pixel column includes: If the pixel brightness state of the pixel column is abnormal, determining that the acquisition quality of the image to be processed is abnormal; If the pixel brightness state of the pixel column is normal, the pixel brightness states of the other pixel columns are determined, and based on the pixel brightness states of the other pixel columns, the acquisition quality of the image to be processed is determined.

5. The image correction method according to claim 4, wherein: The determining the acquisition quality of the image to be processed based on the pixel brightness states of the other pixel columns includes: In response to the presence of at least one pixel column in the other pixel columns having an abnormal pixel brightness state, determining that the acquisition quality of the image to be processed is abnormal; In response to the fact that there is no pixel column with abnormal pixel brightness status in the other pixel columns, it is determined that the acquisition quality of the image to be processed is normal.

6. The image correction method according to claim 2, wherein: The determining the reference average brightness corresponding to the pixel column includes: Obtaining a reference pixel image; Based on the pixel brightness of each pixel in the pixel column in the reference pixel image, a reference average brightness corresponding to the pixel column is determined.

7. The image correction method according to claim 1, wherein: The step of determining a target correction parameter corresponding to the acquisition quality of the image to be processed based on the brightness curve further includes: In response to the first matching result indicating that there is no first target brightness curve matching the brightness curve among the multiple abnormal brightness curves, taking the abnormal brightness curve with the highest matching degree among the multiple abnormal brightness curves as the second target brightness curve; Based on the first corresponding relationship, a second target correction parameter corresponding to the second target brightness curve is determined, and the second target correction parameter is used as a target correction parameter corresponding to the acquisition quality of the image to be processed.

8. The image correction method according to claim 7, wherein: The step of determining a target correction parameter corresponding to the acquisition quality of the image to be processed based on the brightness curve further includes: The average brightness of each pixel column and the brightness curve are saved to determine a correction parameter corresponding to the brightness curve based on the average brightness of each pixel column and the brightness curve, and the first corresponding relationship is updated based on the brightness curve and the corresponding correction parameter.

9. The image correction method according to claim 1, wherein: After acquiring the image to be processed, the method further includes: Segmenting the image to be processed to determine a foreground area image in the image to be processed; Based on the pixel brightness of each pixel in the foreground area image, the average brightness of each pixel column is determined respectively.

10. The image correction method according to claim 9, wherein: Determining the average brightness of each pixel column based on the pixel brightness of each pixel in the foreground area image includes: Performing brightness corrosion processing on the foreground area image to obtain an updated foreground area image; The average brightness of the pixel column is determined according to the pixel brightness of each pixel in the pixel column in the updated foreground area image.

11. The image correction method according to claim 1, wherein: The method further comprises: In response to the acquisition quality being normal, matching the brightness curve with a plurality of preset normal brightness curves to obtain a second matching result; In response to the second matching result indicating that a second target brightness curve matching the brightness curve exists among the plurality of normal brightness curves, determining a third target correction parameter corresponding to the second target brightness curve based on a preset second correspondence between the normal brightness curves and the correction parameters; Based on the third target correction parameter, the brightness of the image to be processed is corrected to obtain a second target image.

12. An image correction device, comprising: An acquisition module, configured to acquire an image to be processed, wherein the image to be processed includes a plurality of pixel columns; A first processing module, configured to determine the acquisition quality of the image to be processed based on the average brightness of each pixel column; A second processing module, configured to determine a brightness curve of the image to be processed based on the average brightness of each pixel column; a third processing module, configured to, in response to the acquisition quality abnormality, determine, based on the brightness curve, a target correction parameter corresponding to the acquisition quality of the image to be processed, including: matching the brightness curve with a plurality of preset abnormal brightness curves to obtain a first matching result; and in response to the first matching result indicating that a first target brightness curve matching the brightness curve exists among the plurality of abnormal brightness curves, determining, based on a first corresponding relationship between the preset abnormal brightness curves and correction parameters, a first target correction parameter corresponding to the first target brightness curve, and using the first target correction parameter as the target correction parameter corresponding to the acquisition quality of the image to be processed; a first correction module, configured to correct the brightness of the image to be processed based on the target correction parameter to obtain a first target image; Among them, the target correction parameters include multiple flattening parameters and stretching parameters, and the flattening parameters correspond one-to-one to the pixel columns; the first correction module includes: a fourth determination unit, used to determine the maximum average brightness based on the average brightness of each pixel column; a first correction unit, used to correct the average brightness of each pixel column based on the maximum average brightness and each flattening parameter, to obtain the corrected average brightness of each pixel column; a second correction unit, used to correct the pixel brightness of each pixel in the brightness of the image to be processed based on the stretching parameter, to obtain the corrected pixel brightness of each pixel; an eighth processing unit, used to obtain the first target image based on the corrected average brightness of each pixel column and the corrected pixel brightness of each pixel.

13. An electronic device comprising: A memory and a processor, wherein the memory and the processor are communicatively connected to each other, the memory stores computer instructions, and the processor executes the image correction method according to any one of claims 1 to 11 by executing the computer instructions. 14 . A computer-readable storage medium storing a program for executing the image correction method according to claim 1 .

Citation Information

Patent Citations

  • Automatic exposure adjustment method and device, equipment and storage medium

    CN113473032A

  • Image processing method and fluoroscopic apparatus

    JP2017035204A