WO2022257396A1 - Procédé et appareil de détermination de point de pixel de frange de couleur dans une image et dispositif informatique - Google Patents

Procédé et appareil de détermination de point de pixel de frange de couleur dans une image et dispositif informatique Download PDF

Info

Publication number
WO2022257396A1
WO2022257396A1 PCT/CN2021/136744 CN2021136744W WO2022257396A1 WO 2022257396 A1 WO2022257396 A1 WO 2022257396A1 CN 2021136744 W CN2021136744 W CN 2021136744W WO 2022257396 A1 WO2022257396 A1 WO 2022257396A1
Authority
WO
WIPO (PCT)
Prior art keywords
color
value
target
pixel
preset
Prior art date
Application number
PCT/CN2021/136744
Other languages
English (en)
Chinese (zh)
Inventor
王艳龙
Original Assignee
爱芯元智半导体(上海)有限公司
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 爱芯元智半导体(上海)有限公司 filed Critical 爱芯元智半导体(上海)有限公司
Publication of WO2022257396A1 publication Critical patent/WO2022257396A1/fr

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T7/00Image analysis
    • G06T7/90Determination of colour characteristics
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T2207/00Indexing scheme for image analysis or image enhancement
    • G06T2207/10Image acquisition modality
    • G06T2207/10024Color image

Definitions

  • the present application relates to the field of image processing, in particular, to a method, device and computer equipment for determining color fringe pixels in an image.
  • High-quality lenses generally add ultra-low dispersion lenses to correct or eliminate purple fringing, but the price is also much higher, and in many cases it cannot be completely eliminated, so it is still necessary to use algorithms to correct purple fringing.
  • the traditional purple fringing algorithm is relatively simple for purple recognition, and the purple recognition accuracy is low.
  • the present application proposes a determination method, determination device and computer equipment of color fringe pixels in an image capable of better identifying color fringe pixels.
  • the present application provides a method for determining color fringe pixels in an image, which may include:
  • the color value may include a red value, a green value and a blue value
  • the color fringe pixels are pixels in the color fringe in the target image.
  • the method for determining the color edge pixels in the above image after determining the color value of the pixel point, can also determine the red-green difference value and the blue-green difference value according to the color value, compared with simply determining the pixel point according to the color value In this way, reddish colors and bluish colors can be identified, which makes the identification of colors more flexible and avoids the omission of color edge pixels to a certain extent.
  • reddish colors and bluish colors can be identified, which makes the identification of colors more flexible and avoids the omission of color edge pixels to a certain extent.
  • the determining whether the target pixel is a color edge pixel in the target image according to the gradient values of the target pixel in multiple preset directions may include: judging that the target Whether the gradient value of the pixel point in the corresponding preset direction is valid; determine whether the target pixel point is a color edge pixel in the target image according to whether the gradient value of the target pixel point in multiple preset directions is valid point.
  • the above-mentioned embodiment provides a method for determining the color edge pixel point, judging whether the gradient value of the pixel point in the corresponding preset direction is valid according to the gradient value, and if it is valid, it is considered that there is a highlighted pixel in the preset direction point, so that whether the pixel point is a color edge pixel point can be determined according to whether the gradient values in multiple preset directions are valid.
  • the judging whether the gradient value of the target pixel point in the corresponding preset direction is valid may include: acquiring a plurality of gradient groups, the gradient groups including preset gradient values and preset brightness Value; compare the gradient value of the target pixel point in the target preset direction with the preset gradient value in the target gradient group to obtain the gradient of the target pixel point in the target gradient group in the target preset direction
  • the target gradient group may be a gradient group to be compared in the plurality of gradient groups
  • the target preset direction may be a preset direction to be compared in the plurality of preset directions
  • Comparing the brightness value of the target pixel point with the preset brightness value in the target gradient group to obtain the brightness comparison result of the target pixel point in the target gradient group in the target preset direction; according to the The gradient comparison results and brightness comparison results of the plurality of gradient groups of the target pixel in the target preset direction determine whether the gradient value of the target pixel in the target preset direction is valid.
  • the actual pixel point to be corrected (the pixel point in the center of the detection window, that is, the target pixel point)
  • the brightness may be relatively low, and the pixel to be corrected is between the bright area and the dark area (the area where the target is located, and the brightness of this area is relatively low), so theoretically, the brightness of the pixel to be corrected is different. will be very low, therefore, combining the brightness to judge whether the gradient value is valid will get a more accurate judgment result.
  • the target pixel after determining whether the target pixel is a color fringe pixel in the target image according to the gradient values of the target pixel in multiple preset directions, it may further include: when When the target pixel is a color edge pixel in the target image, the color value of the target pixel is corrected.
  • the target pixel when the target pixel is a color edge pixel, the target pixel can also be corrected, so that the corrected target image is more realistic.
  • the correcting the color value of the target pixel may include: searching for the corrected pixel corresponding to the target pixel according to the gradient values of the target pixel in multiple preset directions ; Correcting the color value of the target pixel according to the color value of the corrected pixel corresponding to the target pixel.
  • the correction of the color edge pixels is realized through the color value, so that the color of the corrected target pixel is similar to the color of the corrected pixel, so that the corrected target image is more realistic.
  • the correcting the color value of the target pixel according to the color value of the corrected pixel corresponding to the target pixel may include: determining the target color component, the first remaining color component and the second The remaining color component, the target color component, the first remaining color component and the second remaining color component can be one of the red component, green component and blue component respectively; calculate the target in the corrected pixel The difference between the color component value corresponding to the color component and the color component value corresponding to the first remaining color component in the corrected pixel to obtain the first difference; calculate the color component corresponding to the target color component in the corrected pixel value and the color component value corresponding to the second remaining color component in the corrected pixel point to obtain the second difference value; calculate the color component value corresponding to the target color component of the target pixel point and the first difference Value difference, to obtain the color component value corresponding to the first remaining color component of the target pixel point; calculate the difference value between the color component value corresponding to the target color component of the target pixel point and the second difference value, to obtain The color component value
  • the target color component is first determined, and then the color component value corresponding to the target color component of the target pixel is kept unchanged during the process of correcting the color value of the target pixel, that is, the brightness of the pixel is guaranteed to remain unchanged , and then correct the color component values corresponding to the first remaining color component and the second remaining color component of the pixel, so that the brightness of the pixel after correction will not be too different from the brightness before correction, so that the correction There will be no obvious brightness difference area in the color fringe (considering that it is impossible to identify all the color fringe pixels in the color fringe, that is, the recognition of color fringe pixels may be missed, then, if the correction pixel is directly The color value of the point is corrected as the color value of the pixel to be corrected.
  • the searching for the correction pixel corresponding to the target pixel according to the gradient values of the target pixel in multiple preset directions may include: according to the target pixel in multiple preset directions Whether the gradient value in the direction is effective determines the search direction of the corrected pixel corresponding to the target pixel; search for the corrected pixel corresponding to the target pixel within a preset pixel range in the search direction.
  • the above embodiment provides a search method for corrected pixel points. Firstly, the search direction is determined according to whether the gradient value is valid, and then the corrected pixel points are searched in the search direction. Since whether the gradient value is effective or not reflects whether there is a highlighted pixel point in the corresponding preset direction, the search direction of the corrected pixel point can be determined based on whether the gradient value is valid or not.
  • the searching for the corrected pixel corresponding to the pixel within the preset pixel range in the search direction may include: first appearing in the preset pixel range in the search direction A pixel point whose color is a non-color edge color is determined as a corrected pixel point corresponding to the pixel point.
  • the advantage of determining the first-appearing pixel that is a non-color edge color as the corrected pixel corresponding to the pixel is to reduce the amount of calculation and improve the correction accuracy. It can be understood that the closer the pixel is to the color edge The pixels of the color edge should be more similar to the color edge pixels, and the farther away from the color edge pixels, the less similar to the color edge pixels. Therefore, when a pixel with a color other than a color edge color appears for the first time, directly Set to rectify pixels, which can reduce the amount of calculation and improve the accuracy of correction.
  • the target pixel before determining whether the target pixel is a color fringe pixel in the target image according to the gradient values of the target pixel in multiple preset directions, it may further include: according to calculating the brightness value of the target pixel from the color value of the target pixel; obtaining a preset brightness value and a maximum brightness value of the target pixel in each preset direction in the plurality of preset directions; Comparing the maximum luminance value of the target pixel point in each of the multiple preset directions with the preset luminance value to obtain the maximum brightness value of the target pixel point in the multiple preset directions Gradient weights in each preset direction; comparing the maximum brightness value of the target pixel point in each preset direction in the plurality of preset directions with the brightness value of the target pixel point, Obtaining the preliminary gradient value of the target pixel point in each preset direction in the plurality of preset directions; The gradient weight is multiplied by the preliminary gradient value of the target pixel point in the corresponding preset direction to obtain the gradient value of the target pixel point
  • the above embodiment provides a method for calculating the gradient value of a pixel point in each preset direction. Since the color fringe usually appears at the junction where the brightness difference is large, the gradient value can be calculated based on the brightness of the pixel to improve the accuracy of the color fringe pixel judgment.
  • the determining the color of the pixel according to the color value of the pixel, the difference between red and green, and the difference between blue and green may include: obtaining a plurality of color groups, and the color groups include preset Set the blue value, the preset red-green difference value and the preset blue-green difference value; compare the blue value of the pixel with the preset blue value in the target color group to obtain the corresponding value of the target color group Blue comparison result, the target color group is a color group to be compared in the plurality of color groups; the red-green difference value of the pixel point and the preset red-green difference value in the target color group Comparing to obtain the red-green comparison result corresponding to the target color group; comparing the blue-green difference value of the pixel with the preset blue-green difference value in the target color group to obtain the corresponding The blue-green comparison result; determine the color of the pixel according to the blue comparison result, red-green comparison result and blue-green comparison result corresponding to the plurality of color groups.
  • a plurality of color groups can be preset, and the color of the pixel point can be determined according to the blue comparison results, red-green comparison results, and blue-green comparison results corresponding to the plurality of color groups, and the same color with different brightness can be compared, and , to identify reddish or bluish colors, which improves the color recognition rate.
  • the present application provides a device for determining color fringe pixels in an image, which may include:
  • An acquisition module configured to acquire the color value of the target pixel in the target image, the color value may include a red value, a green value and a blue value;
  • the calculation module may be configured to calculate the difference between the red value and the green value of the target pixel to obtain the red-green difference, and calculate the difference between the blue value and the green value of the target pixel , get the blue-green difference;
  • the determining module may be configured to determine the color of the pixel point according to the color value, red-green difference value and blue-green difference value of the target pixel point;
  • the color fringe module may be configured to determine whether the target pixel is the target according to gradient values of the target pixel in multiple preset directions when the color of the target pixel is a color fringe color A color fringe pixel in the image, the color fringe pixel being a pixel in the color fringe in the target image.
  • the color fringing module may be configured to: determine whether the gradient value of the target pixel point in the corresponding preset direction is valid; Whether the gradient value of is valid determines whether the target pixel is a color edge pixel in the target image.
  • the color fringing module can be configured to: obtain a plurality of gradient groups, and the gradient groups include preset gradient values and preset brightness values; The gradient value in the direction is compared with the preset gradient value in the target gradient group to obtain the gradient comparison result of the target gradient group of the target pixel point in the target preset direction, and the target gradient group is the multiple A gradient group to be compared in a gradient group, the target preset direction is a preset direction to be compared in the plurality of preset directions; the brightness value of the target pixel point is compared with the target gradient The preset brightness values in the group are compared to obtain the brightness comparison result of the target gradient group of the target pixel point in the target preset direction; according to the target pixel point in the target preset direction The gradient comparison results and brightness comparison results of the multiple gradient groups determine whether the gradient value of the target pixel point in the target preset direction is valid.
  • the determining device further includes: a correction module configured to correct the color value of the target pixel when the target pixel is a color edge pixel in the target image Make corrections.
  • the correction module may be configured to: search for the corrected pixel corresponding to the target pixel according to the gradient values of the target pixel in multiple preset directions; The color value of the corrected pixel point corresponding to the point corrects the color value of the target pixel point.
  • the correction module may be configured to: determine the target color component, the first remaining color component and the second remaining color component, the target color component, the first remaining color component and the The second remaining color components are respectively one of the red component, the green component and the blue component; calculating the color component value corresponding to the target color component in the corrected pixel corresponds to the first remaining color component in the corrected pixel The difference value of the color component value of the first difference value is obtained; the difference between the color component value corresponding to the target color component in the corrected pixel point and the color component value corresponding to the second remaining color component in the corrected pixel point is calculated value to obtain the second difference; calculate the difference between the color component value corresponding to the target color component of the target pixel and the first difference, and obtain the color component corresponding to the first remaining color component of the target pixel value; calculating the difference between the color component value corresponding to the target color component of the target pixel point and the second difference value, to obtain the color component value corresponding to the second remaining color component of the target pixel point.
  • the correction module may be configured to: determine the search direction of the corrected pixel corresponding to the target pixel according to whether the gradient values of the target pixel in multiple preset directions are valid; The corrected pixel corresponding to the target pixel is searched within a preset pixel range in the search direction.
  • the rectification module may be configured to: determine the first pixel in the preset pixel range in the search direction that is a non-color edge color as the pixel corresponding to the pixel. Correct the pixels.
  • the determination device may further include: a gradient value determination module configured to: calculate the brightness value of the target pixel point according to the color value of the target pixel point; obtain a preset brightness value and the determined The maximum brightness value of the target pixel point in each preset direction in the plurality of preset directions; the maximum brightness value of the target pixel point in each preset direction in the plurality of preset directions Value is compared with the preset brightness value to obtain the gradient weight of the target pixel point in each preset direction in the multiple preset directions; the target pixel point in the multiple preset directions Comparing the maximum brightness value in each preset direction in the direction with the brightness value of the target pixel to obtain a preliminary gradient of the target pixel in each preset direction in the plurality of preset directions value; multiply the gradient weight of the target pixel point in each preset direction in the plurality of preset directions by the preliminary gradient value of the target pixel point in the corresponding preset direction to obtain the A gradient value of the target pixel point in each preset direction in the plurality of
  • the gradient value determining module can be configured to: obtain a plurality of color groups, the color groups include a preset blue value, a preset red-green difference value and a preset blue-green difference value ; Comparing the blue value of the pixel with the preset blue value in the target color group to obtain a blue comparison result corresponding to the target color group, the target color group being one of the plurality of color groups A color group to be compared; compare the red-green difference value of the pixel with the preset red-green difference value in the target color group to obtain the red-green comparison result corresponding to the target color group; The blue-green difference value of the pixel is compared with the preset blue-green difference value in the target color group to obtain the blue-green comparison result corresponding to the target color group; according to the blue comparison results corresponding to the plurality of color groups The result, the red-green comparison result and the blue-green comparison result determine the color of the pixel.
  • the present application provides a computer device, which is characterized in that it may include a memory, a processor, and a computer program stored in the memory and operable on the processor, the processor
  • the method for determining color fringe pixels in an image as described above can be implemented when the computer program is executed.
  • the present application provides a computer-readable storage medium, where computer program instructions may be stored in the computer-readable storage medium, and when the computer program instructions are read and executed by a processor, The method for determining color fringe pixels in an image as described above may be performed.
  • Fig. 1 is a schematic diagram of the implementation process of the method for determining the color edge pixels in the image in the embodiment of the present application;
  • Fig. 2 is the schematic diagram of color fringe in the embodiment of the present application.
  • FIG. 3 is a schematic diagram of a pixel search range in an embodiment of the present application.
  • Fig. 4 is the schematic diagram of the search window in the embodiment of the present application.
  • FIG. 5 is a schematic diagram of the composition and structure of the device for determining the color fringe pixels in the image in the embodiment of the present application;
  • FIG. 6 is a block diagram of an internal structure of a computer device in an embodiment of the present application.
  • a method for determining color fringe pixels in an image is provided.
  • the executor of the method for determining color fringe pixels in an image described in the embodiment of the present application is a computer device capable of implementing the method for determining color fringe pixels in an image described in the embodiment of the present application.
  • the computer device may include but Not limited to terminals and servers.
  • terminals include desktop terminals and mobile terminals
  • desktop terminals include but not limited to desktop computers and vehicle-mounted computers
  • mobile terminals include but not limited to mobile phones, tablets, laptops, smart watches and cameras.
  • Servers include high-performance computers and high-performance computer clusters.
  • the color model adopted is the RGB model, but it should be pointed out that the embodiment of the present application does not limit the color model, that is, when other color models also adopt the inventive concept of the embodiment of the present application , it should also fall within the protection scope of the embodiments of the present application. Specifically, as long as other color models also adopt the scheme of calculating the color difference value according to the color value, and then determining the color of the pixel point according to the color value and the color difference value, All should fall within the protection scope of the embodiments of the present application.
  • a method for determining color fringe pixels in an image including:
  • Step 100 acquiring color values of target pixels in the target image, where the color values include red values, green values and blue values.
  • the target image is the image that needs to be processed currently, that is, the image to be determined whether it contains color fringes. If the target image contains color fringe pixels, the target image is an image that contains color fringes. On the contrary, if the pixels in the target image are If it is not a color fringe pixel, then the target image is an image that does not contain color fringe, that is to say, the method for determining the color fringe pixel in the image provided by the embodiment of the present application can not only determine whether the image contains color fringe pixels, but also It can be determined at the same time whether the image is an image including color fringing.
  • the target pixel is the pixel in the target image.
  • the target pixel point may be any pixel point among all the pixel points in the target image; the target pixel point may also be a pixel point in a target area in the target image, wherein the target area may be an area determined according to a preset area determination rule , can also be an area determined according to the user's interactive operation on the target image, for example, the area circled by the user in the target image, or an area recognized by image recognition technology, for example, the image recognition technology
  • the technology of identifying the edge area, so as to identify the area containing the color edge, and the identified area containing the color edge is the target area.
  • the color edge is the edge of a certain color that appears at the junction of the target with a large brightness difference, such as the color edge marked by the black dotted line shown in Figure 2, and the color edge marked by the black dotted line appears next to the building.
  • the target may be a human, an animal, or a plant, which is not specifically limited here.
  • the target image is a color image, and each pixel in the target image contains a color value.
  • the color value includes a red value, a green value, and a blue value. Since the red value, green value, and blue value of each pixel point Different, so each pixel presents a different color.
  • Color value which is the color component value corresponding to the color component.
  • the color components in the target image include red, green and blue components.
  • the red value is the red component value corresponding to the red component
  • the green value is the green component value corresponding to the green component
  • the blue value is the blue component value corresponding to the blue component.
  • the red component is represented by R
  • the value of the red component is 128, that is, the red value is 128.
  • the step 100 of obtaining the color value of the target pixel in the target image includes:
  • Step 101 for a target pixel in a target image, obtain a preliminary color value of the target pixel.
  • the color value of the target pixel in the target image is the preliminary color value.
  • the color space of the target image is YUV space
  • the target pixel in the target The color values of the pixels are the brightness value Y, the first color difference value U and the second color difference value V.
  • Step 102 performing color space conversion on the preliminary color value of the target pixel to obtain the color value of the target pixel.
  • the target pixel The preliminary color value is transformed into the color space to obtain the color value of the target pixel.
  • the target image since the target image may not be an RGB image, the preliminary color value of the target image is obtained, and then the preliminary color value is converted according to the conversion relationship of the color space to obtain the color value of the target pixel.
  • Step 200 calculating the difference between the red value and the green value of the target pixel to obtain the red-green difference, and calculating the difference between the blue value and the green value of the target pixel to obtain the blue-green difference value.
  • Step 300 Determine the color of the pixel according to the color value of the target pixel, the difference between red and green, and the difference between blue and green.
  • the color of the target pixel can be determined according to the color value, red-green difference, and blue-green difference of the target pixel.
  • this method can also identify reddish or bluish colors. For example, to identify purple, relying solely on the color value to identify purple may only identify pure purple. For example, when the red value is in a certain range, the green value is in a certain range, and the blue value is in a certain range, it is considered to be purple. The recognition accuracy of such a recognition method for purple is not high.
  • the method for determining the color edge pixels in the image provided in the embodiment of the present application combines the difference between red and green and the difference between blue and green to recognize purple, so that the reddish purple The bluish purple is also recognized, which makes the recognition of purple more flexible and avoids the omission of color edge pixels to a certain extent.
  • Step 400 when the color of the target pixel is a color fringe color, determine whether the target pixel is a color fringe pixel in the target image according to the gradient values of the target pixel in multiple preset directions point, the color fringe pixel point is a pixel point in the color fringe in the target image.
  • Color edge color is the color of the color edge.
  • the pixels in the color edge usually show a relatively consistent color. For example, if the color edge is purple, the color edge color is purple, that is, the pixels in the color edge are basically all purple; For example, if the color edge is blue, the color edge color is blue.
  • the preset direction is the preset direction.
  • the preset directions are 0° direction, 90° direction, 180° direction and 270° direction.
  • the gradient value in the preset direction reflects the magnitude of the gradient in the preset direction.
  • the method for determining the color edge pixel in the above image after determining the color value of the pixel, also determines the red-green difference and the blue-green difference according to the color value, compared to determining the pixel point simply based on the color value
  • the way of color this way can identify the reddish color and the bluish color, which makes the color recognition more flexible, and avoids the omission of color edge pixels to a certain extent.
  • the color edge appears in the At the junction where the brightness difference is large, there must be a certain gradient at these positions. Therefore, after determining that the color of the pixel point is the color edge color, it is further determined whether the pixel point is a color edge color according to the gradient values of multiple preset directions. Pixels, to a certain extent, improve the recognition rate of color edge pixels.
  • determining whether the target pixel is a color fringe pixel in the target image according to the gradient values of the target pixel in multiple preset directions in step 400 includes:
  • Step 40A judging whether the gradient value of the target pixel point in the corresponding preset direction is valid.
  • the purpose of judging whether the gradient value in a preset direction is valid is to judge whether there is a highlighted pixel in the preset direction, so as to determine whether the target pixel is a color fringe according to the judging result of the highlighted pixel pixel, and, when the target pixel is a color edge pixel, determine the search direction of the corrected pixel corresponding to the target pixel.
  • a method for determining whether the gradient value is valid including: obtaining a threshold gradient value; for each preset direction, comparing the gradient value of the preset direction with the threshold gradient value; if the preset direction If the gradient value is greater than or equal to the threshold gradient value, it is determined that the gradient value in the preset direction is valid, that is, there are highlighted pixels in the preset direction; if the gradient value in the preset direction is smaller than the threshold gradient value, it is determined that the gradient value in the preset direction is The gradient value in the preset direction is invalid, that is, there are no highlighted pixels in the preset direction.
  • Step 40B determining whether the target pixel is a color fringe pixel in the target image according to whether the gradient values of the target pixel in multiple preset directions are valid.
  • the target pixel is a color edge pixel in the target image.
  • ⁇ d_x indicates that the preset direction is that the gradient value in the x direction is invalid;
  • d_x indicates that the preset direction is that the gradient value in the x direction is valid; when "&&" and "
  • the gradient values of the four preset directions around the target pixel are valid, and the target pixel is considered to be surrounded by a highlighted area, not a color edge pixel; for the second to thirteenth cases, multiple In the preset directions, not all the gradient values of the preset directions are valid, and the color edge pixels are pixels at the junction of large brightness differences. Therefore, when there are multiple preset directions, not all preset When the gradient values in both directions are valid, the target pixel is considered to be a color edge pixel located in the color edge.
  • the above-mentioned embodiment provides a method for determining the color edge pixel point, judging whether the gradient value of the pixel point in the corresponding preset direction is valid according to the gradient value, and if it is valid, it is considered that there is a highlighted pixel in the preset direction point, so as to determine whether the pixel point is a color edge pixel point according to whether the gradient values in multiple preset directions are valid.
  • the determination in step 40A whether the gradient value of the target pixel point in the corresponding preset direction is valid includes:
  • step 40A1 a plurality of gradient groups are obtained, and the gradient groups include preset gradient values and preset brightness values.
  • the preset gradient value is a preset gradient value; the preset brightness value is a preset brightness value.
  • T i (t i , L i ) represents the i-th gradient group among multiple gradient groups, where t i represents the preset gradient value in the i -th gradient group, and Li represents the i-th gradient group Preset brightness value in gradient group.
  • Each of the multiple gradient groups includes preset gradient values and preset brightness values, and the preset gradient values and preset brightness values included in each gradient group are different.
  • the purpose of setting the gradient group in advance is to compare the gradient value of the target pixel point in a preset direction and the brightness value of the target pixel point with the preset gradient value and preset brightness value in the gradient group, so as to determine by comparison Whether the gradient value in the preset direction is valid.
  • Step 40A2 comparing the gradient value of the target pixel point in the target preset direction with the preset gradient value in the target gradient group to obtain the target gradient value of the target pixel point in the target preset direction
  • the target gradient group is a gradient group to be compared among the plurality of gradient groups
  • the preset target direction is a preset direction to be compared among the plurality of preset directions.
  • the gradient group to be compared refers to the gradient group that has not yet participated in the comparison among the multiple gradient groups when judging whether the gradient value in the target preset direction is valid according to the gradient group. For example, set up three gradient groups, T 1 (t 1 ,L 1 ), T 2 (t 2 ,L 2 ) and T 3 (t 3 ,L 3 ), where T 1 (t 1 ,L 1 ) has completed the comparison, so the gradient groups to be compared are T 2 (t 2 , L 2 ) and T 3 (t 3 , L 3 ), and T 2 (t 2 , L 2 ) and T 3 (t 3 , L 3 ), for example, T 2 (t 2 , L 2 ) as the target gradient group.
  • the preset direction to be compared is a preset direction that has not participated in the comparison among the multiple preset directions.
  • the multiple preset directions are 0° direction, 90° direction, 180° direction and 270° direction, wherein, the 0° direction and 90° direction have been compared, and the preset direction to be compared is 180° ° direction and 270° direction, therefore, one of the 180° direction and the 270° direction, for example, the 270° direction is used as the target preset direction.
  • Step 40A3 comparing the brightness value of the target pixel point with the preset brightness value in the target gradient group to obtain a comparison result of the brightness of the target pixel point in the target gradient group in the target preset direction.
  • Brightness comparison result which is the comparison result of the brightness value.
  • Step 40A4 determine whether the gradient value of the target pixel point in the target preset direction is determined according to the gradient comparison results and brightness comparison results of the plurality of gradient groups in the target preset direction efficient.
  • the preset direction of the target is 90°
  • the gradient value of the target pixel point in the 90° direction is 43
  • the brightness value of the target pixel point is 167.
  • the gradient comparison result of gradient group T 1 is 43>20
  • the brightness comparison result is 167 ⁇ 200
  • the gradient comparison result of gradient group T 2 is 43>20
  • the brightness comparison result is 167>200.
  • the gradient value of the pixel point in the target preset direction can be determined according to the gradient comparison result and brightness comparison result of the target gradient group If it is valid, the remaining gradient groups to be compared in the multiple gradient groups will not be compared.
  • the preset direction of the target is 90°
  • the gradient value of the target pixel in the 90° direction is 43
  • the brightness value of the target pixel is 207.
  • T 1 (20,200) and T 2 (40,160) There are two gradient groups in total, namely T 1 (20,200) and T 2 (40,160), the gradient comparison result of the gradient group T 1 is 43>20, and the brightness comparison result is 207>200, so the gradient of the target pixel point in the 90° direction can be judged according to the first gradient group T 1
  • the value is valid, no need to judge the gradient group T2.
  • the actual pixel point to be corrected (the pixel point in the center of the detection window, that is, the target pixel point)
  • the brightness may be relatively low, and the pixel to be corrected is between the bright area and the dark area (the area where the target is located, and the brightness of this area is relatively low), so theoretically, the brightness of the pixel to be corrected is different. will be very low, therefore, judging whether the gradient value is valid in combination with the brightness will get a more accurate judgment result.
  • step 400 after determining whether the target pixel is a color fringe pixel in the target image according to the gradient values of the target pixel in a plurality of preset directions in step 400, it further includes:
  • Step 500 when the target pixel is a color edge pixel in the target image, correct the color value of the target pixel.
  • the target pixel is a color edge pixel
  • the target pixel is also corrected, so that the corrected target image is more realistic.
  • correcting the color value of the target pixel in step 500 includes:
  • Step 501 according to the gradient values of the target pixel in multiple preset directions, search for the corrected pixel corresponding to the target pixel.
  • the corrected pixel corresponding to the target pixel is a pixel used to correct the target pixel in the target image. It can be understood that the target pixel points are different, and the corrected pixel points corresponding to the target pixel points may be the same or different.
  • Step 502 correcting the color value of the target pixel according to the color value of the corrected pixel corresponding to the target pixel.
  • the color value of the corrected pixel point corresponding to the pixel point can be directly used as the color value of the pixel point, so as to restore the pixel point of the edge of the target.
  • the target pixel point is ps
  • the corrected pixel point corresponding to the target pixel point ps is p2
  • the red value, green value and blue value of p2 are directly used as the red value, green value and blue value of the target pixel point ps .
  • the correction of the color edge pixels is realized through the color value, so that the color of the corrected target pixel is similar to the color of the corrected pixel, so that the corrected target image is more realistic. .
  • step 400 after determining whether the target pixel is a color fringe pixel in the target image according to the gradient values of the target pixel in a plurality of preset directions in step 400, it further includes:
  • the target pixel is not a color fringe pixel in the target image
  • search the remaining pixels in the target image to determine whether the remaining pixel is a color fringe pixel in the target image point.
  • the remaining pixels are pixels that have not been searched in the target image, that is, pixels that have not been searched to determine whether they are color edge pixels.
  • correcting the color value of the target pixel according to the color value of the corrected pixel corresponding to the target pixel in step 502 includes:
  • Step 502A determine the target color component, the first remaining color component and the second remaining color component, the target color component, the first remaining color component and the second remaining color component are red component, green component and blue component respectively One of the color components.
  • the target color component is one of the red component, the green component and the blue component; the first remaining color component is a color component except the target color component among the red component, the green component and the blue component; the second remaining color component is is the color component except the target color component and the first remaining color component among the red component, the green component and the blue component.
  • the purpose of determining the target color component is to ensure that the brightness of the target pixel after correction will not change greatly compared with the brightness before correction.
  • any one of the red component, green component, and blue component can be used as the basis of the target color component because the color edge usually appears at the junction of a large difference in brightness, and then covers the edge of a darker target.
  • the brightness is darker, so the values of the red component, green component and blue component of the pixel in the target will not be very large, so no matter which one of the red component, green component and blue component is used as the target color component,
  • the difference between the calculated first difference and the second difference will not be very large, and then based on the first difference and the second difference, the first remaining color component and the second remaining color component of the color edge pixel are Correction, so that the brightness of the corrected color fringe pixels will not change greatly, so as not to change the brightness too much, so that the color fringe cannot make a smooth transition between the highlight area and the target area, resulting in a gap between the highlight area and the target area. areas where there is a noticeable change in brightness.
  • Step 502B calculating the difference between the color component value corresponding to the target color component in the corrected pixel point and the color component value corresponding to the first remaining color component in the corrected pixel point, to obtain a first difference value.
  • the first difference is the difference between the target color component in the corrected pixel and the color component value corresponding to the first remaining color component. For example, if the target color component is a red component, and the first remaining color component is a blue component, then the color component value corresponding to the red component of the corrected pixel point (assumed to be 60) and the color component value corresponding to the blue component (assumed to be 45) has a difference of 15, that is, the first difference is 15.
  • Step 502C calculating the difference between the color component value corresponding to the target color component in the corrected pixel point and the color component value corresponding to the second remaining color component in the corrected pixel point, to obtain a second difference value.
  • the second difference is the difference between the target color component in the corrected pixel and the color component value corresponding to the second remaining color component. For example, if the second remaining color component is the green component, then the difference between the color component value corresponding to the red component of the corrected pixel point (assumed to be 60) and the color component value corresponding to the green component (assumed to be 40) is calculated to be 20, namely The second difference is 20.
  • Step 502D calculating the difference between the color component value corresponding to the target color component of the target pixel point and the first difference value, to obtain the color component value corresponding to the first remaining color component of the target pixel point.
  • the first remaining color component of the pixel to be corrected is corrected. For example, if the color component value corresponding to the target color component (red component) of the pixel to be corrected is 70, and the first difference value is 15, then after correction, the color corresponding to the first remaining color component (blue component) of the pixel point The component value is 55.
  • the color value ranges from 0 to 255, if the calculated color component value corresponding to the first remaining color component of the pixel is greater than 255, set the color component value corresponding to the first remaining color component of the pixel to 255 ; If the calculated color component value corresponding to the first remaining color component of the pixel is less than 0, set the color component value corresponding to the first remaining color component of the pixel to 0.
  • Step 502E calculating the difference between the color component value corresponding to the target color component of the target pixel point and the second difference value, to obtain the color component value corresponding to the second remaining color component of the target pixel point.
  • the second remaining color component of the pixel to be corrected is corrected. For example, if the color component value corresponding to the target color component (red component) of the pixel to be corrected is 70, and the second difference is 20, then after correction, the color component value corresponding to the second remaining color component (green component) of the pixel point for 50.
  • the color component value corresponding to the second remaining color component of the pixel is set to 255; if the calculated second remaining color of the pixel If the color component value corresponding to the component is less than 0, then the color component value corresponding to the second remaining color component of the pixel is set to 0.
  • the color component value corresponding to the target color component of the pixel to be corrected is 70, then the color component value corresponding to the red component of the pixel is 70 before and after correction.
  • the target color component is first determined, and then the color component value corresponding to the target color component of the target pixel is kept unchanged during the process of correcting the color value of the target pixel, that is, the brightness of the pixel is guaranteed to remain unchanged , and then correct the color component values corresponding to the first remaining color component and the second remaining color component of the pixel, so that the brightness of the pixel after correction will not be too different from the brightness before correction, so that the correction There will be no obvious brightness difference area in the color fringe (considering that it is impossible to identify all the color fringe pixels in the color fringe, that is, the recognition of color fringe pixels may be missed, then, if the correction pixel is directly The color value of the point is corrected as the color value of the pixel to be corrected.
  • step 501 searching for the corrected pixel corresponding to the target pixel according to the gradient values of the target pixel in multiple preset directions includes:
  • Step 501A determine the search direction of the correction pixel corresponding to the target pixel according to whether the gradient values of the target pixel in multiple preset directions are valid.
  • the reverse direction of the preset direction where the gradient value is valid is determined as the search for the corrected pixel direction. Specifically, as shown in Table 1.
  • Step 501B searching for the correction pixel corresponding to the target pixel within the preset pixel range in the search direction.
  • Preset pixel range is the preset pixel range.
  • the pixel range refers to the number of pixels. For example, if the preset pixel range is 5, and the search direction is 0° direction, then search and correct pixel points within the range of 5 pixels in the 0° direction.
  • the above embodiment provides a search method for corrected pixel points. Firstly, the search direction is determined according to whether the gradient value is valid, and then the corrected pixel points are searched in the search direction. Since whether the gradient value is effective or not reflects whether there is a highlighted pixel point in the corresponding preset direction, the search direction of the corrected pixel point can be determined based on whether the gradient value is valid or not.
  • the step 501B of searching for the corrected pixel corresponding to the pixel within the preset pixel range in the search direction includes:
  • a pixel point whose color is a non-color edge color that appears for the first time within the preset pixel range in the search direction is determined as the corrected pixel point corresponding to the pixel point.
  • the color fringe pixel to be corrected is ps
  • the search direction is the 0° direction
  • the preset pixel range is 5
  • the pixel that appears for the first time in the 0° direction is a non-color fringe color is pixel P2 , so P2 is taken as the corrected pixel corresponding to the target pixel ps.
  • the pixels whose color is not the color fringe color are not color fringe pixels, and can be used to correct the color fringe pixels.
  • the advantage of determining the first-appearing pixel that is a non-color edge color as the corrected pixel corresponding to the pixel is to reduce the amount of calculation and improve the correction accuracy. It can be understood that the closer the pixel is to the color edge The pixels of the color edge should be more similar to the color edge pixels, and the farther away from the color edge pixels, the less similar to the color edge pixels. Therefore, when a pixel with a color other than a color edge color appears for the first time, directly Set to rectify pixels, which can reduce the amount of calculation and improve the accuracy of correction.
  • step 400 before determining whether the target pixel is a color fringe pixel in the target image according to the gradient values of the target pixel in multiple preset directions in step 400, it further includes:
  • Step 600 calculating the brightness value of the target pixel point according to the color value of the target pixel point.
  • the brightness value reflects the brightness of the target pixel point.
  • a method for calculating the brightness value of a target pixel including: obtaining a red weight, a green weight, and a blue weight, wherein the sum of the red weight, the green weight, and the blue weight is 1; combining the red weight with Multiply the red value of the target pixel to obtain the red brightness; multiply the green weight by the green value of the target pixel to obtain the green brightness; multiply the blue weight by the blue value of the target pixel to obtain the blue brightness; The red brightness, green brightness and blue brightness are summed to obtain the brightness value of the target pixel.
  • the values of w1, w2 and w3 are all 1/3, that is, the brightness value is obtained by averaging the red value, the green value and the blue value.
  • Step 700 acquiring a preset brightness value and a maximum brightness value of the target pixel point in each preset direction in the plurality of preset directions.
  • the preset brightness value is a preset brightness value. Because the color fringe appears at the boundary where the brightness difference is large, therefore, a brightness value is set in advance to check whether there are pixels with higher brightness around the target pixel, and then judge whether the target pixel is a color fringe pixel. Since there is a region with higher brightness around the color edge, the preset brightness value can be set relatively larger.
  • a method for determining a preset brightness value including: acquiring multiple images of a target scene captured by a camera; acquiring the color values of pixels in a highlighted area around the color fringe in each image; The color value of the pixel point in the highlighted area around the color edge in the image to obtain the preset brightness value.
  • the above-mentioned method for determining the preset brightness value obtains multiple images for the target scene, and then calculates the preset brightness value based on the multiple images, which can obtain the preset brightness values of the same camera in different target scenes, and improve the performance of the same camera in different target scenes. Accuracy of determination of preset brightness values under different target scenes.
  • multiple preset directions are 0° direction, 45° direction, 90° direction, 135° direction, 180° direction, 225° direction, 270° direction, 315° direction, compared to simple setting 4
  • the maximum brightness value in the preset direction is the maximum value of brightness values in the preset direction.
  • the brightness value of each pixel point in the preset direction is calculated to obtain the brightness value of each pixel point in the preset direction.
  • set a larger detection window such as a detection window with a size of 11 ⁇ 11, with the pixel point whose color is the color edge color as the center, and then detect the pixel points in each preset direction covered by the detection window
  • the luminance value is calculated to obtain the maximum luminance value in each preset direction.
  • a method for determining the size of the detection window including: acquiring multiple images of the target scene captured by the camera; determining the pixel width of the color fringe in each image; Get the size of the detection window.
  • determining the pixel width of the color fringe in each image includes: for each image, determining the maximum pixel width and the minimum pixel width of the color fringe; multiplying the first width weight by the maximum pixel width to obtain the first pixel width; The second width weight is multiplied by the minimum pixel width to obtain the second pixel width; the first pixel width and the second pixel width are summed to obtain the summation result; the pixel width of the color edge in the image is obtained according to the summation result, wherein, The sum of the first width weight and the second width weight is one.
  • the maximum pixel width and the minimum pixel width are 5 and 3 respectively
  • the weight of the first width is 0.6
  • the weight of the second width is 0.4
  • the summation result of the first width and the second width is 4.2
  • the summation result is rounded to obtain the pixel width of the color fringe as 4.
  • the size of the detection window is obtained according to the pixel width of the color fringe in the multiple images, including: calculating the average value of the pixel width of the color fringe in the multiple images, and obtaining the size of the detection window according to the average value of the pixel width of the color fringe in the multiple images .
  • obtaining the size of the detection window according to the average value of the pixel width of the color fringe in the multiple images includes: multiplying the average value of the pixel width of the color fringe in the multiple images by 2 and adding 1 to obtain the size of the detection window.
  • Step 800 comparing the maximum luminance value of the target pixel point in each preset direction in the plurality of preset directions with the preset luminance value to obtain the target pixel point in the plurality of preset directions. Gradient weights in each of the preset directions.
  • the maximum brightness value of the target pixel point in the preset direction is greater than or equal to the preset brightness value, then determine the gradient weight of the target pixel point in the preset direction as the first weight; if the target If the maximum brightness value of the pixel point in the preset direction is smaller than the preset brightness value, then it is determined that the gradient weight of the target pixel point in the preset direction is the second weight.
  • the first weight is greater than the second weight, for example, the first weight is 0.9, and the second weight is 0.1; for another example, the first weight is 1, and the second weight is 0, that is, when the maximum brightness value is less than the preset brightness value , thinking that no highlighted pixel can be found in the preset direction.
  • Step 9000 comparing the maximum luminance value of the target pixel point in each preset direction in the plurality of preset directions with the luminance value of the target pixel point to obtain the target pixel point in the Preliminary gradient values in each of the plurality of preset directions.
  • the brightness value of the target pixel point is subtracted from the maximum brightness value of the target pixel point in the preset direction to obtain a preliminary gradient value of the target pixel point in the preset direction.
  • Step 1000 Multiply the gradient weight of the target pixel point in each preset direction in the plurality of preset directions by the preliminary gradient value of the target pixel point in the corresponding preset direction to obtain the The gradient value of the target pixel point in each preset direction in the plurality of preset directions.
  • compare is to compare p_max and grad_det_I.
  • p_max is greater than or equal to grad_det_I
  • the output of compare is the first weight.
  • p_max is less than grad_det_I
  • the output of compare is the second weight.
  • the above embodiment provides a method for calculating the gradient value of a pixel point in each preset direction. Since the color fringe usually appears at the junction where there is a large difference in brightness, the gradient value is calculated based on the brightness of the pixel to improve the accuracy of judging the color fringe pixel.
  • determining the color of the pixel according to the color value, the red-green difference value and the blue-green difference value of the pixel point in step 300 includes:
  • step 301 a plurality of color groups are obtained, and the color groups include a preset blue value, a preset red-green difference value, and a preset blue-green difference value.
  • the preset blue value is the preset blue value; the preset red-green difference value is the preset red-green difference value; the preset blue-green difference value is the preset blue-green difference value.
  • Y i (BL i , RG i , BG i ) represents the i-th color group among the multiple color groups, where BL i represents the preset blue value in the i-th color group, and RG i Indicates the preset red-green difference value in the i-th color group, and BG i represents the preset blue-green difference value in the i-th color group.
  • set 6 color groups namely: Y 1 (BL 1 ,RG 1 ,BG 1 ), Y 2 (BL 2 ,RG 2 ,BG 2 ), Y 3 (BL 3 ,RG 3 , BG 3 ), Y 4 (BL 4 , RG 4 , BG 4 ), Y 5 (BL 5 , RG 5 , BG 5 ), Y 6 (BL 6 , RG 6 , BG 6 ).
  • Step 302 comparing the blue value of the pixel with the preset blue value in the target color group to obtain a blue comparison result corresponding to the target color group, the target color group being the plurality of colors A color group in the group to be compared.
  • the color group to be compared is a color group that has not participated in the comparison among the multiple color groups.
  • the color groups that have not participated in the comparison are Y 5 (BL 5 , RG 5 , BG 5 ) and Y 6 (BL 6 , RG 6 , BG 6 ), so the color group to be compared is Y 5 (BL 5 , RG 5 , BG 5 ), Y 6 (BL 6 , RG 6 , BG 6 ), use one of the color groups to be compared, for example, Y 5 (BL 5 , RG 5 , BG 5 ), as Target color group.
  • the blue comparison result is the comparison result of the blue value.
  • Step 303 comparing the red-green difference value of the pixel with the preset red-green difference value in the target color group to obtain a red-green comparison result corresponding to the target color group.
  • the red-green comparison result is the comparison result of the difference between red and green.
  • Step 304 comparing the blue-green difference value of the pixel with the preset blue-green difference value in the target color group to obtain a blue-green comparison result corresponding to the target color group.
  • the blue-green comparison result is the comparison result of the blue-green difference.
  • Step 305 Determine the color of the pixel according to the blue comparison results, red-green comparison results, and blue-green comparison results corresponding to the plurality of color groups.
  • the blue value of a pixel is represented by b
  • the red-green difference of a pixel is represented by rg
  • the blue-green difference of a pixel is represented by bg
  • BL 4 BL 1
  • BG 4 BG 1
  • BL 5 BL 2
  • BG 5 BG 2
  • BL 6 BL 3
  • BG 6 BG 3
  • Three levels are set, and two levels are set for the difference between red and green, so as to obtain 6 color groups, so:
  • the 6 color groups are set as follows:
  • set the red-green difference RG 1 , RG 2 and RG 3 in the color group to be larger, so that the color group can detect the reddish purple color edge, the larger the RG 1 , RG 2 and RG 3 , the more Prefer to detect reddish purple color edges, for example, set RG 1 , RG 2 and RG 3 to 0; or, set the red-green difference in the color group RG 4 , RG 5 and RG 6 to be smaller, Enables the color group to detect bluish purple color edges, the smaller the RG 4 , RG 5 and RG 6 , the more inclined to detect bluish purple color edges, for example, set RG 4 , RG 5 and RG 6 to 200 Or 255.
  • multiple color groups are preset, and the color of the pixel is determined according to the blue comparison results, red-green comparison results, and blue-green comparison results corresponding to the multiple color groups. Red or bluish colors are recognized, which improves the color recognition rate.
  • determining the color of the pixel according to the blue comparison results, red-green comparison results, and blue-green comparison results corresponding to the multiple color groups in step 305 includes:
  • the blue comparison result corresponding to the target color group meets the first condition
  • the red-green comparison result corresponding to the target color group meets the second condition
  • the blue-green comparison result corresponding to the target color group meets the third condition
  • the first condition is the condition that the blue comparison result in the target color group should meet;
  • the second condition is the condition that the red-green comparison result in the target color group should meet;
  • the third condition is the target color A condition that the blue-green comparison result in the group should satisfy. Therefore, the target color groups are different, and the first condition, the second condition and the third condition corresponding to the target color groups may be different.
  • the target color group is Y 1 (BL 1 , RG 1 , BG 1 ), RG 1 is an integer between h3 and h4, so the first condition is: the blue value of the target pixel is greater than the target The preset blue value in the color group; the second condition is: the red-green difference of the target pixel is greater than the preset red-green difference in the target color group; the third condition is: the blue-green difference of the target pixel is greater than The preset blue-green delta value in the target color group.
  • the target color group is Y 6 (BL 6 , RG 6 , BG 6 ), where RG 6 is an integer between h1 and h2, h3>0, h4>0, h3 ⁇ h4, h4 ⁇ h1, Therefore, the first condition is: the blue value of the target pixel is greater than the preset blue value in the target color group; the second condition is: the red-green difference of the target pixel is greater than the preset red-green difference in the target color group value; the third condition is: the blue-green difference value of the target pixel is smaller than the preset blue-green difference value in the target color group.
  • a device 5 for determining color fringe pixels in an image including:
  • the obtaining module 51 may be configured to obtain the color value of the target pixel in the target image, the color value including a red value, a green value and a blue value;
  • the calculation module 52 may be configured to calculate the difference between the red value and the green value of the target pixel to obtain the red-green difference, and calculate the difference between the blue value and the green value of the target pixel value, get the blue-green difference;
  • the determination module 53 may be configured to determine the color of the pixel point according to the color value, red-green difference value and blue-green difference value of the target pixel point;
  • the color fringe module 54 may be configured to determine whether the target pixel is the color fringe color according to the gradient values of the target pixel in multiple preset directions when the color of the target pixel is A color fringe pixel in the target image, the color fringe pixel being a pixel in the color fringe in the target image.
  • the above-mentioned device for determining the color edge pixel in the image after determining the color value of the pixel, also determines the difference between red and green and the difference between blue and green according to the color value, compared with determining the pixel point simply based on the color value
  • the way of color this way can identify the reddish color and the bluish color, which makes the color recognition more flexible, and avoids the omission of color edge pixels to a certain extent.
  • the color edge appears in the At the junction where the brightness difference is large, there must be a certain gradient at these positions. Therefore, after determining that the color of the pixel point is the color edge color, it is further determined whether the pixel point is a color edge color according to the gradient values of multiple preset directions. Pixels, to a certain extent, improve the recognition rate of color edge pixels.
  • the color fringing module 54 can be configured to: determine whether the gradient value of the target pixel point in the corresponding preset direction is valid; Whether the gradient value above is valid determines whether the target pixel is a color edge pixel in the target image.
  • the color fringing module 54 can be configured to: obtain a plurality of gradient groups, and the gradient groups include preset gradient values and preset brightness values; Comparing the gradient value in the set direction with the preset gradient value in the target gradient group to obtain the gradient comparison result of the target gradient group of the target pixel point in the target preset direction, the target gradient group is the A gradient group to be compared in a plurality of gradient groups, the target preset direction is a preset direction to be compared in the plurality of preset directions; the brightness value of the target pixel point is compared with the target The preset brightness values in the gradient group are compared to obtain the brightness comparison result of the target gradient group of the target pixel point in the target preset direction; according to the target pixel point in the target preset direction The gradient comparison results and the brightness comparison results of the plurality of gradient groups determine whether the gradient value of the target pixel point in the target preset direction is valid.
  • the device 5 further includes: a correction module, configured to correct the color value of the target pixel when the target pixel is a color edge pixel in the target image Make corrections.
  • a correction module configured to correct the color value of the target pixel when the target pixel is a color edge pixel in the target image Make corrections.
  • the correction module may be configured to: search for the corrected pixel corresponding to the target pixel according to the gradient values of the target pixel in multiple preset directions; The color value of the corrected pixel point corresponding to the point corrects the color value of the target pixel point.
  • the correction module may be configured to: determine the target color component, the first remaining color component and the second remaining color component, the target color component, the first remaining color component and the The second remaining color components are respectively one of the red component, the green component and the blue component; calculating the color component value corresponding to the target color component in the corrected pixel corresponds to the first remaining color component in the corrected pixel The difference value of the color component value of the first difference value is obtained; the difference between the color component value corresponding to the target color component in the corrected pixel point and the color component value corresponding to the second remaining color component in the corrected pixel point is calculated value to obtain the second difference; calculate the difference between the color component value corresponding to the target color component of the target pixel and the first difference, and obtain the color component corresponding to the first remaining color component of the target pixel value; calculating the difference between the color component value corresponding to the target color component of the target pixel point and the second difference value, to obtain the color component value corresponding to the second remaining color component of the target pixel point.
  • the correction module may be configured to: determine the search direction of the corrected pixel corresponding to the target pixel according to whether the gradient values of the target pixel in multiple preset directions are valid; The corrected pixel corresponding to the target pixel is searched within a preset pixel range in the search direction.
  • the rectification module may be configured to: determine the first pixel in the preset pixel range in the search direction that is a non-color edge color as the pixel corresponding to the pixel. Correct the pixels.
  • the device 5 further includes: a gradient value determination module, which may be configured to: calculate the brightness value of the target pixel point according to the color value of the target pixel point; obtain a preset brightness value and The maximum brightness value of the target pixel point in each preset direction of the multiple preset directions; the maximum brightness value of the target pixel point in each preset direction of the multiple preset directions Comparing the luminance value with the preset luminance value to obtain the gradient weight of the target pixel point in each of the multiple preset directions; Comparing the maximum luminance value in each preset direction in the set direction with the luminance value of the target pixel to obtain a preliminary Gradient value; multiply the gradient weight of the target pixel point in each preset direction in the plurality of preset directions and the preliminary gradient value of the target pixel point in the corresponding preset direction to obtain the The gradient value of the target pixel point in each preset direction in the plurality of preset directions.
  • a gradient value determination module which may be configured to: calculate the brightness value of the target pixel point according to the
  • the gradient value determining module can be configured to: obtain a plurality of color groups, the color groups include a preset blue value, a preset red-green difference value and a preset blue-green difference value ; Comparing the blue value of the pixel with the preset blue value in the target color group to obtain a blue comparison result corresponding to the target color group, the target color group being one of the plurality of color groups A color group to be compared; compare the red-green difference value of the pixel with the preset red-green difference value in the target color group to obtain the red-green comparison result corresponding to the target color group; The blue-green difference value of the pixel is compared with the preset blue-green difference value in the target color group to obtain the blue-green comparison result corresponding to the target color group; according to the blue comparison results corresponding to the plurality of color groups The result, the red-green comparison result and the blue-green comparison result determine the color of the pixel.
  • a computer device is provided, and the computer device may specifically be a terminal or a server.
  • the computer device includes a processor, a memory and a network interface connected through a system bus, the memory includes a non-volatile storage medium and an internal memory, and the non-volatile storage medium of the computer device stores an operating system and also stores a computer program
  • the processor can realize the method for determining color fringe pixels in the image.
  • Nonvolatile memory can include read only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM), or flash memory.
  • Volatile memory can include random access memory (RAM) or external cache memory.
  • RAM random access memory
  • RAM is available in many forms such as Static RAM (SRAM), Dynamic RAM (DRAM), Synchronous DRAM (SDRAM), Double Data Rate SDRAM (DDRSDRAM), Enhanced SDRAM (ESDRAM), Synchronous Chain Synchlink DRAM (SLDRAM), memory bus (Rambus) direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM), etc.
  • a computer program may also be stored in the internal memory, and when the computer program is executed by the processor, the processor may execute the method for determining color fringe pixels in the image.
  • FIG. 6 is only a block diagram of a part of the structure related to the solution of this application, and does not constitute a limitation on the computer equipment to which the solution of this application is applied.
  • the specific computer equipment can be More or fewer components than shown in the figures may be included, or some components may be combined, or have a different arrangement of components.
  • the method for determining color fringe pixels in an image provided in this application can be implemented in the form of a computer program, and the computer program can be run on a computer device as shown in FIG. 6 .
  • Various program templates constituting the means for determining the color fringe pixels in the image can be stored in the memory of the computer equipment. For example, an acquisition module 51 , a calculation module 52 and a determination module 53 .
  • a computer device comprising a memory and a processor
  • the memory stores a computer program
  • the processor performs the following steps:
  • the color value of the target pixel in the target image comprising a red value, a green value and a blue value
  • the color fringe pixels are pixels in the color fringe in the target image.
  • a computer-readable storage medium storing a computer program, and when the computer program is executed by a processor, the processor is made to perform the following steps:
  • the color value of the target pixel in the target image comprising a red value, a green value and a blue value
  • the color fringe pixels are pixels in the color fringe in the target image.
  • the method for determining the color fringe pixels in the image, the device for determining the color fringe pixels in the image, the computer equipment, and the computer-readable storage medium belong to a general inventive concept, and the color fringe pixels in the image
  • the content in the embodiments of the method for determining, the device for determining color fringe pixels in an image, the computer equipment, and the computer-readable storage medium are applicable to each other.
  • the disclosed devices and methods may be implemented in other ways.
  • the device embodiments described above are only illustrative.
  • the division of the units is only a logical function division.
  • multiple units or components can be combined or May be integrated into another system, or some features may be ignored, or not implemented.
  • the mutual coupling or direct coupling or communication connection shown or discussed may be through some communication interfaces, and the indirect coupling or communication connection of devices or units may be in electrical, mechanical or other forms.
  • a unit described as a separate component may or may not be physically separated, and a component displayed as a unit may or may not be a physical unit, that is, it may be located in one place, or may be distributed to multiple network units. Part or all of the units can be selected according to actual needs to achieve the purpose of the solution of this embodiment.
  • each functional module in each embodiment of the present application may be integrated to form an independent part, each module may exist independently, or two or more modules may be integrated to form an independent part.
  • the present application provides a method for determining color edge pixels in an image, a determining device, and computer equipment.
  • the method includes: acquiring the color value of the target pixel in the target image; calculating the red value of the target pixel and the difference between the green value to obtain the red-green difference, and calculate the difference between the blue value and the green value of the target pixel to obtain the blue-green difference; according to the color value of the target pixel, The red-green difference value and the blue-green difference value determine the color of the pixel point; when the color of the target pixel point is a color edge color, the gradient value of the target pixel point in multiple preset directions is used to determine the Whether the target pixel is a color fringe pixel in the target image, and the color fringe pixel is a pixel in the color fringe in the target image.
  • the method, device and computer equipment for determining color fringe pixels in an image of the present application are reproducible and can be used in various industrial applications.
  • the method for determining color fringe pixels in an image, the determining device and the computer equipment of the present application can be used in the field of image processing.

Abstract

La présente invention concerne un procédé et un appareil de détermination d'un point de pixel de frange de couleur dans une image et un dispositif informatique. Le procédé comprend : l'obtention d'une valeur de couleur d'un point de pixel cible dans une image cible (S100) ; le calcul d'une différence entre une valeur rouge et une valeur verte du point de pixel cible pour obtenir une différence rouge-vert, et le calcul d'une différence entre une valeur bleue et la valeur verte du point de pixel cible pour obtenir une différence bleu-vert (S200) ; la détermination de la couleur du point de pixel selon la valeur de couleur, la différence rouge-vert, et la différence bleu-vert du point de pixel cible (S300) ; et lorsque la couleur du point de pixel cible est une couleur de frange de couleur, le fait de déterminer, selon des valeurs de gradient du point de pixel cible dans de multiples directions prédéfinies, si le point de pixel cible est ou non un point de pixel de frange de couleur dans l'image cible, le point de pixel de frange de couleur étant un point de pixel dans une frange de couleur dans l'image cible (S400). Au moyen du procédé, l'identification de couleur est plus flexible, et l'omission de points de pixel de frange de couleur est évitée dans une certaine mesure.
PCT/CN2021/136744 2021-06-10 2021-12-09 Procédé et appareil de détermination de point de pixel de frange de couleur dans une image et dispositif informatique WO2022257396A1 (fr)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN202110650968.9 2021-06-10
CN202110650968.9A CN113393540B (zh) 2021-06-10 2021-06-10 图像中的色边像素点的确定方法、装置和计算机设备

Publications (1)

Publication Number Publication Date
WO2022257396A1 true WO2022257396A1 (fr) 2022-12-15

Family

ID=77620453

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2021/136744 WO2022257396A1 (fr) 2021-06-10 2021-12-09 Procédé et appareil de détermination de point de pixel de frange de couleur dans une image et dispositif informatique

Country Status (2)

Country Link
CN (1) CN113393540B (fr)
WO (1) WO2022257396A1 (fr)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115760884A (zh) * 2023-01-06 2023-03-07 山东恩信特种车辆制造有限公司 基于图像处理的半挂车表面焊渣优化分割方法
CN116993643A (zh) * 2023-09-27 2023-11-03 山东建筑大学 基于人工智能的无人机摄影测量图像校正方法

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113393540B (zh) * 2021-06-10 2023-10-27 爱芯元智半导体(宁波)有限公司 图像中的色边像素点的确定方法、装置和计算机设备
US11863916B2 (en) * 2022-01-27 2024-01-02 Altek Semiconductor Corporation Color correction method and image correction apparatus

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20140307963A1 (en) * 2013-04-15 2014-10-16 Apple Inc. Defringing RAW Images
CN106657946A (zh) * 2017-01-12 2017-05-10 深圳岚锋创视网络科技有限公司 图像紫边消除系统和方法
CN109978961A (zh) * 2019-03-15 2019-07-05 湖南国科微电子股份有限公司 一种图像色边消除方法、装置及电子设备
CN112446830A (zh) * 2019-08-27 2021-03-05 浙江宇视科技有限公司 一种图像色边的处理方法、装置、存储介质及电子设备
CN112887693A (zh) * 2021-01-12 2021-06-01 浙江大华技术股份有限公司 图像紫边消除方法、设备及存储介质
CN113393540A (zh) * 2021-06-10 2021-09-14 上海智砹芯半导体科技有限公司 图像中的色边像素点的确定方法、装置和计算机设备

