A method and device for correcting abnormal exposure images of parts based on texture information
By acquiring and adjusting the texture information of the image, calculating the fusion weight to correct overexposed and underexposed areas, it solves the problem of difficulty in correcting overexposed and insufficient simultaneously in the prior art, and realizes efficient texture details correction for part images.
Patent Information
- Application Number
- CN202210348628.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-04-01
- Publication Date
- 2025-01-03
- Estimated Expiration
- 2042-04-01
AI Technical Summary
The prior art is difficult to correct overexposed and underexposed areas in the image simultaneously, resulting in the inability to effectively correct abnormally exposed parts images and the complete texture details of the parts cannot be presented.
By acquiring the texture integrity of the image, determining the necessity of correction and adjusting the exposure value, generating images within a range of multiple exposure values, and calculating the fusion weight based on the texture integrity to weight fusion the image to correct overexposed and underexposed areas.
The targeted and accurate correction of abnormally exposed images is achieved, and unnecessary processing of images without correction is avoided, which improves the targeted and accurate image correction.
Smart Images

Figure CN114723632B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of computer vision, and in particular to a method and device for correcting abnormal exposure images of parts based on texture information. Background Art
[0002] In the process of photographing parts, due to the influence of light intensity and light source angle, the obtained part image will have abnormal exposure. Abnormal exposure includes overexposure and underexposure. Overexposure or underexposure will cause the obtained part image to be unable to present the complete texture details of the part. At the same time, there is reflection on the surface of the part, which makes the captured part image have many reflective areas. However, by reducing the exposure value during shooting to reduce the reflective area, a large number of dark areas will appear in the captured part image. Therefore, it is necessary to correct the part image with abnormal exposure so that the captured part image can present the complete texture details of the part.
[0003] In order to solve the above problems in the prior art, the overall exposure of the image is usually changed to achieve a more appropriate exposure. This method will further increase the exposure of the overexposed part of the image, or further reduce the exposure of the underexposed part of the image. It is impossible to correct the overexposed and underexposed parts of the image at the same time, and it is impossible to achieve a better abnormal exposure image correction effect. Summary of the invention
[0004] 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.
[0005] First, this paper proposes a method for correcting abnormal exposure images of parts based on texture information, including:
[0006] A first image and an exposure value of the first image are acquired, wherein the first image is an abnormally exposed image to be corrected.
[0007] According to the edge features of the first image and the frequency of grayscale values in the grayscale histogram of the first image, the texture integrity of the first image is obtained, and according to the texture integrity of the first image, a correction necessity index is obtained, and the first image is corrected when the correction necessity index is greater than a preset first threshold.
[0008] An adjustment value lower limit and an adjustment value upper limit are obtained according to the texture integrity of the first image, and an exposure value range is obtained according to the adjustment value lower limit, the adjustment value upper limit and the exposure value of the first image.
[0009] The exposure value of the first image is adjusted to obtain a plurality of second images with different exposure values, wherein the exposure values of the second images are within the exposure value range.
[0010] The texture completeness of each second image is obtained according to the method of obtaining the texture completeness of the first image, and the fusion weight of each second image is obtained according to the texture completeness of each second image.
[0011] The obtained fusion weights of all the second images are fused and superimposed to obtain the pixel value of the first image, thereby completing the correction of the first image.
[0012] Furthermore, in the method for correcting abnormal exposure images of parts based on texture information, the texture integrity of the first image / the second image is obtained by the texture integrity of the bright area and the texture integrity of the dark area of the first image / the second image, and the specific method includes:
[0013] A grayscale image of the first image / the second image is obtained, and a bright area image and a dark area image are obtained according to the grayscale image, wherein the bright area image includes the bright area in the grayscale image, and the dark area image includes the dark area in the grayscale image.
[0014] The texture integrity of the bright area is obtained according to the texture information of the bright area image.
[0015] The texture integrity of the dark area is obtained according to the texture information of the dark area image.
[0016] The texture integrity is obtained according to the texture integrity of the bright area and the texture integrity of the dark area.
[0017] Furthermore, the abnormal exposure image correction method of parts based on texture information, the process of acquiring texture integrity includes:
[0018] 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.
[0019] The texture richness and the texture uniformity are multiplied to obtain the texture completeness of the bright area image / dark area image.
[0020] Furthermore, the abnormal exposure image correction method of parts based on texture information, the process of acquiring texture richness includes:
[0021] The maximum grayscale value of all pixels in the bright area image / dark area image is subtracted from the minimum grayscale value to obtain the grayscale value width.
[0022] The histogram uniformity is obtained 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.
[0023] The gray value width is multiplied by the histogram uniformity to obtain texture richness.
[0024] Furthermore, the method for correcting abnormal exposure images of parts based on texture information and the method for obtaining texture uniformity include:
[0025] Perform edge detection on the bright area image / dark area image to obtain edge feature points of the bright area image / dark area image.
[0026] The number of edge feature points in the eight neighborhood pixels of the edge feature point in the bright area image / dark area image and the edge feature point itself, a total of nine pixels, is taken as the frequency of the edge feature point.
[0027] According to the frequency of the edge feature points of the row in the bright area image / dark area image and the row distance characteristics of the edge feature points of the row, the row distribution uniformity of the edge feature points is obtained.
[0028] According to the frequency of the edge feature points of the column in the bright area image / dark area image and the column distance characteristics of the edge feature points of the column, the column distribution uniformity of the edge feature points is obtained.
[0029] The texture uniformity is obtained by multiplying the row distribution uniformity and the column distribution uniformity of the edge feature points.
[0030] Furthermore, in the method for correcting abnormal exposure images of parts based on texture information, the row distance feature refers to the distance between an edge feature point and other adjacent edge feature points in the same row, or the distance between an edge feature point and the boundary of a bright area image / dark area image.
[0031] The column distance feature refers to the distance between an edge feature point and other adjacent edge feature points in the same column, or the distance between an edge feature point and a boundary of a bright area image / a dark area image.
[0032] Furthermore, the abnormal exposure image correction method of parts based on texture information, the pixel value of the first image is obtained by fusing and superimposing the fusion weights of all the second images, and the correction of the first image is completed, including:
[0033] The fusion weights include dark area fusion weights and bright area fusion weights.
[0034] The dark area fusion weight is used to perform weighted fusion on the dark area in the grayscale image of the second image and the area in the second image corresponding to the dark area.
[0035] The bright area fusion weight is used to perform weighted fusion on the bright area in the grayscale image of the second image and the area in the second image corresponding to the bright area.
[0036] In a second aspect, the present invention proposes a device for correcting abnormal exposure images of parts based on texture information, comprising:
[0037] The image and exposure value acquisition module is used to acquire a first image and an exposure value of the first image, wherein the first image refers to an abnormal exposure image to be corrected.
[0038] An image and exposure value acquisition module, used to acquire a first image and an exposure value of the first image, wherein the first image refers to an abnormal exposure image to be corrected;
[0039] a first calculation module, configured to obtain a texture integrity of the first image according to edge features of the first image and a frequency of grayscale values in a grayscale histogram of the first image, and to obtain a correction necessity index according to the texture integrity of the first image, and to correct the first image when the correction necessity index is greater than a preset first threshold;
[0040] a second calculation module, configured to obtain an adjustment value lower limit and an adjustment value upper limit according to the texture integrity of the first image, and obtain an exposure value range according to the adjustment value lower limit, the adjustment value upper limit and the exposure value of the first image;
[0041] 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, wherein the exposure values of the second images are within the exposure value range;
[0042] a third calculation module, configured to obtain the texture integrity of each of the second images according to the method for obtaining the texture integrity of the first image, and obtain a fusion weight of each of the second images according to the texture integrity of each of the second images;
[0043] The image correction module is used to fuse and superimpose the fusion weights of all the second images to obtain the pixel value of the first image, so as to complete the correction of the first image.
[0044] 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 includes:
[0045] A first image and an exposure value of the first image are obtained, wherein the first image refers to an abnormally exposed image to be corrected; a texture integrity of the first image is obtained according to edge features of the first image and the frequency of grayscale values in a grayscale histogram of the first image, and a correction necessity index is obtained according to the texture integrity of the first image, and the first image is corrected when the correction necessity index is greater than a preset first threshold; an adjustment value lower limit and an adjustment value upper limit are obtained according to the texture integrity of the first image, and an exposure value range is obtained according to the adjustment value lower limit, the adjustment value upper limit 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 for obtaining the texture integrity of the first image, and a fusion weight of each second image is obtained according to the texture integrity of each second image; the fusion weights of all the obtained second images are fused and superimposed to obtain a pixel value of the first image, and the correction of the first image is completed.
[0046] Compared with the prior art, the beneficial effects of the present invention are: using the texture information in the collected part image to determine whether there is abnormal exposure, which can avoid unnecessary processing of images that do not need to be corrected; using the texture information of the image to obtain the exposure value range, and performing weighted fusion on the overexposed areas and underexposed areas in multiple images at different exposure values within the exposure value range, the overexposed areas and underexposed areas in the abnormally exposed image can be corrected at the same time, making the image correction process more targeted and accurate. BRIEF DESCRIPTION OF THE DRAWINGS
[0047] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative labor.
[0048] Figure 1 It is a flow chart of a method for correcting abnormal exposure images of parts based on texture information provided in Example 1 of the present invention.
[0049] Figure 2 It is a flow chart of a device for correcting abnormal exposure images of parts based on texture information provided in Example 2 of the present invention. DETAILED DESCRIPTION
[0050] In order to make the purpose, technical scheme and advantages of the present invention more clearly understood, the present invention is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present invention and are not intended to limit the present invention. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without making creative work are within the scope of protection of the present invention.
[0051] In the following description, specific details such as specific system structures, technologies, etc. are provided for the purpose of illustration rather than limitation, so as to provide a thorough understanding of the embodiments of the present application. However, it should be clear to those skilled in the art that the present application may also be implemented in other embodiments without these specific details. In other cases, detailed descriptions of well-known systems, devices, circuits, and methods are omitted to prevent unnecessary details from obstructing the description of the present application.
[0052] The terms "first" and "second" are used for descriptive purposes only and should not be understood as indicating or implying relative importance or implicitly indicating the number of the indicated technical features. Therefore, the features defined as "first" and "second" may explicitly or implicitly include one or more of the features; in the description of this embodiment, unless otherwise specified, "plurality" means two or more.
[0053] Example 1
[0054] Embodiment 1 of the present invention provides a method for correcting abnormal exposure images of parts based on texture information, such as Figure 1 As shown, including:
[0055] 101. Obtain a first image and an exposure value of the first image, where the first image refers to an abnormally exposed image to be corrected.
[0056] An abnormal exposure image to be corrected, i.e., a first image, is obtained by using an image acquisition device. The first image is in RGB format. RGB is a color standard. Various colors are obtained by changing the three color channels of red (R), green (G), and blue (B) and superimposing them on each other. RGB represents the colors of the three channels of red, green, and blue.
[0057] 102. Obtain texture integrity of the first image based on edge features of the first image and the frequency of grayscale values in a grayscale histogram of the first image, and obtain a correction necessity index based on the texture integrity of the first image, and correct the first image when the correction necessity index is greater than a preset first threshold.
[0058] In this embodiment, 102 specifically includes 1021 , 1022 and 1023 .
[0059] 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.
[0060] Specifically, in order to segment the bright area and the dark area in the grayscale image 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 [204, 255], and the grayscale segmentation threshold range of the dark area is [0, 51].
[0061] 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 set to 0, so as to obtain a dark area image.
[0062] Specifically, the pixels whose grayscale values in the grayscale image of the first image are within the threshold range [204, 255] are retained, and the pixels whose grayscale values in the threshold range [0, 204) are set to 0, to obtain a 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.
[0063] Specifically, in this embodiment, the brightness information in the first image is obtained by 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 dark area in the grayscale image of the first image corresponds to the underexposed area in the first image.
[0064] 1022. Obtain texture integrity of the bright area according to texture information of the bright area image; and obtain texture integrity of the dark area according to texture information of the dark area image.
[0065] It should be noted that the method for obtaining the texture integrity of the dark area in this embodiment is the same as the method for obtaining the texture integrity of the bright area, except that the target images are different. The calculation methods of texture integrity specifically include 10221, 10222 and 10223. Texture integrity can reflect the completeness of the texture in the image. Texture integrity mainly includes texture richness and texture uniformity.
[0066] 10221. Obtain texture richness of the bright area image / dark area image.
[0067] 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 of the bright area or the dark area is lost, resulting in uneven texture distribution, so it is necessary to extract the texture uniformity.
[0068] First, the maximum grayscale value of all pixels in the bright area image / dark area image is subtracted from the minimum grayscale value to obtain the grayscale value width.
[0069] It should be noted that the calculation method for the texture richness of the bright area image and the dark area image is the same. The following takes the bright area image as an example to specifically explain the method for obtaining the texture richness.
[0070] Specifically, the maximum grayscale value and the minimum grayscale value in the bright area image are subtracted to obtain the grayscale value width of the bright area image as wl. The maximum grayscale value and the minimum grayscale value in the dark area image are subtracted to obtain the grayscale value width of the dark area image as wa.
[0071] Secondly, according to the variance of the number of occurrences of different gray values in the grayscale histogram of the bright area image / dark area image, the histogram uniformity is obtained. The richness of the texture is mainly reflected in the histogram. The richer the grayscale information contained in the histogram, the richer the texture features. Multiply the grayscale value width by the histogram uniformity to get the texture richness.
[0072] Specifically, obtain the grayscale histogram of the bright area image and calculate the frequency mean of the histogram Where p(h j ) is the jth gray value h in the gray histogram of the bright area image j The corresponding frequency value, wl is the gray value width of the bright area image. Calculate the variance of the frequency of the gray histogram of the bright area image Therefore, the uniformity of the grayscale histogram in the bright area is
[0073] It should be noted that, according to the grayscale histogram uniformity of the bright area grayscale image, the grayscale histogram uniformity jh2 of the dark area image can be obtained by the same acquisition method.
[0074] Specifically, the texture integrity of the bright area image is ff1=wl*jh1, where wl is the grayscale value width of the bright area image, and jh1 is the uniformity of the grayscale histogram of the bright area image; at the same time, the texture richness of the dark area image is ff2=wa*jh2, where wa is the grayscale value width of the dark area image, and jh2 is the uniformity of the grayscale histogram of the dark area image.
[0075] 10222. Obtain texture uniformity of the bright area image / dark area image.
[0076] Specifically, the uniformity of texture is mainly reflected by the distance information between texture pixels and the texture frequency difference information. The distance information of texture is reflected by the distance size and distance deviation. The larger the texture pixel distance, the more uneven the texture distribution. The larger the texture pixel 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.
[0077] It should be noted that the calculation method for the texture uniformity of the bright area image and the dark area image is the same. The following takes the bright area image as an example to specifically explain the method for obtaining the texture uniformity.
[0078] 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.
[0079] Then, the number of edge feature points in the eight-neighborhood pixels of the edge feature point in the bright area image and the nine pixel points of the edge feature point itself is taken as the frequency of the edge feature point; the row distribution uniformity of the edge feature points is obtained according to the frequency of the edge feature points and the row distance characteristics of the edge feature points in the row; the column distribution uniformity of the edge feature points is obtained according to the frequency of the edge feature points and the column distance characteristics of the edge feature points in the column.
[0080] Specifically, the pixel distance between each two adjacent edge feature points is obtained: Assume that in the kth row of the bright area image, there are two adjacent edge feature points at (k, i) and (k, j), and the distance between the two edge feature points is d1 kj =ji.
[0081] It should be noted that when there is no other edge feature point 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 shortest distance from the point to the image boundary. At this time, d1 kl =min(l,Ml), where M is the number of columns of the image.
[0082] Further, the distance sequence between the edge feature points in the kth row in the bright area image can be obtained; using the frequency of the edge feature points, the frequency sequence of the edge feature points in the kth row in the bright area image can be obtained, and further the distance mean of the edge feature points in the row in the bright area image and the distance deviation of the edge feature points can be calculated.
[0083] Specifically, the mean distance between edge feature points in the kth row of the bright area image is The distance deviation between the edge feature points in the kth row of the bright area image is where d1 khis the distance value of the hth edge feature point in the row of the bright area image, where r is the number of distance values of edge feature points in the distance sequence between edge feature points.
[0084] It should be noted that the frequency deviation value of the edge feature point in the kth row of the bright area image is Where M is the number of columns in the bright area image, f1 kg is the frequency value of the edge feature at the kth row and gth column of the bright area, is the frequency mean of the pixels in the kth row.
[0085] Secondly, the distribution uniformity of edge feature points in the kth row of the bright area image where σd1 k is the distance deviation of the edge feature points in the kth row in the bright area image, σf1 k is the frequency deviation of the edge features in the kth row in the bright area image. is the mean distance of the edge feature points in the kth row in the bright area image.
[0086] Furthermore, the average distribution uniformity of the edge features of the row pixels in the bright area image is HereJy1 q is the uniformity of edge feature distribution of the qth row in the bright area, N is the number of rows in the frequency image, and the mean uniformity of edge feature distribution of column pixels in the bright area image can be further obtained. The uniformity of edge distribution of bright area image is Finally, the row distribution uniformity of the edge feature points is multiplied by the column distribution uniformity to obtain the texture uniformity Jy2 of the bright area image.
[0087] Furthermore, the texture uniformity Jy2 of the dark area can be obtained by using the same acquisition method as that of the texture uniformity of the bright area image.
[0088] 10223. Multiply the texture richness and the texture uniformity to obtain the texture integrity of the bright area image / dark area image.
[0089] 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, and Jy2 is the texture uniformity of the dark area image.
[0090] 1023. Obtain texture integrity of the first image according to the texture integrity of the bright area and the texture integrity of the dark area.
[0091] 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. The texture integrity can reflect the texture information of the first image, ie, the abnormal exposure image.
[0092] It should be noted that the inverse of the texture completeness of the first image is the correction necessity index, which can reflect the necessity of correcting the first image. It is judged whether the correction necessity index is greater than the preset first threshold. If the judgment result is yes, the first image needs to be corrected. If the judgment result is no, it means that the image does not have abnormal exposure and no subsequent correction is required.
[0093] 103. Obtain an adjustment value lower limit and an adjustment value upper limit according to the texture integrity of the first image, and obtain an exposure value range according to the adjustment value lower limit, the adjustment value upper limit, and the exposure value of the first image.
[0094] 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 seriously missing, the exposure value of the bright area should be reduced; when the texture information in the dark area is seriously missing, the exposure value of the dark area should be increased. Adjustment value upper limit Where Wz1 is the texture integrity of the bright area, and Wz2 is the texture integrity of the dark area. It is a constant parameter and can be selected according to the specific needs of the implementer.
[0095] Further, an exposure value range can be obtained, [Bg-α, Bg+β, where Bg is the exposure value of the abnormal exposure image, ie, the first image.
[0096] 104. Adjust the exposure value of the first image to obtain a plurality of second images with different exposure values within an exposure value range.
[0097] Specifically, according to the exposure value range obtained in 103, multiple second images with different exposure values can be obtained based on the first image. The obtained second images differ from the first image in that the exposure values are different, and the exposure values of all the second images are within the exposure value range.
[0098] 105. Obtain the texture completeness of each second image according to the method for obtaining the texture completeness of the first image, and obtain a fusion weight of each second image according to the texture completeness of each second image.
[0099] Furthermore, by using the method for acquiring the texture integrity of an image in the present 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.
[0100] 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 fusion weight of the a-th second image for the overexposed area is: The fusion weight of the a-th second image for the underexposed area Where v represents the total number of second images.
[0101] 106. The obtained fusion weights of all the second images are fused and superimposed to obtain pixel values of the first image, thereby completing the correction of the first image.
[0102] Specifically, according to the fusion weight of the second image, the overexposed area and the underexposed area in the first image are fused, and the normal area in the first image remains unchanged, and the obtained image is the corrected first image.
[0103] It is necessary to explain that the correction method of the pixel value in the overexposed area of the first image is: in The pixel value of the corresponding pixel in the a-th second image is the pixel point in the bright area of the grayscale image of the first image; the correction method of the pixel value in the underexposed area of the first image is in represents the pixel point in the dark area of the grayscale image of the first image, and the pixel value of the corresponding pixel point in the a-th second image; 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.
[0104] Compared with the prior art, the beneficial effects of the present invention are: using the texture information in the collected part image to determine whether there is abnormal exposure, which can avoid unnecessary processing of images that do not need to be corrected; using the texture information of the image to obtain the exposure value range, and performing weighted fusion on the overexposed areas and underexposed areas in multiple images at different exposure values within the exposure value range, the overexposed areas and underexposed areas in the abnormally exposed image can be corrected at the same time, making the image correction process more targeted and accurate.
[0105] Example 2
[0106] Embodiment 2 of the present invention provides a method and device for correcting abnormal exposure images of parts based on texture information, such as Figure 2 Shown include:
[0107] The image and exposure value acquisition module 21 is used to acquire a first image and an exposure value of the first image, where the first image refers to an abnormal exposure image to be corrected.
[0108] The first calculation module 22 is used to obtain the texture integrity of the first image according to the edge features of the first image and the frequency of the grayscale values in the grayscale histogram of the first image, and to obtain a correction necessity index according to the texture integrity of the first image, and to correct the first image when the correction necessity index is greater than a preset first threshold.
[0109] The second calculation module 23 is used to obtain an adjustment value lower limit and an adjustment value upper limit according to the texture integrity of the first image, and obtain an exposure value range according to the adjustment value lower limit, the adjustment value upper limit and the exposure value of the first image.
[0110] The image generation module 24 is used to adjust the exposure value of the first image to obtain a plurality of second images with different exposure values, wherein the exposure values of the second images are within the exposure value range.
[0111] The third calculation module 25 is used 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 weight of each second image according to the texture integrity of each second image.
[0112] The image correction module 26 is used to fuse and superimpose the obtained fusion weights of all the second images to obtain the pixel values of the first image, thereby completing the correction of the first image.
[0113] In summary, compared with the prior art, the beneficial effects of the present invention are as follows: by using the texture information in the collected part image to determine whether there is abnormal exposure, unnecessary processing of images that do not need to be corrected can be avoided; the exposure value range is obtained by using the texture information of the image, and the overexposed areas and underexposed areas in multiple images at different exposure values within the exposure value range are weightedly fused, so that the overexposed areas and underexposed areas in the abnormally exposed image can be corrected at the same time, making the image correction process more targeted and accurate.
[0114] The words "including", "comprising", "having" and the like in the present invention are open words, meaning "including but not limited to", and can be used interchangeably therewith. The words "or" and "and" used herein mean the words "and / or" and can be used interchangeably therewith, unless the context clearly indicates otherwise. The word "such as" used herein means the phrase "such as but not limited to", and can be used interchangeably therewith.
[0115] It should also be noted that in the method and system of the present invention, each component or each step can be decomposed and / or recombined. Such decomposition and / or recombination should be regarded as equivalent solutions of the present disclosure.
[0116] The above embodiments are merely examples for the purpose of clear explanation and do not constitute a limitation on the protection scope of the present invention. For those skilled in the art, other different forms of changes or modifications can be made based on the above description, and it is not necessary and impossible to list all the implementation methods here. All designs that are the same or similar to the present invention belong to the protection scope of the present invention.
Claims
1. A method for correcting abnormal exposure images of parts based on texture information, characterized in that: include: Acquire a first image and an exposure value of the first image, wherein the first image is an abnormally exposed image to be corrected; Obtaining a texture integrity of the first image according to edge features of the first image and a frequency of grayscale values in a grayscale histogram of the first image, and obtaining a correction necessity index according to the texture integrity of the first image, and correcting the first image when the correction necessity index is greater than a preset first threshold; Obtaining an adjustment value lower limit and an adjustment value upper limit according to the texture integrity of the first image, and obtaining an exposure value range according to the adjustment value lower limit, the adjustment value upper limit 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, wherein the exposure values of the second images are within the exposure value range; Obtaining the texture integrity of each of the second images according to the method for obtaining the texture integrity of the first image, and obtaining the fusion weight of each of the second images according to the texture integrity of each of the second images; The obtained fusion weights of all the second images are fused and superimposed to obtain the pixel value of the first image, thereby completing the correction of the first image; The texture integrity of the first image / the second image is obtained by the texture integrity of the bright area and the texture integrity of the dark area of the first image / the second image, and the specific method includes: Obtaining a grayscale image of the first image / the second image, and obtaining a bright area image and a dark area image according to the grayscale image, wherein the bright area image includes a bright area in the grayscale image, and the dark area image includes a dark area in the grayscale image; Obtaining texture integrity of the bright area according to texture information of the bright area image; Obtaining texture integrity of the dark area according to texture information of the dark area image; According to the texture integrity of the bright area and the texture integrity of the dark area, the texture integrity is obtained; The process of acquiring 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; Multiplying the texture richness and the texture uniformity to obtain the texture integrity of the bright area image / dark area image; The method for obtaining the texture uniformity comprises: Perform edge detection on the bright area image / dark area image to obtain edge feature points of the bright area image / dark area image; The number of edge feature points in the eight neighborhood pixels of the edge feature point in the bright area image / dark area image and the edge feature point itself, a total of nine pixels, is used as the frequency of the edge feature point; According to the frequency of the edge feature points of the row in the bright area image / dark area image and the row distance characteristics of the edge feature points of the row, the row distribution uniformity 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 characteristics of the edge feature points of the column, the column distribution uniformity of the edge feature points is obtained; Multiplying the row distribution uniformity and column distribution uniformity of the edge feature points to obtain the texture uniformity; The row distance feature refers to the distance between an edge feature point and other adjacent edge feature points in the same row, or the distance between an edge feature point and the boundary of a bright area image / dark area image; The column distance feature refers to the distance between an edge feature point and other adjacent edge feature points in the same column, or the distance between an edge feature point and a boundary of a bright area image / a dark area image.
2. The method for correcting abnormal exposure images of parts based on texture information according to claim 1, characterized in that: The process of obtaining the texture richness includes: Subtract the maximum grayscale value from the minimum grayscale value of all pixels in the bright area image / dark area image to obtain the grayscale value width; The histogram uniformity is obtained 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 gray value width is multiplied by the histogram uniformity to obtain texture richness.
3. The method for correcting abnormal exposure images of parts based on texture information according to claim 1, characterized in that: The step of fusing and superimposing the obtained fusion weights of all the second images to obtain the pixel value of the first image, and completing the correction of the first image, includes: The fusion weights include dark area fusion weights and bright area fusion weights; Using the dark area fusion weight, weighted fusion is performed on the dark area in the grayscale image of the second image and the area in the second image corresponding to the dark area; The bright area fusion weight is used to perform weighted fusion on the bright area in the grayscale image of the second image and the area in the second image corresponding to the bright area.
4. A device for correcting abnormal exposure images of parts based on texture information, characterized in that: include: An image and exposure value acquisition module, used to acquire a first image and an exposure value of the first image, wherein the first image refers to an abnormal exposure image to be corrected; a first calculation module, configured to obtain a texture integrity of the first image according to edge features of the first image and a frequency of grayscale values in a grayscale histogram of the first image, and to obtain a correction necessity index according to the texture integrity of the first image, and to correct the first image when the correction necessity index is greater than a preset first threshold; a second calculation module, configured to obtain an adjustment value lower limit and an adjustment value upper limit according to the texture integrity of the first image, and obtain an exposure value range according to the adjustment value lower limit, the adjustment value upper limit and the exposure value of the first image; 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, wherein the exposure values of the second images are within the exposure value range; a third calculation module, configured to obtain the texture integrity of each of the second images according to the method for obtaining the texture integrity of the first image, and obtain a fusion weight of each of the second images according to the texture integrity of each of the second images; An image correction module, used to fuse and superimpose the obtained fusion weights of all the second images to obtain the pixel value of the first image, so as to complete the correction of the first image; The texture integrity of the first image / the second image is obtained by the texture integrity of the bright area and the texture integrity of the dark area of the first image / the second image, and the specific method includes: Obtaining a grayscale image of the first image / the second image, and obtaining a bright area image and a dark area image according to the grayscale image, wherein the bright area image includes a bright area in the grayscale image, and the dark area image includes a dark area in the grayscale image; Obtaining texture integrity of the bright area according to texture information of the bright area image; Obtaining texture integrity of the dark area according to texture information of the dark area image; According to the texture integrity of the bright area and the texture integrity of the dark area, the texture integrity is obtained; The process of acquiring 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; Multiplying the texture richness and the texture uniformity to obtain the texture integrity of the bright area image / dark area image; The method for obtaining the texture uniformity comprises: Perform edge detection on the bright area image / dark area image to obtain edge feature points of the bright area image / dark area image; The number of edge feature points in the eight neighborhood pixels of the edge feature point in the bright area image / dark area image and the edge feature point itself, a total of nine pixels, is used as the frequency of the edge feature point; According to the frequency of the edge feature points of the row in the bright area image / dark area image and the row distance characteristics of the edge feature points of the row, the row distribution uniformity 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 characteristics of the edge feature points of the column, the column distribution uniformity of the edge feature points is obtained; Multiplying the row distribution uniformity and column distribution uniformity of the edge feature points to obtain the texture uniformity; The row distance feature refers to the distance between an edge feature point and other adjacent edge feature points in the same row, or the distance between an edge feature point and the boundary of a bright area image / dark area image; The column distance feature refers to the distance between an edge feature point and other adjacent edge feature points in the same column, or the distance between an edge feature point and a boundary of a bright area image / a dark area image.