Search

CN-122023212-A - Image color enhancement method and device and electronic equipment

CN122023212ACN 122023212 ACN122023212 ACN 122023212ACN-122023212-A

Abstract

The application discloses an image color enhancement method and device and electronic equipment, and belongs to the technical field of image processing. The image color enhancement method comprises the steps of respectively extracting channel sub-images corresponding to a first color space in a color image, obtaining a first differential image and a second differential image, extracting channel sub-images corresponding to preset second color channels in the second color space, respectively comparing differences between a plurality of tone filter images and the channel sub-images, obtaining a plurality of color weight images, determining a first color weight coefficient based on the plurality of color weight images, determining a second color weight coefficient based on the first color weight coefficient, enhancing the first differential image according to the first color weight coefficient, and enhancing the second differential image based on the second color weight coefficient, so as to obtain a color enhancement image corresponding to the color image. The application improves the accuracy and stability of the image defect detection algorithm.

Inventors

  • KANG ZHAOCHUAN
  • XU WENTAN

Assignees

  • 苏州凌云光工业智能技术有限公司
  • 凌云光技术股份有限公司

Dates

Publication Date
20260512
Application Date
20251226

Claims (10)

  1. 1. An image color enhancement method, comprising: Respectively extracting channel sub-images corresponding to a plurality of first color channels in a first color space in a color image, and carrying out differential processing on the channel sub-images of adjacent color channels to obtain a first differential image and a second differential image; extracting channel sub-images of the color image corresponding to a preset second color channel in a second color space; Respectively comparing differences between the multiple tone filter images and the channel sub-images to obtain multiple color weight images; Determining a first color weight coefficient based on the plurality of color weight images, and determining a second color weight coefficient from the first color weight coefficient; and carrying out enhancement processing on the first differential image according to the first color weight coefficient, and carrying out enhancement processing on the second differential image based on the second color weight coefficient to obtain a color enhancement image corresponding to the color image.
  2. 2. The image color enhancement method of claim 1, wherein said respectively comparing differences between the plurality of tone filter images and the channel sub-image results in a plurality of color weighted images, comprising: determining reference tone values for the plurality of tone filter images; Comparing each reference tone value with the tone value of the channel sub-image to obtain a plurality of tone comparison results; and generating color weight images corresponding to the color tone filter images respectively based on the tone comparison results.
  3. 3. The method according to claim 2, wherein the tone comparison result includes a tone value difference of each pixel, wherein the generating color weight images corresponding to each tone filter image based on the plurality of tone comparison results includes: For any tone filter image, carrying out operation processing on the tone value difference of each pixel point corresponding to the tone filter image to obtain the color weight corresponding to each pixel point in the tone filter image, wherein the smaller the difference between the tone value of the channel sub-image and any reference tone value is, the larger the color weight corresponding to the corresponding tone filter image is; and generating color weight images corresponding to the color tone filter images based on the color weights corresponding to the pixel points.
  4. 4. The image color enhancement method of claim 1, wherein the determining a first color weight coefficient based on the plurality of color weight images comprises: For any pixel point in the color image, acquiring a plurality of color weight values corresponding to the pixel point from the plurality of color weight images; and carrying out fusion calculation on the plurality of color weight values to obtain a first color weight coefficient corresponding to the pixel point.
  5. 5. A method of image color enhancement according to claim 1 or 3, wherein said determining a second color weight coefficient from said first color weight coefficient comprises: determining a mapping relationship between the first color weight coefficient and the second color weight coefficient based on a preset color feature matched with the first differential image; And mapping the first color weight coefficient into a second color weight coefficient according to the mapping relation, wherein the absolute value of the second color weight coefficient is smaller than that of the first color weight coefficient.
  6. 6. The method of claim 1, wherein the enhancing the first differential image according to the first color weight coefficient, and enhancing the second differential image based on the second color weight coefficient, to obtain a color enhanced image corresponding to the color image, comprises: multiplying the pixel value of each pixel point in the first differential image with the first color weight coefficient to obtain a first enhancement result; Multiplying the pixel value of each pixel point in the second differential image with the second color weight coefficient to obtain a second enhancement result; And superposing at least the first enhancement result and the second enhancement result to obtain a color enhancement image corresponding to the color image.
  7. 7. The image color enhancement method according to claim 6, wherein the channel sub-images of the plurality of first color channels include a maximum value channel sub-image, a minimum value channel sub-image, and a middle value channel sub-image in order of pixel value; the method further comprises the steps of: multiplying the pixel value of each pixel point in the minimum channel sub-image with a third color weight coefficient preset for the pixel point to obtain a third enhancement result; And superposing the first enhancement result, the second enhancement result and the third enhancement result to obtain a color enhancement image corresponding to the color image.
  8. 8. The image color enhancement method according to claim 1, further comprising, after obtaining the color enhanced image corresponding to the color image: inputting the color enhanced image into a defect detection model, detecting defects of the color enhanced image, and determining at least one target defect characteristic in the color enhanced image; And obtaining a defect detection result corresponding to the color image according to the target defect characteristics.
  9. 9. An image color enhancement device, comprising: the difference module is used for respectively extracting channel sub-images corresponding to a plurality of first color channels in the first color space in the color image, and carrying out difference processing on the channel sub-images of the adjacent color channels to obtain a first difference image and a second difference image; the extraction module is used for extracting channel sub-images of the color image corresponding to a preset second color channel in a second color space; the contrast module is used for respectively comparing the differences between the plurality of tone filter images and the channel sub-images to obtain a plurality of color weight images; A determining module, configured to determine a first color weight coefficient based on the plurality of color weight images, and determine a second color weight coefficient from the first color weight coefficient; And the enhancement module is used for enhancing the first differential image according to the first color weight coefficient, and enhancing the second differential image based on the second color weight coefficient to obtain a color enhanced image corresponding to the color image.
  10. 10. An electronic device comprising a memory, a processor and a computer program stored on the memory and executable on the processor, wherein the processor implements the image color enhancement method according to any of claims 1-8 when the computer program is executed by the processor.

Description

Image color enhancement method and device and electronic equipment Technical Field The application belongs to the technical field of image processing, and particularly relates to an image color enhancement method and device and electronic equipment. Background With the continuous increase of product appearance refinement in consumer electronics, industrial manufacturing, and other industries, minor deviations in hue, or saturation of product surfaces have become critical for quality control. Such color differences are often extremely weak and difficult to identify by direct observation. Therefore, it is necessary to pre-process the color image in the industrial imaging to enlarge and highlight these fine color anomaly areas, thereby providing a clear and reliable input for the defect detection system and improving the appearance quality of the product. In the related art, a method for enhancing weak color difference generally adopts a method of uniformly processing the whole color image, such as global contrast stretching, saturation improvement, and the like. However, the image enhancement mode is difficult to distinguish and pertinently process different color components in the image, the enhancement effect is often uneven, image noise is easily amplified excessively or unnecessary color distortion is caused while local abnormality is enhanced, the accuracy and stability of a subsequent industrial product surface image defect detection algorithm are further affected, and the risk of false detection or omission is increased. Disclosure of Invention The present invention aims to solve at least one of the technical problems existing in the prior art. Therefore, the invention provides an image color enhancement method, an image color enhancement device and electronic equipment, so that the accuracy and the stability of an image defect detection algorithm are improved. In a first aspect, the present application provides an image color enhancement method, the method comprising: Respectively extracting channel sub-images corresponding to a plurality of first color channels in a first color space in a color image, and carrying out differential processing on the channel sub-images of adjacent color channels to obtain a first differential image and a second differential image; Extracting channel sub-images of the color image corresponding to a preset second color channel in a second color space; Respectively comparing differences between the multiple tone filter images and the channel sub-images to obtain multiple color weight images; Determining a first color weight coefficient based on the plurality of color weight images, and determining a second color weight coefficient from the first color weight coefficient; And carrying out enhancement processing on the first differential image according to the first color weight coefficient, and carrying out enhancement processing on the second differential image based on the second color weight coefficient to obtain a color enhancement image corresponding to the color image. According to one embodiment of the application, differences between a plurality of tone filter images and channel sub-images are respectively compared to obtain a plurality of color weight images, and the method specifically comprises the steps of determining reference tone values of the tone filter images, respectively comparing the reference tone values with the tone values of the channel sub-images to obtain a plurality of tone comparison results, and generating the color weight images respectively corresponding to the tone filter images based on the tone comparison results. According to one embodiment of the application, the tone comparison result comprises tone value differences of all pixel points, a color weight image corresponding to each tone filter image is generated based on the tone comparison results, specifically, the method comprises the steps of carrying out operation processing on the tone value differences of all pixel points corresponding to any tone filter image to obtain color weights corresponding to all pixel points in the tone filter image, wherein the smaller the difference between the tone value of a channel sub-image and any reference tone value is, the larger the color weights corresponding to the corresponding tone filter image are, and the color weight image corresponding to each tone filter image is generated based on the color weights corresponding to all pixel points. According to one embodiment of the application, a first color weight coefficient is determined based on a plurality of color weight images, and specifically comprises the steps of acquiring a plurality of color weight values corresponding to pixel points from the plurality of color weight images for any pixel point in the color images, and carrying out fusion calculation on the plurality of color weight values to obtain the first color weight coefficient corresponding to the pixel point. According to one e