An adaptive glare inhibition method for high-reflectance part images
By adopting an adaptive glare suppression method, the problem of glare in the image acquisition of high reflectivity parts is solved, achieving efficient information processing and cost reduction, and is applicable to a variety of image acquisition scenarios.
Patent Information
- Application Number
- CN202211466463.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-11-22
- Publication Date
- 2025-11-25
- Estimated Expiration
- 2042-11-22
AI Technical Summary
Existing technologies are prone to glare when acquiring images of high-reflectivity components, leading to information masking and redundant information processing, increasing costs and reducing production efficiency.
Images of high-reflectivity parts are acquired using reflected light. An adaptive segmentation factor is obtained through histogram statistics, and the image is segmented into small blocks. Difference and interpolation processing are then performed to suppress glare, reduce the cycle time of the acquisition system, and minimize redundancy in backend information storage.
It improves the efficiency of image acquisition for high-reflectivity parts, reduces information processing complexity and hardware costs, and has versatility and real-time performance, adapting to different image acquisition scenarios.
Smart Images

Figure CN115809972B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the technical field of intelligent manufacturing and digital image processing, in particular to a self-adaptive glare suppression method for high-reflectivity part images. BACKGROUND
[0002] The intelligent manufacturing level is a standard for measuring the industrial production strength of a country. With the rapid advancement of digital factories and end-to-end part quality tracking, the standards for information collection and processing in the production process of parts are becoming higher and higher. The collection and detection of part images in various production processes have become a key factor in quality assurance. At present, most of the part information collection is mainly concentrated on product batch, label, silk screen and other information, and all use manual contact scanning collection methods, which can easily cause pollution to the measured workpieces and have high labor costs.
[0003] At present, some automatic information collection systems collect part surface information in the form of machine vision, but for high-reflectivity parts, the image brightness of a certain area will be high during the collection of the surface image, forming a glare phenomenon that masks the expression of the part surface information. The usual approach is to collect multi-angle information or light the part from multiple angles. This approach will lead to redundant information collection, increase the difficulty of information storage and processing in the back end, increase the cost of information processing, and reduce production efficiency.
[0004] Therefore, for the collection of high-reflectivity part images, suppressing glare is the focus of research, and continuous and in-depth research is needed to develop an efficient glare suppression solution. SUMMARY
[0005] In view of the problems existing in the prior art, the present application discloses a self-adaptive glare suppression method for high-reflectivity part images, which adopts the following technical solution:
[0006] Step 1: Collect the high-reflectivity part image with the best imaging quality in a reflective light mode;
[0007] Step 2: Perform histogram statistics on the collected image to obtain an adaptive segmentation factor;
[0008] Step 3: Divide the original image into image blocks with the segmentation factor as the width and height, and obtain the difference between the mean value of the image blocks and the mean value of the original image;
[0009] Step 4: Obtain the minimum value of the difference in step 3, and subtract the difference in step 3 from the minimum value to obtain a background matrix;
[0010] Step 5: Interpolate the background matrix into a matrix with the same size as the original image;
[0011] Step 6: Subtract the interpolated image from the original image to obtain the image after glare suppression. The image acquisition of high reflectivity parts is changed from the traditional multi-angle photography and multi-angle lighting to suppress glare by suppressing glare through image processing algorithms. This reduces the automation cycle time of the acquisition system, reduces the redundancy of backend information storage, and improves information processing efficiency.
[0012] As a preferred embodiment of the present invention, the image acquired in step 1 is an 8-bit grayscale image, comprising the following steps:
[0013] Step 101: Fix the image acquisition device;
[0014] Step 102, adjust the lens focus;
[0015] Step 103 continues until the image is clearest. By combining the camera, lens, light source, and image processing algorithm, the glare image of high reflectivity parts can be acquired and the glare phenomenon can be suppressed. It has the advantages of strong versatility, high real-time performance, and reduced acquisition cost.
[0016] As a preferred technical solution of the present invention, in step 2, the acquired images are... Perform histogram distribution statistics and solve for the adaptive segmentation factor l, specifically including the following steps:
[0017] Step 201: Create a histogram array Hist_Tuple and iterate through the original images. Store the grayscale statistics of the pixels into the corresponding column of the array Hist_Tuple;
[0018] Step 202, set the statistical threshold T Sta_threshold ;
[0019] Step 203: Using grayscale values as segmentation points, calculate the percentage of pixels in Hist_Tuple whose values are greater than a certain pixel value, and compare this percentage with the statistical threshold T. Sta_threshold The comparison yields the splitting factor l, as shown in the following formula, where... Indicates rounding down:
[0020]
[0021] As a preferred embodiment of the present invention, in step 3, l is set as a segmentation factor to segment the original image. The image is divided into m×n blocks of size l×l, where m and n satisfy the following formula: Calculate the original image Mean grayscale original As shown in the following formula: Original image Mean grayscale originalDifference with each segmented image block, and the difference result is stored in the matrix Diff_Tuple, as shown in the following formula:
[0022]
[0023] As a preferred technical solution of the present application, in step 4, the minimum value Min in the matrix Diff_Tuple is obtained, and the background matrix is formed by respectively subtracting Min from all elements in Diff_Tuple As shown in the following formula:
[0024]
[0025] As a preferred technical solution of the present application, in step 5, the obtained background image matrix is subjected to bicubic interpolation processing, and the interpolation function is G, and the interpolated background image is The interpolation function is as follows:
[0026]
[0027] As a preferred technical solution of the present application, in step 6, the difference between the original image and the background modeling image is the image after high reflectivity glare suppression As shown in the following formula:
[0028] The present application has the following advantages: the present application changes the image acquisition of high reflectivity parts from the traditional multi-angle shooting and multi-angle lighting glare suppression mode to the image processing algorithm glare suppression mode, reduces the automation process beat of the acquisition system, reduces the backend information storage redundancy, improves the information processing efficiency, and can complete the acquisition of high reflectivity part glare image and suppress the glare phenomenon by combining the camera, lens, light source and image processing algorithm, has the advantages of strong universality, high real-time performance, and reduced acquisition.
[0029] Further, the present application can improve the acquisition efficiency of the reflectivity parts, reduce the backend information storage redundancy and processing complexity, save hardware cost, and combine with industrial detection, suppress the glare of high reflectivity parts by using the image processing method, can adapt to different image acquisition scenes, has strong universality, good real-time performance, and can greatly improve the image acquisition and backend information processing efficiency. BRIEF DESCRIPTION OF DRAWINGS
[0030] In order to more clearly illustrate the technical solutions in the specific embodiments or prior art of the present application, the drawings required to be used in the description of the specific embodiments or prior art will be briefly introduced below. In all the drawings, similar elements or parts are generally identified by similar reference numerals. In the drawings, the elements or parts are not necessarily drawn according to the actual proportions.
[0031] Figure 1 Adaptive glare suppression effect of high reflectivity part image Figure One ;
[0032] Figure 2 Adaptive glare suppression effect of high reflectivity part image Figure Two .
[0033] Embodiment 1
[0034] As Figures 1-2 shown, the present application discloses an adaptive glare suppression method for high reflectivity part image, and the technical scheme adopted is as follows:
[0035] Step 1: Collecting high reflectivity part pictures, adopting a reflected light mode, adjusting the camera, lens and light source to make the imaging quality best (the collected image is an 8-bit data depth gray image) ;
[0036] Fixing the image collection device, adjusting the lens focal length to make the picture from blurred to clear and then to blurred, and in this process, the point corresponding to the most clear zoom ring of the picture will appear; continuously repeating the above process near the corresponding point until the picture is the clearest;
[0037] Step 2, collecting pictures Wherein f represents the picture, the subscript original represents the original picture, and the superscript MxN represents the image width and height, and the histogram distribution statistics are performed, and the purpose is to solve the adaptive segmentation factor l, including the following steps:
[0038] Step 201, creating a 1x256 histogram array Hist_Tuple, traversing the original image The gray value of the pixel point is stored in the corresponding column of the array Hist_Tuple (assuming that the value of a certain pixel point is 128, then the value in the 128th column of the corresponding Hist_Tuple is added by 1) ;
[0039] Step 202, setting a statistical threshold T Sta_threshold ;
[0040] Step 203, taking the gray value 128 as the segmentation point, calculating the percentage of the number of pixel points greater than 128 in Hist_Tuple to the total pixels, and comparing it with T Sta_thresholdThe comparison yields the splitting factor l, as shown in the following formula, where... Indicates rounding down:
[0041]
[0042] Step 3: After obtaining the segmentation factor l, the original image... The image is divided into m×n image blocks of size l×l, where m and n satisfy the following formula: Through public announcement Calculate the grayscale mean of the original image. original The difference between the difference and each segmented image block is calculated, and the result is stored in the matrix Diff_Tuple (matrix size m×n), as shown in the following formula:
[0043]
[0044] Step 4: Find the minimum value Min in Diff_Tuple, and form the background matrix by subtracting Min from each element in Diff_Tuple. As shown in the following formula:
[0045]
[0046] Step 5, process the obtained background image matrix Bicubic interpolation is performed to ensure that the image matrix after background modeling is the same size as the original image. The interpolation function is G, and the interpolated background image is... The interpolation formula is:
[0047] Step 6, Original Image With background modeling image The difference is the image after high reflectivity glare suppression. As shown in the following formula:
[0048]
[0049] The working principle of this invention is as follows: First, the original image... Perform grayscale histogram statistics, store the statistical results of the image in a histogram array Hist_Tuple, analyze the ratio of the number of pixels with higher pixel values in Hist_Tuple to the total number of pixels (M×N), and compare it with a set threshold T. Sta_threshold By comparison, the adaptive segmentation factor l of the region is obtained, realizing the adaptive calculation of the segmentation window for local spatial information items; using the adaptive segmentation factor l as a benchmark, the original M×N image is... Transform the image into several m×n l×l square matrices; calculate the mean gray value of each matrix and compare it with the original image. Mean original The difference is stored in the background matrix Diff_Tuple with the size of m x n, and the minimum value Min is obtained; based on Min, the value in Diff_Tuple is subtracted from Min to generate a background modeling image with the size of m x n (the value of each pixel point is the difference between the mean value of the original image m x n blocks and Min); the generated background modeling image with the size of m x n is interpolated into an image with the same size of the original image M x N The original image Subtract the background modeling image is the image after the high reflectivity glare is suppressed
[0050] In addition, the image acquisition device in the embodiment is a camera with the model number of Daheng Image-MER-133R54GM; the lens is Daheng Image-HN-3519-5M-C2 / 3X.
[0051] The components not described in detail herein are prior art.
[0052] Although the specific embodiments of the present application are described in detail above, the present application is not limited to the above embodiments, and various changes can be made within the knowledge of those skilled in the art without departing from the purpose of the present application, and the modifications or changes without creative labor are still within the protection scope of the present application.
Claims
1. A method of adaptive glare inhibition of a high-reflectance part image, characterized in that, The method comprises the following steps: Step 1, collecting the picture of the high-reflectivity part with the best imaging quality in a reflective light mode; Step 2, performing histogram statistics on the collected picture to obtain an adaptive segmentation factor; Step 3, dividing the original image into image blocks with the width and height of the segmentation factor, and obtaining the difference between the mean value of the image blocks and the mean value of the original image; Step 4, obtaining the minimum value of the difference in step 3, and obtaining the background matrix by subtracting the minimum value from the difference in step 3; Step 5, interpolating the background matrix into a matrix with the same size as the original image; Step 6, subtracting the interpolated image from the original image to obtain the image after glare suppression; In step 2, histogram distribution statistics are performed on the captured picture and an adaptive segmentation factor l is solved, specifically including the following steps: Step 201, create a histogram array Hist_Tuple, traverse the original image The gray value of the pixel point is stored in the corresponding column of the array Hist_Tuple. Step 202, set the statistical threshold T Sta_threshold ; Step 203, taking the gray value as the segmentation point, calculate the percentage of the pixel point number value in the total pixels in Hist_Tuple, and compare it with the statistical threshold T Sta_threshold Comparison, get the segmentation factor l, as shown in the following formula, in which Indicates the floor function:
2. The method of claim 1, wherein the method is performed by a computer system. The image collected in step 1 is a gray-scale image with 8-bit data depth, comprising the following steps: Step 101, fixing the image collection device; Step 102, adjusting the lens focal length; Step 103, until the picture is clearest.
3. The method of claim 1, wherein: In step 3 shown, l is set as the segmentation factor, and the original image is... The image is divided into m×n blocks of size l×l, where m and n satisfy the following formula: Calculate the original image Mean of grayscale original As shown in the following formula: Original image Mean of grayscale original The difference between each segmented image patch and the subtraction result is stored in the matrix Diff_Tuple, as shown in the following formula:
4. The method of claim 1, wherein: In step 4, the minimum value Min in the matrix Diff_Tuple is found, and the background matrix is formed by subtracting Min from all elements in Diff_Tuple As shown in the following formula:
5. The method of claim 1, wherein: The obtained background image matrix is processed by bicubic interpolation in step 5 The interpolation function is G, and the background image after interpolation is The interpolation function is as follows:
6. The method of claim 1, wherein: In step 6, the original image is subtracted from the background model image to produce the high-reflectivity glare suppressed image as shown below: