CN114723632A - Part abnormal exposure image correction method and device based on texture information - Google Patents

Part abnormal exposure image correction method and device based on texture information Download PDF

Info

Publication number
CN114723632A
CN114723632A CN202210348628.5A CN202210348628A CN114723632A CN 114723632 A CN114723632 A CN 114723632A CN 202210348628 A CN202210348628 A CN 202210348628A CN 114723632 A CN114723632 A CN 114723632A
Authority
CN
China
Prior art keywords
image
texture
exposure
integrity
images
Prior art date
Legal status (The legal status 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 status listed.)
Granted
Application number
CN202210348628.5A
Other languages
Chinese (zh)
Other versions
CN114723632B (en
Inventor
黄桂华
高航
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Anhui Zhongke Zhibo Technology Development Co ltd
Original Assignee
Nantong Jixing Fastener Technology Co ltd
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 Nantong Jixing Fastener Technology Co ltd filed Critical Nantong Jixing Fastener Technology Co ltd
Priority to CN202210348628.5A priority Critical patent/CN114723632B/en
Publication of CN114723632A publication Critical patent/CN114723632A/en
Application granted granted Critical
Publication of CN114723632B publication Critical patent/CN114723632B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T5/00Image enhancement or restoration
    • G06T5/90Dynamic range modification of images or parts thereof
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T5/00Image enhancement or restoration
    • G06T5/40Image enhancement or restoration using histogram techniques
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T5/00Image enhancement or restoration
    • G06T5/50Image enhancement or restoration using two or more images, e.g. averaging or subtraction
    • 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/10004Still image; Photographic image
    • 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

Landscapes

  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Image Processing (AREA)
  • Studio Devices (AREA)
  • Facsimile Image Signal Circuits (AREA)

Abstract

The invention discloses a method and a device for correcting abnormal exposure images of parts based on texture information, relating to the field of computer vision; the overexposed area and the underexposed area in the abnormal exposure image can be corrected simultaneously. The method mainly comprises the following steps: acquiring a first image and an exposure value of the first image; obtaining texture integrity and a correction necessity index of the first image according to the edge feature of the first image and the frequency of gray values in a gray histogram of the first image, and correcting the first image when the correction necessity index is larger than a preset first threshold; obtaining a lower limit and an upper limit of an adjusting value according to the texture integrity of the first image, and obtaining an exposure value range; adjusting the exposure value of the first image to obtain a plurality of second images with different exposure values; and calculating the fusion weight of the second images, and fusing the plurality of second images according to the fusion weight to obtain the corrected first image. The specific application scenarios of the invention are as follows: and correcting the abnormally exposed image.

Description

一种基于纹理信息的零件异常曝光图像修正方法及装置A method and device for correcting abnormal exposure images of parts based on texture information

技术领域technical field

本申请涉及计算机视觉领域,具体涉及一种基于纹理信息的零件异常曝光图像修正方法及装置。The present application relates to the field of computer vision, in particular to a method and device for correcting abnormal exposure images of parts based on texture information.

背景技术Background technique

在对零件进行拍摄的过程中,因光线强度及光源角度的影响,得到的零件图像会存在异常曝光现象,异常曝光包括曝光过度及曝光不足,曝光过度或曝光不足均会导致得到的零件图像无法呈现零件的完整纹理细节;同时零件表面存在反光,使得拍摄到的零件图像存在很多反光区域,但通过降低拍摄时的曝光值来减少反光区域的同时,会使得拍摄到的零件图像中存在大量暗区,因此需要对存在异常曝光的零件图像进行修正,使得拍摄得到的零件图像呈现零件完整的纹理细节。In the process of shooting parts, due to the influence of light intensity and light source angle, the obtained part image will have abnormal exposure phenomenon. Abnormal exposure includes overexposure and underexposure. Overexposure or underexposure will cause the obtained part image to fail. The complete texture details of the part are presented; at the same time, there is reflection on the surface of the part, so that there are many reflective areas in the captured part image, but by reducing the exposure value during shooting to reduce the reflective area, there will be a lot of darkness in the captured part image. Therefore, it is necessary to correct the part image with abnormal exposure, so that the captured part image presents the complete texture details of the part.

现有技术中为了解决上述问题,通常通过改变图像整体的曝光量,使图像整体的曝光量达到一个较为合适的曝光量,该种方式会使图像中曝光过度的部分曝光度进一步增大,或者使得图像中曝光不足的部分的曝光度进一步减小,无法同时对图像中曝光过度部分及曝光不足部分同时进行修正,无法达到较好的异常曝光图像修正效果。In order to solve the above problems in the prior art, usually by changing the overall exposure of the image, the overall exposure of the image reaches a more appropriate exposure, and this method will further increase the exposure of the overexposed part of the image, or The exposure of the underexposed part in the image is further reduced, the overexposed part and the underexposed part in the image cannot be corrected at the same time, and a better abnormal exposure image correction effect cannot be achieved.

发明内容SUMMARY OF THE INVENTION

针对上述技术问题,本发明提供了一种基于纹理信息的零件异常曝光图像修正方法及装置。In view of the above technical problems, the present invention provides a method and device for correcting abnormal exposure images of parts based on texture information.

第一方面,本文提出了一种基于纹理信息的零件异常曝光图像修正方法,包括:In the first aspect, this paper proposes a method for correcting abnormal exposure images of parts based on texture information, including:

获取第一图像以及第一图像的曝光值,所述第一图像指待修正的异常曝光图像。Acquire a first image and an exposure value of the first image, where the first image refers to an abnormally exposed image to be corrected.

根据所述第一图像的边缘特征及第一图像的灰度直方图中灰度值的频率,获得所述第一图像的纹理完整度,并根据所述第一图像的纹理完整度获得修正必要性指标,当所述修正必要性指标大于预设第一阈值时对所述第一图像进行修正。According to the edge feature of the first image and the frequency of the gray value in the gray histogram of the first image, the texture integrity of the first image is obtained, and the necessary correction is obtained according to the texture integrity of the first image. The first image is corrected when the correction necessity index is greater than a preset first threshold.

根据所述第一图像的纹理完整度获得调整值下限及调整值上限,并根据所述调整值下限、所述调整值上限以及所述第一图像的曝光值,获得曝光值范围。The lower limit of the adjustment value and the upper limit of the adjustment value are obtained according to the texture integrity of the first image, and the range of exposure values is obtained according to the lower limit of the adjustment value, the upper limit of the adjustment value and the exposure value of the first image.

对所述第一图像的曝光值进行调整,获得不同曝光值的多个第二图像,所述第二图像的曝光值位于所述曝光值范围内。The exposure value of the first image is adjusted to obtain a plurality of second images with different exposure values, and the exposure values of the second images are within the exposure value range.

按照获取第一图像的纹理完整度的方法获得每张所述第二图像的纹理完整度,并根据所述每张第二图像的纹理完整度,获得每张所述第二图像的融合权重。The texture integrity of each second image is obtained according to the method of obtaining the texture integrity of the first image, and the fusion weight of each second image is obtained according to the texture integrity of each second image.

对得到的所有第二张图像的融合权重进行融合叠加得到第一图像的像素值,完成对所述第一图像的修正。The obtained fusion weights of all the second images are fused and superposed to obtain the pixel values of the first image, and the correction of the first image is completed.

进一步的,所述基于纹理信息的零件异常曝光图像修正方法,所述第一图像/第二图像的纹理完整度是由第一图像/第二图像的亮区域的纹理完整性和暗区域的纹理完整性得到的,具体的方法包括:Further, in the method for correcting abnormal exposure images of parts based on texture information, the texture integrity of the first image/second image is determined by the texture integrity of the bright area and the texture of the dark area of the first image/second image. The completeness is obtained, and the specific methods include:

获得所述第一图像/第二图像的灰度图像,并根据所述灰度图像获得亮区域图像和暗区域图像,所述亮区域图像包含所述灰度图像中的亮区域,所述暗区域图像包含所述灰度图像中的暗区域。Obtain a grayscale image of the first image/second image, and obtain a bright area image and a dark area image according to the grayscale image, the bright area image includes the bright area in the grayscale image, and the dark area image The area image contains dark areas in the grayscale image.

根据所述亮区域图像的纹理信息,获得亮区域的纹理完整性。According to the texture information of the bright area image, the texture integrity of the bright area is obtained.

根据所述暗区域图像的纹理信息,获得暗区域的纹理完整性。According to the texture information of the dark area image, the texture integrity of the dark area is obtained.

根据所述亮区域的纹理完整性及所述暗区域的纹理完整性,获得所述纹理完整度。The texture integrity is obtained according to the texture integrity of the light area and the texture integrity of the dark area.

进一步的,所述基于纹理信息的零件异常曝光图像修正方法,所述纹理完整性的获取过程,包括:Further, in the method for correcting abnormal exposure images of parts based on texture information, the acquisition process of the texture integrity includes:

根据亮区域图像/暗区域图像的纹理特征,获取亮区域图像/暗区域图像的纹理丰富度及纹理均匀程度。According to the texture features of the bright area image/dark area image, the texture richness and texture uniformity of the bright area image/dark area image are obtained.

将所述纹理丰富度及所述纹理均匀度相乘,得到亮区域图像/暗区域图像的所述纹理完整性。Multiply the texture richness and the texture uniformity to obtain the texture integrity of the light area image/dark area image.

进一步的,所述基于纹理信息的零件异常曝光图像修正方法,所述纹理丰富度的获取过程,包括:Further, in the method for correcting abnormal exposure images of parts based on texture information, the acquisition process of the texture richness includes:

将亮区域图像/暗区域图像中,所有像素点中灰度值的最大值与灰度值的最小值相减,得到灰度值宽度。In the bright area image/dark area image, the maximum value of the gray value in all pixels is subtracted from the minimum value of the gray value to obtain the width of the gray value.

根据亮区域图像/暗区域图像的灰度直方图中,不同灰度值的出现次数的方差,得到直方图均匀程度。According to the variance of the number of occurrences of different gray values in the gray histogram of the bright area image/dark area image, the degree of uniformity of the histogram is obtained.

将所述灰度值宽度与所述直方图均匀程度相乘,得到纹理丰富度。Multiply the gray value width by the histogram uniformity to obtain texture richness.

进一步的,所述基于纹理信息的零件异常曝光图像修正方法,所述纹理均匀程度的获得方法,包括:Further, the method for correcting abnormal exposure images of parts based on texture information, and the method for obtaining the degree of texture uniformity, include:

对亮区域图像/暗区域图像进行边缘检测,得到亮区域图像/暗区域图像的边缘特征点。Perform edge detection on the bright area image/dark area image to obtain the edge feature points of the bright area image/dark area image.

将亮区域图像/暗区域图像中边缘特征点的八邻域像素点,以及自身像素点共九个像素点中边缘特征点的个数作为边缘特征点的频率。The number of edge feature points in the eight neighborhood pixels of edge feature points in the bright area image/dark area image, and the number of edge feature points in a total of nine pixel points of its own pixel point is taken as the frequency of edge feature points.

根据亮区域图像/暗区域图像中行的边缘特征点的频率,以及行的边缘特征点的行距离特征,获得边缘特征点的行分布均匀程度。According to the frequency of the edge feature points of the line in the bright area image/dark area image, and the line distance feature of the edge feature point of the line, the uniformity of the line distribution of the edge feature points is obtained.

根据亮区域图像/暗区域图像中列的边缘特征点的频率,以及列的边缘特征点的列距离特征,获得边缘特征点的列分布均匀程度。According to the frequency of the column edge feature points in the bright area image/dark area image, and the column distance feature of the column edge feature points, the uniformity of the column distribution of the edge feature points is obtained.

将所述边缘特征点的行分布均匀程度与列分布均匀程度相乘,获得所述纹理均匀程度。The uniformity of the texture is obtained by multiplying the uniformity of the row distribution of the edge feature points by the uniformity of the column distribution.

进一步的,所述基于纹理信息的零件异常曝光图像修正方法,所述行距离特征指的是,边缘特征点到同一行相邻的其他边缘特征点之间的距离,或边缘特征点到亮区域图像/暗区域图像的边界的距离。Further, in the method for correcting abnormal exposure images of parts based on texture information, the row distance feature refers to the distance between the edge feature point and other adjacent edge feature points in the same row, or the edge feature point to the bright area. The distance to the border of the image/dark area image.

所述列距离特征指的是,边缘特征点到同一列相邻的其他边缘特征点之间的距离,或边缘特征点到亮区域图像/暗区域图像的边界的距离。The column distance feature refers to the distance between the edge feature point and other adjacent edge feature points in the same column, or the distance between the edge feature point and the boundary of the bright area image/dark area image.

进一步的,所述基于纹理信息的零件异常曝光图像修正方法,所述对得到的所有第二张图像的融合权重进行融合叠加得到第一图像的像素值,完成对所述第一图像的修正,包括:Further, in the method for correcting abnormal exposure images of parts based on texture information, the obtained fusion weights of all second images are fused and superposed to obtain pixel values of the first image, and the correction of the first image is completed, include:

所述融合权重包括,暗区域融合权重以及亮区域融合权重。The fusion weight includes a dark area fusion weight and a bright area fusion weight.

利用所述暗区域融合权重,对所述第二图像的灰度图像中的暗区域,对应的所述第二图像中的区域进行加权融合。Using the dark area fusion weight, weighted fusion is performed on the dark area in the grayscale image of the second image and the corresponding area in the second image.

利用所述亮区域融合权重,对所述第二图像的灰度图像中的亮区域,对应的所述第二图像中的区域进行加权融合。Using the bright area fusion weight, weighted fusion is performed on the bright area in the grayscale image of the second image and the corresponding area in the second image.

第二方面,本发明提出了一种基于纹理信息的零件异常曝光图像修正装置,包括:In the second aspect, the present invention provides a device for correcting abnormal exposure images of parts based on texture information, including:

图像及曝光值获取模块,用于获取第一图像以及第一图像的曝光值,所述第一图像指待修正的异常曝光图像。The image and exposure value acquisition module is configured to acquire a first image and an exposure value of the first image, where the first image refers to an abnormally exposed image to be corrected.

图像及曝光值获取模块,用于获取第一图像以及第一图像的曝光值,所述第一图像指待修正的异常曝光图像;an image and exposure value acquisition module, configured to acquire a first image and an exposure value of the first image, where the first image refers to an abnormally exposed image to be corrected;

第一计算模块,用于根据所述第一图像的边缘特征及第一图像的灰度直方图中灰度值的频率,获得所述第一图像的纹理完整度,并根据所述第一图像的纹理完整度获得修正必要性指标,当所述修正必要性指标大于预设第一阈值时对所述第一图像进行修正;a first calculation module, configured to obtain the texture integrity of the first image according to the edge feature of the first image and the frequency of the gray value in the gray histogram of the first image, and according to the first image Obtaining a correction necessity index based on the texture integrity of the first image, and correcting the first image when the correction necessity index is greater than a preset first threshold;

第二计算模块,用于根据所述第一图像的纹理完整度获得调整值下限及调整值上限,并根据所述调整值下限、所述调整值上限以及所述第一图像的曝光值,获得曝光值范围;The second calculation module is configured to obtain the lower limit of the adjustment value and the upper limit of the adjustment value according to the texture integrity of the first image, and obtain the lower limit of the adjustment value, the upper limit of the adjustment value and the exposure value of the first image according to the lower limit of the adjustment value, the upper limit of the adjustment value and the exposure value of the first image. exposure value range;

图像生成模块,用于对所述第一图像的曝光值进行调整,获得不同曝光值的多个第二图像,所述第二图像的曝光值位于所述曝光值范围内;an image generation module, configured to adjust the exposure value of the first image to obtain a plurality of second images with different exposure values, and the exposure values of the second images are within the exposure value range;

第三计算模块,用于按照获取第一图像的纹理完整度的方法获得每张所述第二图像的纹理完整度,并根据所述每张第二图像的纹理完整度,获得每张所述第二图像的融合权重;A third computing module, configured to obtain the texture integrity of each of the second images according to the method of obtaining the texture integrity of the first image, and to obtain the texture integrity of each of the second images according to the texture integrity of each of the second images. the fusion weight of the second image;

图像修正模块,用于对得到的所有第二张图像的融合权重进行融合叠加得到第一图像的像素值,完成对所述第一图像的修正。The image correction module is used for fusing and superposing the obtained fusion weights of all the second images to obtain the pixel values of the first image, so as to complete the correction of the first image.

针对上述技术问题,本发明提供了一种基于纹理信息的零件异常曝光图像修正方法及装置,主要包括:In view of the above technical problems, the present invention provides a method and device for correcting abnormal exposure images of parts based on texture information, which mainly include:

获取第一图像以及第一图像的曝光值,第一图像指待修正的异常曝光图像;根据第一图像的边缘特征及第一图像的灰度直方图中灰度值的频率,获得第一图像的纹理完整度,并根据第一图像的纹理完整度获得修正必要性指标,当修正必要性指标大于预设第一阈值时对第一图像进行修正;根据第一图像的纹理完整度获得调整值下限及调整值上限,并根据调整值下限、调整值上限以及第一图像的曝光值,获得曝光值范围;对第一图像的曝光值进行调整,获得不同曝光值的多个第二图像,第二图像的曝光值位于曝光值范围内;按照获取第一图像的纹理完整度的方法获得每张第二图像的纹理完整度,并根据每张第二图像的纹理完整度,获得每张第二图像的融合权重;对得到的所有第二张图像的融合权重进行融合叠加得到第一图像的像素值,完成对第一图像的修正。Obtain the first image and the exposure value of the first image, where the first image refers to the abnormally exposed image to be corrected; obtain the first image according to the edge feature of the first image and the frequency of the gray value in the gray histogram of the first image The texture integrity of the first image is obtained, and the correction necessity index is obtained according to the texture integrity of the first image. When the correction necessity index is greater than the preset first threshold, the first image is corrected; the adjustment value is obtained according to the texture integrity of the first image. The lower limit and the upper limit of the adjustment value are obtained, and the exposure value range is obtained according to the lower limit of the adjustment value, the upper limit of the adjustment value and the exposure value of the first image; the exposure value of the first image is adjusted to obtain a plurality of second images with different exposure values. The exposure value of the two images is within the exposure value range; the texture integrity of each second image is obtained according to the method of obtaining the texture integrity of the first image, and the texture integrity of each second image is obtained according to the texture integrity of each second image. The fusion weight of the image; the fusion weight of all the obtained second images is fused and superimposed to obtain the pixel value of the first image, and the correction of the first image is completed.

相比于现有技术,本发明的有益效果是:利用采集到的零件图像中的纹理信息判断是否存在异常曝光,能够避免对无需进行修正的图像进行不必要的处理;利用图像的纹理信息得到曝光值范围,对曝光值范围内的不同曝光值下的,多张图像中的过曝区域和欠曝区域进行加权融合,能够对异常曝光图像中的过曝区域和欠曝区域同时进行修正,使得图像修正过程更具针对性和准确性。Compared with the prior art, the present invention has the beneficial effects of: using the texture information in the collected part images to determine whether there is abnormal exposure, it is possible to avoid unnecessary processing of images that do not need to be corrected; Exposure value range, weighted fusion of overexposed areas and underexposed areas in multiple images under different exposure values within the exposure value range, can correct the overexposed areas and underexposed areas in abnormally exposed images at the same time, It makes the image correction process more targeted and accurate.

附图说明Description of drawings

为了更清楚地说明本发明实施例或现有技术中的技术方案,下面将对实施例或现有技术描述中所需要使用的附图作简单地介绍,显而易见地,下面描述中的附图仅仅是本发明的一些实施例,对于本领域普通技术人员来讲,在不付出创造性劳动性的前提下,还可以根据这些附图获得其他的附图。In order to explain the embodiments of the present invention or the technical solutions in the prior art more clearly, the following briefly introduces the accompanying drawings that need to be used in the description of the embodiments or the prior art. Obviously, the accompanying drawings in the following description are only These are some embodiments of the present invention, and for those of ordinary skill in the art, other drawings can also be obtained from these drawings without any creative effort.

图1是本发明实施例1提供的一种基于纹理信息的零件异常曝光图像修正方法的流程示意图。FIG. 1 is a schematic flowchart of a method for correcting abnormal exposure images of parts based on texture information according to Embodiment 1 of the present invention.

图2是本发明实施例2提供的一种基于纹理信息的零件异常曝光图像修正装置的流程示意图。FIG. 2 is a schematic flowchart of an image correction device for abnormal exposure of parts based on texture information according to Embodiment 2 of the present invention.

具体实施方式Detailed ways

为了使本发明的目的、技术方案及优点更加清楚明白,以下结合附图及实施例,对本发明进行进一步详细说明。应当理解,此处所描述的具体实施例仅用以解释本发明,并不用于限定本发明。基于本发明中的实施例,本领域普通技术人员在没有做出创造性劳动前提下所获得的所有其他实施例,都属于本发明保护的范围。In order to make the objectives, technical solutions and advantages of the present invention clearer, the present invention will be further described in detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present invention, but not to limit the present invention. Based on the embodiments of the present invention, all other embodiments obtained by those of ordinary skill in the art without creative efforts shall fall within the protection scope of the present invention.

以下描述中,为了说明而不是为了限定,提出了诸如特定系统结构、技术之类的具体细节,以便透彻理解本申请实施例。然而,本领域的技术人员应当清楚,在没有这些具体细节的其它实施例中也可以实现本申请。在其它情况中,省略对众所周知的系统、装置、电路以及方法的详细说明,以免不必要的细节妨碍本申请的描述。In the following description, for the purpose of illustration rather than limitation, specific details such as a specific system structure and technology are set forth in order to provide a thorough understanding of the embodiments of the present application. However, it will be apparent to those skilled in the art that the present application may be practiced in other embodiments without these specific details. In other instances, detailed descriptions of well-known systems, devices, circuits, and methods are omitted so as not to obscure the description of the present application with unnecessary detail.

术语“第一”、“第二”仅用于描述目的,而不能理解为指示或暗示相对重要性或者隐含指明所指示的技术特征的数量。由此,限定有“第一”、“第二”的特征可以明示或者隐含地包括一个或者更多个该特征;在本实施例的描述中,除非另有说明,“多个”的含义是两个或两个以上。The terms "first" and "second" are only used for descriptive purposes, and should not be construed as indicating or implying relative importance or implicitly indicating the number of technical features indicated. Therefore, the features defined with "first" and "second" may explicitly or implicitly include one or more of the features; in the description of this embodiment, unless otherwise specified, the meaning of "multiple" are two or more.

实施例1Example 1

本发明实施例1提供了一种基于纹理信息的零件异常曝光图像修正方法,如图1所示,包括:Embodiment 1 of the present invention provides a method for correcting abnormal exposure images of parts based on texture information, as shown in FIG. 1 , including:

101、获取第一图像以及第一图像的曝光值,第一图像指待修正的异常曝光图像。101. Acquire a first image and an exposure value of the first image, where the first image refers to an abnormally exposed image to be corrected.

利用图像采集设备获取待修正的异常曝光图像即第一图像,第一图像为RGB格式,RGB是一种颜色标准,通过对红(R)、绿(G)、蓝(B)三个颜色通道的变化以及它们相互之间的叠加来得到各式各样的颜色,RGB即是代表红、绿、蓝三个通道的颜色。The abnormal exposure image to be corrected, that is, the first image, is obtained by using an image acquisition device. The first image is in RGB format. RGB is a color standard. RGB is the color representing the three channels of red, green and blue.

102、根据第一图像的边缘特征及第一图像的灰度直方图中灰度值的频率,获得第一图像的纹理完整度,并根据第一图像的纹理完整度获得修正必要性指标,当修正必要性指标大于预设第一阈值时对第一图像进行修正。102. Obtain the texture integrity of the first image according to the edge features of the first image and the frequency of the gray values in the gray histogram of the first image, and obtain the correction necessity index according to the texture integrity of the first image, when When the correction necessity index is greater than the preset first threshold, the first image is corrected.

本实施例中102具体包括1021、1022及1023。In this embodiment, 102 specifically includes 1021 , 1022 and 1023 .

1021、获得第一图像的灰度图像,并根据灰度图像获得亮区域图像和暗区域图像。1021. Obtain a grayscale image of the first image, and obtain a bright area image and a dark area image according to the grayscale image.

具体的,为了分割出第一图像的灰度图片中的亮区域以及暗区域,本实施例中给定亮区域的分割阈值范围以及暗区域的分割阈值范围,其中亮区域的灰度分割阈值范围为[204,255],暗区域的灰度分割阈值范围为[0,51]。Specifically, in order to segment the bright area and the dark area in the grayscale picture of the first image, the segmentation threshold range of the bright area and the segmentation threshold range of the dark area are given in this embodiment, wherein the grayscale segmentation threshold range of the bright area is is [204, 255], and the gray-scale segmentation threshold range of dark areas is [0, 51].

需要说明的是,将第一图像的灰度图像中灰度值在阈值范围[0,51]的像素点保留,将在像素点的灰度值在阈值范围(51,255]内的像素点设置为0,得到暗区域图像。It should be noted that, in the grayscale image of the first image, the pixels whose grayscale values are in the threshold range [0, 51] are retained, and the pixels whose grayscale values are in the threshold range (51, 255) are retained. Set to 0 to get a dark area image.

具体的,将第一图像的灰度图像中灰度值在阈值范围[204,255]的像素点保留,将在像素点的灰度值在阈值范围[0,204)内的像素点设置为0,得到亮区域图像。亮区域图像包含第一图像的灰度图像中的亮区域,暗区域图像包含第一图像的灰度图像中的暗区域。Specifically, in the grayscale image of the first image, the pixels whose grayscale values are in the threshold range [204, 255] are reserved, and the pixels whose grayscale values are in the threshold range [0, 204) are set as 0, get the bright area image. The bright area image includes the bright area in the grayscale image of the first image, and the dark area image includes the dark area in the grayscale image of the first image.

具体的,本实施例中通过图像的灰度值获得第一图像中的亮度信息,第一图像的灰度图像中的亮区域对应第一图像中的过曝区域;第一图像的灰度图像中的暗区域对应第一图像中的欠曝区域。Specifically, in this embodiment, the brightness information in the first image is obtained through the grayscale value of the image, and the bright area in the grayscale image of the first image corresponds to the overexposed area in the first image; the grayscale image of the first image corresponds to the overexposed area in the first image; The dark areas in correspond to the underexposed areas in the first image.

1022、根据亮区域图像的纹理信息,获得亮区域的纹理完整性;并根据暗区域图像的纹理信息,获得暗区域的纹理完整性。1022. Obtain the texture integrity of the bright region according to the texture information of the bright region image; and obtain the texture integrity of the dark region according to the texture information of the dark region image.

需要说明的是,本实施例中暗区域的纹理完整性的获取方法,与亮区域的纹理完整性的获取方法相同,只是针对的目标图像不同,纹理完整性的计算方法具体包括10221、10222及10223,纹理完整性能够反映图像中纹理的完整程度,纹理完整性主要包括纹理丰富程度和纹理均匀程度。It should be noted that the acquisition method of the texture integrity of the dark area in this embodiment is the same as the acquisition method of the texture integrity of the bright area, but the target image is different. The calculation method of the texture integrity specifically includes 10221, 10222 and 10223, the texture integrity can reflect the completeness of the texture in the image, and the texture integrity mainly includes the richness of the texture and the uniformity of the texture.

10221、获得亮区域图像/暗区域图像的纹理丰富度。10221. Obtain the texture richness of the bright area image/dark area image.

具体的,本实施例中亮区域图像/暗区域图像为亮区域图像或暗区域图像。由于光线的影响,亮区域或者暗区域的部分纹理丢失,导致纹理分布不均匀,因而需提取纹理均匀程度。Specifically, in this embodiment, the bright area image/dark area image is a bright area image or a dark area image. Due to the influence of light, part of the texture in the bright area or the dark area is lost, resulting in uneven texture distribution, so it is necessary to extract the texture uniformity.

首先,将亮区域图像/暗区域图像中,所有像素点中灰度值的最大值与灰度值的最小值相减,得到灰度值宽度。First, in the bright area image/dark area image, the maximum value of the gray value in all pixels is subtracted from the minimum value of the gray value to obtain the width of the gray value.

需要说明的是,对于亮区域图像及暗区域图像的纹理丰富度的计算方法相同,下面以亮区域图像为例,具体阐述纹理丰富度的获得方法。It should be noted that the calculation methods for the texture richness of the bright area image and the dark area image are the same, and the method for obtaining the texture richness is specifically described below by taking the bright area image as an example.

具体的,将亮区域图像中灰度值的最大值和灰度值的最小值相减,得到亮区域图像的灰度值取值宽度为wl。将暗区域图像中的灰度值的最大值和灰度值的最小值相减得到暗区域图像的灰度值取值宽度wa。Specifically, the maximum value of the gray value in the bright area image is subtracted from the minimum value of the gray value, and the width of the gray value of the bright area image is obtained as wl. The gray value width wa of the dark area image is obtained by subtracting the maximum value of the gray value and the minimum value of the gray value in the dark area image.

其次,根据亮区域图像/暗区域图像的灰度直方图中,不同灰度值的出现次数的方差,得到直方图均匀程度,纹理的丰富度主要反映在直方图上,直方图中包含的灰度信息越丰富,纹理特征越丰富。将灰度值宽度与直方图均匀程度相乘,得到纹理丰富度。Secondly, according to the variance of the number of occurrences of different gray values in the gray histogram of the bright area image/dark area image, the uniformity of the histogram is obtained, and the richness of texture is mainly reflected in the histogram. The richer the degree information, the richer the texture features. Multiply the gray value width by the histogram uniformity to get the texture richness.

具体的,获得亮区域图像的灰度直方图,计算该直方图的频率均值

Figure BDA0003578171970000061
其中p(hj)为亮区域图像的灰度直方图中第j个灰度值hj对应的频率值,wl为亮区域图像的灰度值取值宽度。计算该亮区域图像的灰度直方图的频率的方差
Figure BDA0003578171970000062
因而亮区域的灰度直方图均匀程度为
Figure BDA0003578171970000063
Specifically, the grayscale histogram of the bright area image is obtained, and the frequency mean of the histogram is calculated
Figure BDA0003578171970000061
where p(h j ) is the frequency value corresponding to the jth gray value h j in the gray histogram of the bright area image, and wl is the width of the gray value of the bright area image. Calculate the variance of the frequency of the grayscale histogram of the bright area image
Figure BDA0003578171970000062
Therefore, the uniformity of the gray histogram of the bright area is
Figure BDA0003578171970000063

需要说明的是,按照与亮区域灰度图像的灰度直方图均匀程度,相同的获取方法可以得到暗区域图像的灰度直方图均匀程度jh2。It should be noted that, according to the uniformity degree of the grayscale histogram of the grayscale image in the bright area, the uniformity degree jh2 of the grayscale histogram of the grayscale image in the dark area can be obtained by the same acquisition method.

具体的,亮区域图像的纹理完整性为ff1=wl*jh1,其中wl为亮区域图像的灰度值宽度,jh1为亮区域图像的灰度直方图均匀程度;同时暗区域图像的纹理丰富度ff2=wa*jh2,其中wa为暗区域图像的灰度值宽度,jh2为暗区域图像的灰度直方图均匀程度。Specifically, the texture integrity of the image in the bright area is ff1=wl*jh1, where wl is the gray value width of the image in the bright area, and jh1 is the uniformity of the gray histogram of the image in the bright area; meanwhile, the texture richness of the image in the dark area is ff2=wa*jh2, where wa is the gray value width of the dark area image, and jh2 is the uniformity of the gray histogram of the dark area image.

10222、获得亮区域图像/暗区域图像的纹理均匀程度。10222. Obtain the texture uniformity of the bright area image/dark area image.

具体的,纹理的均匀程度主要通过纹理像素间的距离信息和纹理频率差异性信息来体现。纹理的距离信息通过距离大小和距离偏差来反应,纹理像素距离越大纹理分布越不均匀。每行或列的纹理像素距离偏差越大,说明该行或列的纹理分布越不均匀。每行或列的像素纹理的密度差异性越大,说明该行或者列的纹理分布越不均匀。Specifically, the uniformity of the texture is mainly reflected by the distance information between the texture pixels and the texture frequency difference information. The distance information of the texture is reflected by the distance size and distance deviation. The larger the texel distance is, the more uneven the texture distribution is. The larger the texel distance deviation of each row or column, the more uneven the texture distribution of the row or column. The greater the density difference of the pixel texture of each row or column, the more uneven the texture distribution of the row or column.

需要说明的是,对于亮区域图像及暗区域图像的纹理均匀程度的计算方法相同,下面以亮区域图像为例,具体阐述纹理均匀程度的获得方法。It should be noted that the calculation methods for the texture uniformity of the bright area image and the dark area image are the same, and the following takes the bright area image as an example to specifically describe the method for obtaining the texture uniformity.

首先,对亮区域图像进行边缘检测,获得亮区域图像中的边缘特征点,本实施例中利用sober算子对亮区域图像进行处理其中的边缘特征点。First, edge detection is performed on the bright area image to obtain edge feature points in the bright area image. In this embodiment, the sober operator is used to process the edge feature points in the bright area image.

然后,将亮区域图像中边缘特征点的八邻域像素点,以及自身像素点共九个像素点中边缘特征点的个数作为边缘特征点的频率;根据边缘特征点的频率以及行的边缘特征点的行距离特征,获得边缘特征点的行分布均匀程度;根据边缘特征点的频率以及列的边缘特征点的列距离特征,获得边缘特征点的列分布均匀程度。Then, the number of edge feature points in the eight neighborhood pixels of edge feature points in the bright area image and the number of edge feature points in a total of nine pixels of its own pixel points is used as the frequency of edge feature points; according to the frequency of edge feature points and the edge of the line The row distance feature of the feature points is used to obtain the row distribution uniformity of the edge feature points; the column distribution uniformity of the edge feature points is obtained according to the frequency of the edge feature points and the column distance feature of the column edge feature points.

具体的,获得每两个相邻边缘特征点之间的像素距离:假设在亮区域图像的第k行中,(k,i)和(k,j)处存在两相邻边缘特征点,这两边缘特征点之间的距离为d1kj=j-i。Specifically, obtain the pixel distance between every two adjacent edge feature points: Assuming that in the kth row of the bright area image, there are two adjacent edge feature points at (k, i) and (k, j), this The distance between two edge feature points is d1 kj =ji.

需要说明的是,当亮区域图像中(k,l)处的边缘特征点到图像边界之间,不存在其他边缘特征点时,其边缘特征之间像素距离为:该点至图像边界的最近距离,此时d1kl=min(l,M-l),其中M为图像的列数。It should be noted that when there are no other edge feature points between the edge feature point at (k, l) in the bright area image and the image boundary, the pixel distance between the edge features is: the closest point to the image boundary distance, at this time d1 kl =min(l, Ml), where M is the number of columns of the image.

进一步可得到亮区域图像中第k行中边缘特征点之间的距离序列;利用边缘特征点的频率,可以获得亮区域图像中第k行中边缘特征点的频率组成的序列,进一步可以计算亮区域图像中行边缘特征点的距离均值以及边缘特征点的距离偏差。Further, the distance sequence between the edge feature points in the kth row in the bright area image can be obtained; by using the frequency of the edge feature points, the sequence composed of the frequency of the edge feature points in the kth row in the bright area image can be obtained, and the bright area image can be further calculated. The mean distance of the line edge feature points in the area image and the distance deviation of the edge feature points.

具体的,亮区域图像中第k行的边缘特征点间的距离均值为

Figure BDA0003578171970000071
亮区域图像中第k行的边缘特征点间的距离偏差为
Figure BDA0003578171970000072
其中d1kh为亮区域图像中第行的第h个边缘特征点的距离值,此处r边缘特征点之间的距离序列中边缘特征点的距离值的个数。Specifically, the average distance between the edge feature points in the k-th row in the bright area image is
Figure BDA0003578171970000071
The distance deviation between the edge feature points of the kth row in the bright area image is
Figure BDA0003578171970000072
Among them, d1 kh is the distance value of the h-th edge feature point in the bright area image, where r is the distance between edge feature points in the distance sequence between edge feature points. The number of distance values.

需要说明的是,亮区域图像中第k行的边缘特征点的频率偏差值为

Figure BDA0003578171970000073
其中M为亮区域图像中的列数,f1kg为亮区域第k行第g列位置处边缘特征的频率值,
Figure BDA0003578171970000081
为第k行像素的频率均值。It should be noted that the frequency deviation of the edge feature point of the kth row in the bright area image is
Figure BDA0003578171970000073
where M is the number of columns in the bright area image, f1 kg is the frequency value of the edge feature at the position of the k-th row and the g-th column of the bright area,
Figure BDA0003578171970000081
is the frequency mean of the pixels in the kth row.

其次,亮区域图像中第k行的边缘特征点的分布均匀程度

Figure BDA0003578171970000082
其中σd1k为亮区域图像中第k行边缘特征点的距离偏差,σf1k为亮区域图像中第k行边缘特征的频率偏差。
Figure BDA0003578171970000083
为亮区域图像中第k行边缘特征点的距离均值。Secondly, the distribution uniformity of the edge feature points of the kth row in the bright area image
Figure BDA0003578171970000082
where σd1 k is the distance deviation of the edge feature points in the kth row in the bright area image, and σf1 k is the frequency deviation of the kth row edge feature in the bright area image.
Figure BDA0003578171970000083
is the mean distance of edge feature points in the kth row in the bright area image.

进一步的,亮区域图像中的行像素的边缘特征的分布均匀程度均值为

Figure BDA0003578171970000084
此处Jy1q为亮区域第q行边缘特征分布均匀程度,N为频率图像的行数,进一步可以得到亮区域图像中的列像素的边缘特征分布均匀程度均值
Figure BDA0003578171970000085
亮区域图像的边缘分布均匀程度为
Figure BDA0003578171970000086
最后将边缘特征点的行分布均匀程度与列分布均匀程度相乘,获得亮区域图像的纹理均匀程度Jy2。Further, the average distribution uniformity of the edge features of the row pixels in the bright area image is
Figure BDA0003578171970000084
Here Jy1 q is the uniformity of the edge feature distribution of the qth row in the bright area, and N is the number of rows in the frequency image. Further, the mean value of the uniformity of the edge feature distribution of the column pixels in the bright area image can be obtained.
Figure BDA0003578171970000085
The uniformity of the edge distribution of the bright area image is
Figure BDA0003578171970000086
Finally, the uniformity of the row distribution of the edge feature points is multiplied by the uniformity of the column distribution to obtain the texture uniformity of the bright area image Jy2.

进一步的,利用与亮区域图像纹理均匀程度相同的获取方法,可以得到暗区域的纹理均匀程度Jy2。Further, using the same acquisition method as the image texture uniformity degree of the bright area, the texture uniformity degree Jy2 of the dark area can be obtained.

10223、将纹理丰富度及纹理均匀度相乘,得到亮区域图像/暗区域图像的纹理完整性。10223. Multiply the texture richness and texture uniformity to obtain the texture integrity of the bright area image/dark area image.

亮区域的纹理完整性为Wz1=ff1*Jy1,其中ff1为亮区域图像的纹理丰富度,Jy1为亮区域图像的纹理均匀程度;暗区域的纹理完整性为Wz2=ff2*Jy2,其中ff2为暗区域图像的纹理丰富度,Jy2为暗区域图像的纹理均匀程度。The texture integrity of the bright area is Wz1=ff1*Jy1, where ff1 is the texture richness of the bright area image, and Jy1 is the texture uniformity of the bright area image; the texture integrity of the dark area is Wz2=ff2*Jy2, where ff2 is The texture richness of the dark area image, Jy2 is the texture uniformity of the dark area image.

1023、根据亮区域的纹理完整性及暗区域的纹理完整性,获得第一图像的纹理完整度。1023. Obtain the texture integrity of the first image according to the texture integrity of the bright area and the texture integrity of the dark area.

具体的,将亮区域的纹理完整性及暗区域的纹理完整性相加,得到第一图像的纹理完整度,纹理完整度能够反应第一图像即异常曝光图像的纹理信息。Specifically, the texture integrity of the bright area and the texture integrity of the dark area are added to obtain the texture integrity of the first image, and the texture integrity can reflect the texture information of the first image, that is, the abnormally exposed image.

需要说明的是,第一图像的纹理完整度的倒数为修正必要性指标,修正必要性指标能够反应对第一图像进行修正的必要性,判断修正必要性指标是否大于预设第一阈值,若判断结果为是,则需要对第一图像进行修正,若判断结果为否,说明该图像不存在异常曝光的情况,无需对其进行后续的修正。It should be noted that the reciprocal of the texture integrity of the first image is the correction necessity index, and the correction necessity index can reflect the necessity of correcting the first image, and it is determined whether the correction necessity index is greater than the preset first threshold. If the determination result is yes, the first image needs to be corrected, and if the determination result is no, it means that the image does not have abnormal exposure, and subsequent corrections are not required.

103、根据第一图像的纹理完整度获得调整值下限及调整值上限,并根据调整值下限、调整值上限以及第一图像的曝光值,获得曝光值范围。103. Obtain the lower limit of the adjustment value and the upper limit of the adjustment value according to the texture integrity of the first image, and obtain the exposure value range according to the lower limit of the adjustment value, the upper limit of the adjustment value and the exposure value of the first image.

具体的,α为调整值下限,β为调整值上限,α与第一图像中过曝区域的纹理信息有关,β与第一图像中欠曝区域的纹理信息有关;当亮区域中纹理信息缺失较为严重时,应该降低亮区域的曝光值;当暗区域中纹理信息缺失较为严重时,应该提高暗区域的曝光值。本实施例中调整值下限

Figure BDA0003578171970000087
调整值上限
Figure BDA0003578171970000088
其中Wz1为亮区域的纹理完整性,Wz2为暗区域的纹理完整性,
Figure BDA0003578171970000091
为常量参数可根据实施者具体需要进行选取。Specifically, α is the lower limit of the adjustment value, β is the upper limit of the adjustment value, α is related to the texture information of the overexposed area in the first image, and β is related to the texture information of the underexposed area in the first image; when the texture information in the bright area is missing When it is more serious, the exposure value of the bright area should be reduced; when the texture information in the dark area is more serious, the exposure value of the dark area should be increased. In this embodiment, the lower limit of the adjustment value
Figure BDA0003578171970000087
Adjustment value cap
Figure BDA0003578171970000088
where Wz1 is the texture integrity of the bright area, Wz2 is the texture integrity of the dark area,
Figure BDA0003578171970000091
The constant parameters can be selected according to the specific needs of the implementer.

进一步可以获得曝光值范围,[Bg-α,Bg+β,其中Bg为异常曝光图像即第一图像的曝光值。Further, the exposure value range can be obtained, [Bg-α, Bg+β, where Bg is the exposure value of the abnormally exposed image, that is, the first image.

104、对第一图像的曝光值进行调整,获得曝光值范围内的不同曝光值的多个第二图像。104. Adjust the exposure value of the first image to obtain multiple second images with different exposure values within the exposure value range.

具体的,根据103中获得的曝光值范围,在第一图像的基础上可以获取不同曝光值的多个第二图片,得到的第二图像与第一图像区别在于曝光值不同,且所有第二图像的曝光值均位于曝光值范围内。Specifically, according to the exposure value range obtained in 103, multiple second pictures with different exposure values can be obtained on the basis of the first image. The difference between the obtained second image and the first image is that the exposure value is different, and all the second images The exposure values of the images are all within the exposure value range.

105、按照获取第一图像的纹理完整度的方法获得每张第二图像的纹理完整度,并根据每张第二图像的纹理完整度,获得每张第二图像的融合权重。105. Obtain the texture integrity of each second image according to the method of acquiring the texture integrity of the first image, and obtain the fusion weight of each second image according to the texture integrity of each second image.

进一步的,利用本实施例102中的图像的纹理完整度的获取方法,可以获得每一个第二图像对应的亮区域图像的纹理完整性以及暗区域图像的纹理完整性。Further, by using the method for acquiring the texture integrity of the image in this embodiment 102, the texture integrity of the bright area image and the texture integrity of the dark area image corresponding to each second image can be obtained.

需要说明的是,第一图像的灰度图像中的亮区域对应第一图像中的过曝区域,第一图像的灰度图像中的暗区域对应第一图像中的欠曝区域,则第a张第二图像对于过曝区域的融合权重为:

Figure BDA0003578171970000092
第a张第二图像对于欠曝区域的融合权重
Figure BDA0003578171970000093
其中v表示第二图像的总数。It should be noted that the bright area in the grayscale image of the first image corresponds to the overexposed area in the first image, and the dark area in the grayscale image of the first image corresponds to the underexposed area in the first image, then the ath The fusion weight of the second image for the overexposed area is:
Figure BDA0003578171970000092
The fusion weight of the second image a for the underexposed area
Figure BDA0003578171970000093
where v represents the total number of second images.

106、对得到的所有第二张图像的融合权重进行融合叠加得到第一图像的像素值,完成对第一图像的修正。106. Perform fusion and superposition on the obtained fusion weights of all the second images to obtain pixel values of the first image, and complete the correction of the first image.

具体的,根据第二图像的融合权重,对第一图像中的过曝区域及欠曝区域进行融合,第一图像中的正常区域则保持不变,得到的图像即为修正后的第一图像。Specifically, according to the fusion weight of the second image, the overexposed area and the underexposed area in the first image are fused, the normal area in the first image remains unchanged, and the obtained image is the corrected first image .

需要和说明的是,第一图像中过曝区域中像素值的修正方式为

Figure BDA0003578171970000094
其中
Figure BDA0003578171970000095
表示第一图像的灰度图像中亮区域的像素点,在第a张第二图像中对应的像素点的像素值;第一图像中的欠曝区域中像素值的修正方式为
Figure BDA0003578171970000096
其中
Figure BDA0003578171970000097
表示第一图像的灰度图像中的暗区域的像素点,在第a张第二图像中对应的像素点的像素值;Xs1为第一图像中过曝区域经过修正后的像素值,Xs2为第一图像中欠曝区域经过修正后的像素值。It should be noted that the correction method of the pixel value in the overexposed area in the first image is as follows:
Figure BDA0003578171970000094
in
Figure BDA0003578171970000095
Indicates the pixel value of the pixel point in the bright area in the grayscale image of the first image, and the pixel value of the corresponding pixel point in the second image a; the correction method of the pixel value in the underexposed area in the first image is as follows
Figure BDA0003578171970000096
in
Figure BDA0003578171970000097
Indicates the pixel point of the dark area in the grayscale image of the first image, the pixel value of the corresponding pixel point in the second image a; Xs 1 is the corrected pixel value of the overexposed area in the first image, Xs 2 is the corrected pixel value of the underexposed area in the first image.

相比于现有技术,本发明的有益效果是:利用采集到的零件图像中的纹理信息判断是否存在异常曝光,能够避免对无需进行修正的图像进行不必要的处理;利用图像的纹理信息得到曝光值范围,对曝光值范围内的不同曝光值下的,多张图像中的过曝区域和欠曝区域进行加权融合,能够对异常曝光图像中的过曝区域和欠曝区域同时进行修正,使得图像修正过程更具针对性和准确性。Compared with the prior art, the present invention has the beneficial effects of: using the texture information in the collected part images to determine whether there is abnormal exposure, it is possible to avoid unnecessary processing of images that do not need to be corrected; Exposure value range, weighted fusion of overexposed areas and underexposed areas in multiple images under different exposure values within the exposure value range, can correct the overexposed areas and underexposed areas in abnormally exposed images at the same time, It makes the image correction process more targeted and accurate.

实施例2Example 2

本发明实施例2提供了一种基于纹理信息的零件异常曝光图像修正方法装置,如图2所示包括:Embodiment 2 of the present invention provides a method and device for correcting abnormal exposure images of parts based on texture information, as shown in FIG. 2 , including:

图像及曝光值获取模块21,用于获取第一图像以及第一图像的曝光值,第一图像指待修正的异常曝光图像。The image and exposure value acquisition module 21 is configured to acquire a first image and an exposure value of the first image, where the first image refers to an abnormally exposed image to be corrected.

第一计算模块22,用于根据第一图像的边缘特征及第一图像的灰度直方图中灰度值的频率,获得第一图像的纹理完整度,并根据第一图像的纹理完整度获得修正必要性指标,当修正必要性指标大于预设第一阈值时对第一图像进行修正。The first calculation module 22 is configured to obtain the texture integrity of the first image according to the edge features of the first image and the frequency of the gray value in the gray histogram of the first image, and obtain the texture integrity of the first image according to the texture integrity of the first image. Correcting the necessity index, and correcting the first image when the correction necessity index is greater than the preset first threshold.

第二计算模块23,用于根据第一图像的纹理完整度获得调整值下限及调整值上限,并根据调整值下限、调整值上限以及第一图像的曝光值,获得曝光值范围。The second calculation module 23 is configured to obtain the lower limit of the adjustment value and the upper limit of the adjustment value according to the texture integrity of the first image, and obtain the exposure value range according to the lower limit of the adjustment value, the upper limit of the adjustment value and the exposure value of the first image.

图像生成模块24,用于对第一图像的曝光值进行调整,获得不同曝光值的多个第二图像,第二图像的曝光值位于曝光值范围内。The image generation module 24 is configured to adjust the exposure value of the first image to obtain a plurality of second images with different exposure values, and the exposure values of the second images are within the exposure value range.

第三计算模块25,用于按照获取第一图像的纹理完整度的方法获得每张第二图像的纹理完整度,并根据每张第二图像的纹理完整度,获得每张第二图像的融合权重。The third calculation module 25 is configured to obtain the texture integrity of each second image according to the method of obtaining the texture integrity of the first image, and obtain the fusion of each second image according to the texture integrity of each second image Weights.

图像修正模块26,用于对得到的所有第二张图像的融合权重进行融合叠加得到第一图像的像素值,完成对第一图像的修正。The image correction module 26 is configured to fuse and superimpose the obtained fusion weights of all the second images to obtain the pixel values of the first image, and complete the correction of the first image.

综上所述,相比于现有技术,本发明的有益效果是:利用采集到的零件图像中的纹理信息判断是否存在异常曝光,能够避免对无需进行修正的图像进行不必要的处理;利用图像的纹理信息得到曝光值范围,对曝光值范围内的不同曝光值下的,多张图像中的过曝区域和欠曝区域进行加权融合,能够对异常曝光图像中的过曝区域和欠曝区域同时进行修正,使得图像修正过程更具针对性和准确性。To sum up, compared with the prior art, the beneficial effects of the present invention are: using the texture information in the collected part images to determine whether there is abnormal exposure, it is possible to avoid unnecessary processing of images that do not need to be corrected; The exposure value range is obtained from the texture information of the image, and the over-exposed and under-exposed areas in multiple images under different exposure values within the exposure value range are weighted and fused, and the over-exposed areas and under-exposed areas in abnormally exposed images can be fused. Areas are corrected at the same time, making the image correction process more targeted and accurate.

本发明中涉及诸如“包括”、“包含”、“具有”等等的词语是开放性词汇,指“包括但不限于”,且可与其互换使用。这里所使用的词汇“或”和“和”指词汇“和/或”,且可与其互换使用,除非上下文明确指示不是如此。这里所使用的词汇“诸如”指词组“诸如但不限于”,且可与其互换使用。Words such as "including", "comprising", "having", etc. referred to herein are open-ended words meaning "including but not limited to" and are used interchangeably therewith. As used herein, the words "or" and "and" refer to and are used interchangeably with the word "and/or" unless the context clearly dictates otherwise. As used herein, the word "such as" refers to and is used interchangeably with the phrase "such as but not limited to".

还需要指出的是,在本发明的方法和系统中,各部件或各步骤是可以分解和/或重新组合的。这些分解和/或重新组合应视为本公开的等效方案。It should also be pointed out that in the method and system of the present invention, each component or each step can be decomposed and/or recombined. These disaggregations and/or recombinations should be considered equivalents of the present disclosure.

上述实施例仅仅是为清楚地说明所做的举例,并不构成对本发明的保护范围的限制。对于所属领域的普通技术人员来说,在上述说明的基础上还可以做出其它不同形式的变化或变动,这里无需也无法对所有的实施方式予以穷举。凡是与本发明相同或相似的设计均属于本发明的保护范围之内。The above-mentioned embodiments are only examples for clear description, and do not limit the protection scope of the present invention. For those of ordinary skill in the art, changes or modifications in other different forms can also be made on the basis of the above description, and it is not necessary and impossible to list all the implementations here. All the same or similar designs as the present invention fall within the protection scope of the present invention.

Claims (8)

1.一种基于纹理信息的零件异常曝光图像修正方法,其特征在于,包括:1. a method for correcting abnormal exposure images of parts based on texture information, is characterized in that, comprising: 获取第一图像以及第一图像的曝光值,所述第一图像指待修正的异常曝光图像;acquiring a first image and an exposure value of the first image, where the first image refers to an abnormally exposed image to be corrected; 根据所述第一图像的边缘特征及第一图像的灰度直方图中灰度值的频率,获得所述第一图像的纹理完整度,并根据所述第一图像的纹理完整度获得修正必要性指标,当所述修正必要性指标大于预设第一阈值时对所述第一图像进行修正;According to the edge feature of the first image and the frequency of the gray value in the gray histogram of the first image, the texture integrity of the first image is obtained, and the necessary correction is obtained according to the texture integrity of the first image. a necessity index, when the correction necessity index is greater than a preset first threshold, the first image is corrected; 根据所述第一图像的纹理完整度获得调整值下限及调整值上限,并根据所述调整值下限、所述调整值上限以及所述第一图像的曝光值,获得曝光值范围;Obtain the lower limit of the adjustment value and the upper limit of the adjustment value according to the texture integrity of the first image, and obtain the range of exposure values according to the lower limit of the adjustment value, the upper limit of the adjustment value and the exposure value of the first image; 对所述第一图像的曝光值进行调整,获得不同曝光值的多个第二图像,所述第二图像的曝光值位于所述曝光值范围内;Adjusting the exposure value of the first image to obtain a plurality of second images with different exposure values, where the exposure values of the second images are within the exposure value range; 按照获取第一图像的纹理完整度的方法获得每张所述第二图像的纹理完整度,并根据所述每张第二图像的纹理完整度,获得每张所述第二图像的融合权重;Obtain the texture integrity of each second image according to the method of obtaining the texture integrity of the first image, and obtain the fusion weight of each second image according to the texture integrity of each second image; 对得到的所有第二张图像的融合权重进行融合叠加得到第一图像的像素值,完成对所述第一图像的修正。The obtained fusion weights of all the second images are fused and superposed to obtain the pixel values of the first image, and the correction of the first image is completed. 2.根据权利要求1所述的基于纹理信息的零件异常曝光图像修正方法,其特征在于,所述第一图像/第二图像的纹理完整度是由第一图像/第二图像的亮区域的纹理完整性和暗区域的纹理完整性得到的,具体的方法包括:2 . The method for correcting abnormal exposure images of parts based on texture information according to claim 1 , wherein the texture integrity of the first image/second image is determined by the bright area of the first image/second image. 3 . The texture integrity and the texture integrity of the dark area are obtained, and the specific methods include: 获得所述第一图像/第二图像的灰度图像,并根据所述灰度图像获得亮区域图像和暗区域图像,所述亮区域图像包含所述灰度图像中的亮区域,所述暗区域图像包含所述灰度图像中的暗区域;Obtain a grayscale image of the first image/second image, and obtain a bright area image and a dark area image according to the grayscale image, the bright area image includes the bright area in the grayscale image, and the dark area image the area image contains dark areas in the grayscale image; 根据所述亮区域图像的纹理信息,获得亮区域的纹理完整性;According to the texture information of the bright area image, obtain the texture integrity of the bright area; 根据所述暗区域图像的纹理信息,获得暗区域的纹理完整性;According to the texture information of the dark area image, obtain the texture integrity of the dark area; 根据所述亮区域的纹理完整性及所述暗区域的纹理完整性,获得所述纹理完整度。The texture integrity is obtained according to the texture integrity of the light area and the texture integrity of the dark area. 3.根据权利要求2所述的基于纹理信息的零件异常曝光图像修正方法,其特征在于,所述纹理完整性的获取过程,包括:3. The method for correcting abnormal exposure images of parts based on texture information according to claim 2, wherein the acquisition process of the texture integrity comprises: 根据亮区域图像/暗区域图像的纹理特征,获取亮区域图像/暗区域图像的纹理丰富度及纹理均匀程度;Obtain the texture richness and texture uniformity of the bright area image/dark area image according to the texture characteristics of the bright area image/dark area image; 将所述纹理丰富度及所述纹理均匀度相乘,得到亮区域图像/暗区域图像的所述纹理完整性。Multiply the texture richness and the texture uniformity to obtain the texture integrity of the light area image/dark area image. 4.根据权利要求3所述的基于纹理信息的零件异常曝光图像修正方法,其特征在于,所述纹理丰富度的获取过程,包括:4. The method for correcting abnormal exposure images of parts based on texture information according to claim 3, wherein the acquisition process of the texture richness comprises: 将亮区域图像/暗区域图像中,所有像素点中灰度值的最大值与灰度值的最小值相减,得到灰度值宽度;In the bright area image/dark area image, the maximum value of the gray value in all pixels is subtracted from the minimum value of the gray value to obtain the width of the gray value; 根据亮区域图像/暗区域图像的灰度直方图中,不同灰度值的出现次数的方差,得到直方图均匀程度;According to the variance of the number of occurrences of different gray values in the gray histogram of the bright area image/dark area image, the uniformity of the histogram is obtained; 将所述灰度值宽度与所述直方图均匀程度相乘,得到纹理丰富度。Multiply the gray value width by the histogram uniformity to obtain texture richness. 5.根据权利要求3所述的基于纹理信息的零件异常曝光图像修正方法,其特征在于,所述纹理均匀程度的获得方法,包括:5. The method for correcting abnormal exposure images of parts based on texture information according to claim 3, wherein the method for obtaining the uniformity of the texture comprises: 对亮区域图像/暗区域图像进行边缘检测,得到亮区域图像/暗区域图像的边缘特征点;Perform edge detection on the bright area image/dark area image to obtain the edge feature points of the bright area image/dark area image; 将亮区域图像/暗区域图像中边缘特征点的八邻域像素点,以及自身像素点共九个像素点中边缘特征点的个数作为边缘特征点的频率;The number of edge feature points in the eight neighborhood pixel points of the edge feature points in the bright area image/dark area image, and the number of edge feature points in a total of nine pixel points of its own pixel points are used as the frequency of edge feature points; 根据亮区域图像/暗区域图像中行的边缘特征点的频率,以及行的边缘特征点的行距离特征,获得边缘特征点的行分布均匀程度;According to the frequency of the edge feature points of the line in the bright area image/dark area image, and the line distance feature of the edge feature point of the line, the uniformity of the line distribution of the edge feature points is obtained; 根据亮区域图像/暗区域图像中列的边缘特征点的频率,以及列的边缘特征点的列距离特征,获得边缘特征点的列分布均匀程度;According to the frequency of the edge feature points of the column in the bright area image/dark area image, and the column distance feature of the edge feature point of the column, the uniformity of the column distribution of the edge feature points is obtained; 将所述边缘特征点的行分布均匀程度与列分布均匀程度相乘,获得所述纹理均匀程度。The uniformity of the texture is obtained by multiplying the uniformity of the row distribution of the edge feature points by the uniformity of the column distribution. 6.根据权利要求5所述的基于纹理信息的零件异常曝光图像修正方法,其特征在于,所述行距离特征指的是,边缘特征点到同一行相邻的其他边缘特征点之间的距离,或边缘特征点到亮区域图像/暗区域图像的边界的距离;6 . The method for correcting abnormal exposure images of parts based on texture information according to claim 5 , wherein the row distance feature refers to the distance between an edge feature point and other adjacent edge feature points in the same row. 7 . , or the distance from the edge feature point to the boundary of the bright area image/dark area image; 所述列距离特征指的是,边缘特征点到同一列相邻的其他边缘特征点之间的距离,或边缘特征点到亮区域图像/暗区域图像的边界的距离。The column distance feature refers to the distance between the edge feature point and other adjacent edge feature points in the same column, or the distance between the edge feature point and the boundary of the bright area image/dark area image. 7.根据权利要求1所述的基于纹理信息的零件异常曝光图像修正方法,其特征在于,所述对得到的所有第二张图像的融合权重进行融合叠加得到第一图像的像素值,完成对所述第一图像的修正,包括:7 . The method for correcting abnormal exposure images of parts based on texture information according to claim 1 , wherein the fusion weights of all the second images obtained are fused and superposed to obtain the pixel values of the first image, and the comparison is completed. 8 . The correction of the first image includes: 所述融合权重包括,暗区域融合权重以及亮区域融合权重;The fusion weight includes a dark area fusion weight and a bright area fusion weight; 利用所述暗区域融合权重,对所述第二图像的灰度图像中的暗区域,对应的所述第二图像中的区域进行加权融合;Using the dark area fusion weight, weighted fusion is performed on the dark area in the grayscale image of the second image and the corresponding area in the second image; 利用所述亮区域融合权重,对所述第二图像的灰度图像中的亮区域,对应的所述第二图像中的区域进行加权融合。Using the bright area fusion weight, weighted fusion is performed on the bright area in the grayscale image of the second image and the corresponding area in the second image. 8.一种基于纹理信息的零件异常曝光图像修正装置,其特征在于,包括:8. A device for correcting abnormal exposure images of parts based on texture information, comprising: 图像及曝光值获取模块,用于获取第一图像以及第一图像的曝光值,所述第一图像指待修正的异常曝光图像;an image and exposure value acquisition module, configured to acquire a first image and an exposure value of the first image, where the first image refers to an abnormally exposed image to be corrected; 第一计算模块,用于根据所述第一图像的边缘特征及第一图像的灰度直方图中灰度值的频率,获得所述第一图像的纹理完整度,并根据所述第一图像的纹理完整度获得修正必要性指标,当所述修正必要性指标大于预设第一阈值时对所述第一图像进行修正;The first calculation module is configured to obtain the texture integrity of the first image according to the edge feature of the first image and the frequency of the gray value in the gray histogram of the first image, and according to the first image Obtaining a correction necessity index based on the texture integrity of the first image, and correcting the first image when the correction necessity index is greater than a preset first threshold; 第二计算模块,用于根据所述第一图像的纹理完整度获得调整值下限及调整值上限,并根据所述调整值下限、所述调整值上限以及所述第一图像的曝光值,获得曝光值范围;The second calculation module is configured to obtain the lower limit of the adjustment value and the upper limit of the adjustment value according to the texture integrity of the first image, and obtain the lower limit of the adjustment value, the upper limit of the adjustment value and the exposure value of the first image according to the lower limit of the adjustment value, the upper limit of the adjustment value and the exposure value of the first image. exposure value range; 图像生成模块,用于对所述第一图像的曝光值进行调整,获得不同曝光值的多个第二图像,所述第二图像的曝光值位于所述曝光值范围内;an image generation module, configured to adjust the exposure value of the first image to obtain a plurality of second images with different exposure values, and the exposure values of the second images are within the exposure value range; 第三计算模块,用于按照获取第一图像的纹理完整度的方法获得每张所述第二图像的纹理完整度,并根据所述每张第二图像的纹理完整度,获得每张所述第二图像的融合权重;a third computing module, configured to obtain the texture integrity of each of the second images according to the method of obtaining the texture integrity of the first image, and to obtain the texture integrity of each of the second images according to the texture integrity of each of the second images the fusion weight of the second image; 图像修正模块,用于对得到的所有第二张图像的融合权重进行融合叠加得到第一图像的像素值,完成对所述第一图像的修正。The image correction module is used for fusing and superposing the obtained fusion weights of all the second images to obtain the pixel values of the first image, so as to complete the correction of the first image.
CN202210348628.5A 2022-04-01 2022-04-01 A method and device for correcting abnormal exposure images of parts based on texture information Active CN114723632B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202210348628.5A CN114723632B (en) 2022-04-01 2022-04-01 A method and device for correcting abnormal exposure images of parts based on texture information

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202210348628.5A CN114723632B (en) 2022-04-01 2022-04-01 A method and device for correcting abnormal exposure images of parts based on texture information

Publications (2)

Publication Number Publication Date
CN114723632A true CN114723632A (en) 2022-07-08
CN114723632B CN114723632B (en) 2025-01-03

Family

ID=82241583

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202210348628.5A Active CN114723632B (en) 2022-04-01 2022-04-01 A method and device for correcting abnormal exposure images of parts based on texture information

Country Status (1)

Country Link
CN (1) CN114723632B (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116188462A (en) * 2023-04-24 2023-05-30 深圳市翠绿贵金属材料科技有限公司 Noble metal quality detection method and system based on visual identification

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20100157110A1 (en) * 2008-12-19 2010-06-24 Sanyo Electric Co., Ltd. Image Sensing Apparatus
JP2011199860A (en) * 2010-02-26 2011-10-06 Nikon Corp Imaging device and image generating program
CN104902168A (en) * 2015-05-08 2015-09-09 梅瑜杰 Image synthesis method, device and shooting equipment
CN110087003A (en) * 2019-04-30 2019-08-02 深圳市华星光电技术有限公司 More exposure image fusion methods

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20100157110A1 (en) * 2008-12-19 2010-06-24 Sanyo Electric Co., Ltd. Image Sensing Apparatus
JP2011199860A (en) * 2010-02-26 2011-10-06 Nikon Corp Imaging device and image generating program
CN104902168A (en) * 2015-05-08 2015-09-09 梅瑜杰 Image synthesis method, device and shooting equipment
CN110087003A (en) * 2019-04-30 2019-08-02 深圳市华星光电技术有限公司 More exposure image fusion methods

Non-Patent Citations (2)

* Cited by examiner, † Cited by third party
Title
ZHANG Q等: "Dual Illumination Estimation for Robust Exposure Correction", COMPUTER GRAPHICS FORUM, vol. 38, no. 7, 31 October 2019 (2019-10-31), pages 243 - 252, XP071489827, DOI: 10.1111/cgf.13833 *
王韬: "复杂光照下非对齐人脸特征融合的识别算法研究", 中国优秀硕士学位论文全文数据库信息科技辑, no. 02, 15 February 2022 (2022-02-15), pages 138 - 757 *

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116188462A (en) * 2023-04-24 2023-05-30 深圳市翠绿贵金属材料科技有限公司 Noble metal quality detection method and system based on visual identification
CN116188462B (en) * 2023-04-24 2023-08-11 深圳市翠绿贵金属材料科技有限公司 A quality detection method and system for precious metals based on visual identification

Also Published As

Publication number Publication date
CN114723632B (en) 2025-01-03

Similar Documents

Publication Publication Date Title
US8103121B2 (en) Systems and methods for determination of a camera imperfection for an image
CN112752023B (en) Image adjusting method and device, electronic equipment and storage medium
US7830418B2 (en) Perceptually-derived red-eye correction
CN113573032B (en) Image processing method and projection system
US20230075213A1 (en) Method, device and apparatus for determining brightness compensation parameter
JP3233601B2 (en) Image processing device
CN113592739B (en) Lens shading correction method, device and storage medium
CN110428391B (en) Image fusion method and device for removing ghost artifacts
CN112351195A (en) Image processing method, device and electronic system
CN114723632A (en) Part abnormal exposure image correction method and device based on texture information
CN114757853B (en) Method and system for acquiring flat field correction function and flat field correction method and system
US20210166399A1 (en) Background Balancing in a Collection of Digital Images
CN109949250B (en) Image processing method and device
CN110086997B (en) Face image exposure brightness compensation method and device
JP3510040B2 (en) Image processing method
CN115100037A (en) Large-breadth tile imaging method and system based on multi-line scanning camera image splicing
CN113781958A (en) Optical compensation method and device of display panel
JP5327766B2 (en) Memory color correction in digital images
JP6196882B2 (en) Multi-area white balance control device, multi-area white balance control method, multi-area white balance control program, computer recording multi-area white balance control program, multi-area white balance image processing device, multi-area white balance image processing method, multi-area White balance image processing program, computer recording multi-area white balance image processing program, and imaging apparatus provided with multi-area white balance image processing device
TWI760934B (en) Mura compensation method for display panel, system, electronic device, and storage medium
CN111292243B (en) Projection seamless edge fusion method and device
JP3709656B2 (en) Image processing device
CN115118850B (en) Image processing method and display device
CN115118888B (en) Intelligent mirror using method, intelligent mirror, electronic equipment and storage medium
WO2024198648A1 (en) Image glare removal method, electronic device and computer storage medium

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
TA01 Transfer of patent application right
TA01 Transfer of patent application right

Effective date of registration: 20241118

Address after: 236000 Floor 7-8, Zone A, Software Industry Park, No. 76 Hehuan Road, Bowu Modern Industrial Park, Bozhou City, Anhui Province

Applicant after: Anhui Zhongke Zhibo Technology Development Co.,Ltd.

Country or region after: China

Address before: No. 375, Zhonghua East Road, Sanchang street, Haimen City, Nantong City, Jiangsu Province, 226000

Applicant before: Nantong Jixing fastener Technology Co.,Ltd.

Country or region before: China

GR01 Patent grant
GR01 Patent grant