Family Cites Families (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102938843B (zh) * 2012-11-22 2014-12-03 华为技术有限公司 图像处理方法、装置以及成像设备
CN110335257A (zh) * 2019-06-20 2019-10-15 东莞理工学院 一种图像色彩检测方法及移动终端

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20140307963A1 (en) * 2013-04-15 2014-10-16 Apple Inc. Defringing RAW Images
CN106657946A (zh) * 2017-01-12 2017-05-10 深圳岚锋创视网络科技有限公司 图像紫边消除系统和方法
CN109978961A (zh) * 2019-03-15 2019-07-05 湖南国科微电子股份有限公司 一种图像色边消除方法、装置及电子设备
CN112446830A (zh) * 2019-08-27 2021-03-05 浙江宇视科技有限公司 一种图像色边的处理方法、装置、存储介质及电子设备
CN112887693A (zh) * 2021-01-12 2021-06-01 浙江大华技术股份有限公司 图像紫边消除方法、设备及存储介质
CN113393540A (zh) * 2021-06-10 2021-09-14 上海智砹芯半导体科技有限公司 图像中的色边像素点的确定方法、装置和计算机设备

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115760884A (zh) * 2023-01-06 2023-03-07 山东恩信特种车辆制造有限公司 基于图像处理的半挂车表面焊渣优化分割方法
CN116993643A (zh) * 2023-09-27 2023-11-03 山东建筑大学 基于人工智能的无人机摄影测量图像校正方法
CN116993643B (zh) * 2023-09-27 2023-12-12 山东建筑大学 基于人工智能的无人机摄影测量图像校正方法

Also Published As

Publication number Publication date
CN113393540B (zh) 2023-10-27
CN113393540A (zh) 2021-09-14

Similar Documents

Publication Publication Date Title
WO2022257396A1 (fr) Procédé et appareil de détermination de point de pixel de frange de couleur dans une image et dispositif informatique
US8564687B2 (en) Efficient determination of an illuminant of a scene
US7949185B2 (en) Method of performing robust auto white balance
US8199202B2 (en) Image processing device, storage medium storing image processing program, and image pickup apparatus
TWI532385B (zh) 白平衡處理方法及其處理裝置
WO2015167676A1 (fr) Équilibrage automatique des blancs avec mesure de chromaticité de données d'image brutes
CN113301318B (zh) 图像的白平衡处理方法、装置、存储介质及终端
US9378564B2 (en) Methods for color correcting digital images and devices thereof
US10224004B2 (en) Automatic white balance based on surface reflection decomposition
WO2021218603A1 (fr) Procédé de traitement d'images et système de projection
Zhang et al. Fast color correction using principal regions mapping in different color spaces
GB2453891A (en) Pupil color correction device and program
CN112669758A (zh) 显示屏校正方法、装置、系统和计算机可读存储介质
CN109587466B (zh) 颜色阴影校正的方法和装置
US8565523B2 (en) Image content-based color balancing
WO2020093653A1 (fr) Procédé de réglage de couleur, dispositif de réglage de couleur, dispositif électronique et support de stockage lisible par ordinateur
CN113177886B (zh) 图像处理方法、装置、计算机设备及可读存储介质
US20180176528A1 (en) Light locus generation for automatic white balance
US20180176420A1 (en) Automatic white balance based on surface reflection decomposition and chromatic adaptation
CN116158087A (zh) 一种多相机色彩一致性校正方法和装置
JP6573798B2 (ja) 画像処理装置及び画像処理方法
WO2023151210A1 (fr) Procédé de traitement d'image, dispositif électronique et support de stockage lisible par ordinateur
TW202107411A (zh) 影像感測裝置以及自動白平衡方法
WO2023123601A1 (fr) Procédé et appareil de traitement de couleurs d'image, et dispositif électronique
US8189067B2 (en) Determining the illuminant in a captured scene

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 21944892

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE