A method for texture detection and matching of printed patterns on surfaces of electronic components

By employing the ORBAM method and utilizing adaptive contrast enhancement and feature point screening techniques, the interference of illumination changes on texture detection is resolved. This enables accurate differentiation of devices with similar surface textures and detection of missing or incorrect insertions, ensuring fuse box quality and protecting vehicle safety.

CN116563254BActive Publication Date: 2026-02-24JILIN UNIVERSITY
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202310533972.6
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-05-12
Publication Date
2026-02-24
Estimated Expiration
2043-05-12

AI Technical Summary

Technical Problem

Existing technologies lack mature image texture detection methods, making it difficult to accurately distinguish relays with highly similar surface textures under different lighting conditions. Furthermore, issues such as missing or incorrect insertions cannot be effectively detected, affecting vehicle driving safety.

Method used

An ORBAM (Oriented Pattern Detection and Matching) method for printed patterns on electronic components is adopted. This method combines adaptive contrast enhancement, image pyramid feature point extraction, maximum density constraint screening, and four-valued feature descriptors with Hamming distance and RANSAC methods to match texture feature regions and calculate similarity to determine the correctness of the device.

Benefits of technology

It improves the accuracy and differentiation of detection under different lighting conditions, effectively identifies missing and incorrect insertions, ensures the quality of fuse box assembly, and protects vehicle driving safety.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116563254B_ABST
    Figure CN116563254B_ABST
Patent Text Reader

Abstract

The application discloses a kind of texture detection and matching method of electronic component surface printing pattern, is abbreviated as ORBAM (ORB and Area Match) algorithm, belong to the quality detection technical field in automobile insurance box assembly production line.For solving the problem that the existing image detection method needs to solve the interference caused by the change of illumination condition on the detection result and improve the accuracy of the detection of dissimilar devices with similar surface texture, the application takes a series of improvement measures based on ORB algorithm, improves the contrast of image under non-ideal illumination condition by adaptive contrast enhancement method, improves the performance of texture description algorithm by using feature point screening based on maximum density constraint and four-value feature descriptor, and calculates the similarity between standard device and device to be tested by using feature coverage area, effectively solves the detection problem of dissimilar devices with similar surface texture.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention belongs to the field of automotive fuse box electronic component assembly quality inspection technology. Background Technology

[0002] The fuse box in a car is a protective device for the vehicle's electrical system. It typically contains two types of components: fuses and relays. Different specifications or varieties of these components are selected based on the circuit protection requirements. Fuse box quality inspection includes testing the types of components. For components like relays, the inspection mainly checks for missing or incorrectly inserted components. If such situations occur during assembly, the fuse box should be considered substandard. If a substandard fuse box is installed in a vehicle due to inspection errors that are not detected in time, it will pose a safety hazard. Currently, there is no mature and universal image texture-based inspection method for electronic components like relays with printed patterns. Therefore, using image texture inspection methods for quality inspection requires addressing the interference of varying lighting conditions on measurement accuracy, as well as the accurate differentiation of components with highly similar surface textures. Summary of the Invention

[0003] To address the challenges of existing image detection methods for devices with printed surface patterns, such as interference from varying lighting conditions and the need to improve accuracy in detecting dissimilar devices with highly similar surface textures, this invention proposes a texture detection and matching method for printed surface patterns of electronic components, abbreviated as ORBAM (ORB and Area Match), based on the ORB algorithm. The technical solution adopted in this invention mainly includes the following steps:

[0004] Step 1: The industrial control computer system uses an industrial camera to capture images of the fuse box within a closed enclosure, ensuring that the printed patterns on the surface of the electronic components are clearly and completely imaged.

[0005] Step 2: Before mass production of the fuse box, take and save a standard image f of the printed pattern on the surface of the electronic components to establish a texture feature description.

[0006] Step 3: During the assembly and production process, take an image f′ of the device under test, extract feature points using the method in Step 2, and establish a texture feature description.

[0007] Step 4: Perform region matching between the texture features of the product to be tested and the texture features of the standard image, and calculate the similarity. If the similarity is higher than the threshold, the assembly is correct; otherwise, the assembly is incorrect and the product fails the inspection.

[0008] The method for establishing texture feature descriptions in step two includes the following steps:

[0009] 1) Convert the device image f into a grayscale image g;

[0010] 2) Then, the contrast enhancement image g_e is obtained using the adaptive contrast enhancement method;

[0011] 3) Using the contrast-enhanced image g_e as the initial image g_e0, construct the image pyramid {g_e}. i |i=0,1,…,n c}, n c The total number of layers in the image pyramid is set;

[0012] 4) The FAST algorithm is used to extract feature points from each layer of the image pyramid;

[0013] The gray value of a point P in the image is g P , and its neighboring pixels P1 to P j They are divided into three categories: d (dark), s (similar), and b (b bright), with the corresponding category denoted as S. j The classification formula is as follows:

[0014]

[0015] Among them, g Δ The grayscale threshold is set; if there are consecutive pixels greater than or equal to N in the neighborhood of point P. P If there are 3 non-s pixels of the same category, then point P is taken as the feature point.

[0016] 5) Feature point selection based on maximum density constraints;

[0017] 6) Establish a four-valued feature descriptor;

[0018] The implementation process of the adaptive contrast enhancement method is as follows:

[0019] (1) Use the Sobel edge detection operator to traverse the grayscale image g to enhance edge features. The resulting image is denoted as sobel_g.

[0020] (3) Perform mean filtering and normalization on the grayscale image g and the edge image sobel_g respectively to obtain the images g_m and sobel_m.

[0021] (4) For pixel (x, y) in grayscale image g, calculate its enhancement coefficient m(x, y) using image g_m and sobel_m, as follows:

[0022] m(x, y)=g_m(x, y)-k1(sobel_m(x, y)-k2)

[0023] Adjust coefficients k1 and k2 so that when the pixel gradient is large, coefficient m is appropriately reduced; when the pixel gradient is small, coefficient m is appropriately increased.

[0024] (5) Use the enhancement function of the following formula to traverse the grayscale image g and calculate the contrast enhancement image g_e of the standard image f. Adjusting E can control the slope of the enhancement function curve.

[0025]

[0026] The implementation process of feature point selection based on maximum density constraints in step two is as follows:

[0027] Feature point selection optimization based on maximum density constraint

[0028] First, starting from the nth position of the image pyramid... c The process begins by traversing downwards and filtering feature points. Let the current layer be layer i, initialized with i = n. c Then, based on the i-th layer image g_e i Construct feature cover maps of the same size c i , This represents the number of feature points detected at the pixel position (x, y), with an initial value set to 0. It directly reflects the cluster density of feature points.

[0029] Traversing image g_e i For each feature point in the map, update the feature coverage map c. i Let the feature point with coordinates (x, y) be K(x, y), and t a To set a threshold, if If the feature point is not selected, discard it; otherwise, retain it and establish a w-axis with coordinates (x, y) as the center. c ×w c The coverage area is denoted as rect. K And iterate through and update the points in this region. Assignment:

[0030]

[0031] According to feature coverage map c i The nearest neighbor interpolation method is used to obtain the image g_e at the (i-1)th layer of the image pyramid. i-1 c of the same size i-1 Next, the feature points obtained from the (i-1)th layer image are filtered, and the above operation is repeated until the 0th layer image g_e0 is obtained.

[0032] The process of establishing the four-valued feature descriptor in step two is as follows:

[0033] (1) First, taking the feature point K(x, y) as the center, at w b ×w b Randomly select n from the neighborhood of the size b A fixed pair of pixels, p n p represents the nth pair of pixels of feature point K(x, y). n =((x) 1n y 1n ), (x 2n y 2n )).

[0034] (2) Classification result δ(p) n The design consists of four categories of numerical values, represented by two binary digits. The discrimination formula is as follows:

[0035]

[0036] Where t b1 , t b2 This is the threshold for judging pixel value differences.

[0037] (3) Calculate the descriptor b of the feature point using the following formula. K (n b ):

[0038]

[0039] The implementation process of the texture feature region matching and similarity calculation method in step four is as follows:

[0040] (1) Use Hamming distance to perform brute-force matching of feature points in images f and f′, and use the Random Sample Consensus (RANSAC) method to eliminate mismatches.

[0041] (2) Calculate the matching and unmatched regions

[0042] The coverage area of ​​feature point K(x, y) is defined as centered at (x, y), w r ×w r A square, denoted as rect K .

[0043] Let N be the number of matched feature points in the standard image f. fr The union of the areas covered by the matched feature points constitutes the region describing the texture features, denoted as Area. fr :

[0044]

[0045] Similarly, the coverage area of ​​all unmatched feature points can be calculated, denoted as Area. fe .

[0046] Further modify the Area by taking the difference between the unmatched and matched coverage areas. fe :

[0047] Area fe =Area fe -Area fr

[0048] To obtain the coverage area of ​​all features in the device, the unmatched coverage area is joined with the matched coverage area, denoted as Area. f :

[0049] Area f =Area fr UArea fe

[0050] Similarly, for the image f′ of the product to be tested, calculate its Area. f′r Area f′e and Area f′ .

[0051] Let D be the similarity ratio between the image f′ of the device under test and the standard image f. The area of ​​the region Area is calculated using the function S(Area). The formula for calculating the similarity ratio D is as follows:

[0052]

[0053] The closer D is to 1, the smaller the proportion of the unmatched area in the total area, and the more similar the image to the standard image is; conversely, the closer D is to 0, the larger the proportion of the unmatched area in the total area, and the greater the difference between the image to be tested and the standard image.

[0054] When D>t D If the image f′ of the device under test and the standard image f are similar, the product assembly is correct; otherwise, the product assembly is incorrect. The threshold t can be adjusted appropriately according to the similarity of the components. D .

[0055] The beneficial effects of this invention are:

[0056] This invention establishes a visual inspection system and designs an image texture-based detection method and process for devices such as relays with textured printed patterns on their surfaces. This method can eliminate the influence of different lighting conditions on the detection results and solve the detection problem of highly similar devices being difficult to distinguish. Attached Figure Description

[0057] Figure 1 This is a technical roadmap of the method of the present invention;

[0058] Figure 2 This is a diagram showing the effect of the adaptive contrast enhancement method.

[0059] Figure 3 A schematic diagram of the FAST algorithm;

[0060] Figure 4 The figure shows a comparison of the performance of the improved ORB feature extraction method and ORB, where (a) is the distribution of feature points extracted by the improved ORB method and (b) is the distribution of feature points extracted by the ORB method.

[0061] Figure 5 For the fuse box Figure 4 The images shown represent the relay installation positions, where (a) is an image of a relay of the same type, (b) is an image of a relay of a different type, and (c) is an image of a relay that was not installed.

[0062] Figure 6 for Figure 5 (a) Overall coverage area and unmatched coverage area of ​​similar devices, where (a) is the overall coverage area of ​​the standard image, (b) is the unmatched coverage area of ​​the standard image, (c) is the overall coverage area of ​​the image under test, and (d) is the unmatched coverage area of ​​the image under test.

[0063] Figure 7 for Figure 5 (b) Overall coverage area and unmatched coverage area of ​​the heterogeneous device, where (a) is the overall coverage area of ​​the standard image, (b) is the unmatched coverage area of ​​the standard image, (c) is the overall coverage area of ​​the image under test, and (d) is the unmatched coverage area of ​​the image under test.

[0064] Figure 8 for Figure 5 (c) Overall coverage area and unmatched coverage area diagrams when a device is missing, where (a) is the overall coverage area of ​​the standard image, (b) is the unmatched coverage area of ​​the standard image, (c) is the overall coverage area of ​​the image under test, and (d) is the unmatched coverage area of ​​the image under test. Detailed Implementation

[0065] The present invention will be further described below with reference to the accompanying drawings and specific implementation methods, which are not intended to limit the scope of protection of the present invention.

[0066] This invention relates to a method for texture detection and matching of printed patterns on the surface of electronic components, the complete steps of which are as follows:

[0067] Step 1: Establish a vision inspection system in a closed enclosure. The enclosure contains a 15-megapixel industrial camera, along with a diffuse light source. Adjust the camera's focal length and the brightness of the diffuse light source to capture complete images of the printed patterns on the surface of electronic components. Transmit the images to the industrial control computer in real time for image processing.

[0068] Step 2: Before industrial assembly production, a standard image f of the printed pattern on the surface of the electronic component is captured and saved to establish a texture feature description. This invention, targeting manually designed, simple printed patterns, adopts a series of improvements based on the ORB method, designing an improved ORB method to enhance the accuracy and real-time performance of the feature description algorithm.

[0069] 1. Adaptive contrast enhancement

[0070] Because the detection lighting conditions are limited by some objective factors (such as conflicting lighting requirements of electronic components within the camera's field of view) or changes in lighting during the detection process (such as light leakage through pores in the device carrier), the clarity of the acquired images may be low, which will seriously affect the accuracy of feature description. Therefore, image preprocessing is performed first to improve the contrast of the device images. To adapt to different lighting conditions, this invention proposes an adaptive contrast enhancement method, the specific steps of which are as follows:

[0071] (1) First, convert the device image f into a grayscale image g.

[0072] (2) Use the Sobel edge detection operator to traverse the grayscale image g to enhance edge features. The resulting gradient image is denoted as sobel_g.

[0073] Let the gray value of pixel (x, y) in image g be g(x, y), and the gradients of this point along the x and y axes be G and G, respectively. x G Y ,but:

[0074] G x =[g(x+1,y-1)+2*g(x+1,y)+g(x+1,y+1)]-[g(x-1,y-1)+2*g(x-1,y)+g(x-1,y+1)]

[0075] G Y =[g(x-1,y-1)+2*g(x,y-1)+g(x+1,y-1)]-[g(x-1,y+1)+2*g(x,y+1)+g(x+1,y+1)]

[0076] Let the gradient of pixel (x, y) in image sobel_g be denoted as sobel_g(x, y), then:

[0077]

[0078] (3) Perform mean filtering and normalization on the grayscale image g and the gradient image sobel_g respectively to obtain images g_m and sobel_m.

[0079] (4) For pixel (x, y) in grayscale image g, calculate its enhancement coefficient m(x, y) using image g_m and sobel_m, as follows:

[0080] m(x, y)=g_m(x, y)-k1(sobel_m(x, y)-k2)

[0081] Adjust coefficients k1 and k2 so that when the pixel gradient is large, coefficient m is appropriately reduced; when the pixel gradient is small, coefficient m is appropriately increased.

[0082] (5) Use the enhancement function of the following formula to traverse the grayscale image g to calculate the contrast enhancement image g_e of the standard image f.

[0083]

[0084] As can be seen from the above formula, when the coefficient m decreases, the pixel grayscale increases; when the coefficient m increases, the pixel grayscale decreases. Adjusting E controls the slope of the contrast enhancement function curve.

[0085] Figure 2 The text presents before-and-after comparison images of several typical device images after applying the adaptive contrast enhancement method to demonstrate the algorithm's effectiveness. The second row of images shows the processing results obtained after applying the adaptive contrast enhancement method to the corresponding original images in the first row; the image clarity is significantly improved, and edge features are highlighted.

[0086] In addition, the standard deviation of image gray levels is commonly used to measure image contrast. A larger standard deviation generally indicates more pronounced contrast, while a smaller standard deviation generally indicates less pronounced contrast. The formula for calculating the standard deviation of image gray levels is:

[0087]

[0088] M and N are the image pixel width and height, and μ is the average gray level of the image pixels.

[0089] and Figure 2 The changes in the grayscale standard deviation of the before and after comparison images of the corresponding adaptive contrast enhancement method are shown in Table 1. It can be seen that the standard deviation has increased to 3 to 4 times the original value.

[0090] Table 1

[0091] grayscale standard deviation of the original image Standard deviation of grayscale in contrast-enhanced images Multiple relationship 10.17 46.55 4.58 6.83 23.54 3.45 9.39 44.11 4.70 7.29 21.95 3.01

[0092] 2. Constructing an image pyramid

[0093] The contrast-enhanced grayscale image g_e is initialized to g_e0, and the total number of layers in the image pyramid is set to n. c The scaling parameter is s c Then the i-th layer image g_e i The scaling parameter relative to the original image. i for:

[0094]

[0095] Using the bilinear interpolation downsampling method, an image pyramid {g_e} is constructed based on the initialized grayscale image g_e0. i |i = 0, 1, ..., n c}, to obtain image information at different scales.

[0096] 3. Feature points are obtained from the image pyramid using the FAST algorithm and based on the maximum density constraint.

[0097] (1) Using the i-th layer image g_e i Taking point P as an example, the process of extracting feature points using the FAST algorithm is described.

[0098] like Figure 3 As shown, a circular neighborhood is drawn around point P with a radius of 3. The pixels in the neighborhood are denoted as P1 to P2. 16 Let the gray value of point P be g. P , neighboring pixels P1 to P 16 They are divided into three categories: d (dark), s (similar), and b (bright), with the corresponding category denoted as S. j The classification formula is as follows:

[0099]

[0100] Among them, g Δ The grayscale threshold is set, and its value is generally between 10 and 20.

[0101] If there are consecutive pixels greater than or equal to N in the 16 neighboring pixels of point P P If there are N non-s pixels of the same category, then point P is taken as the feature point, and N P In the ORB algorithm, the value is 9.

[0102] (2) Feature point selection optimization based on maximum density constraint

[0103] The ORB algorithm, based on an image pyramid, organizes detected feature points from different scales into a feature point set. This leads to the same feature point being repeatedly detected at different scales, resulting in feature point clustering and uneven distribution. This affects the accuracy of subsequent similarity ratio calculations based on texture features. To achieve a more uniform distribution of extracted feature points and more fully extract image texture features, this invention proposes a feature point selection method based on maximum density constraints to optimize the feature point distribution.

[0104] First, from the nth image pyramid c The process begins by traversing downwards and filtering feature points. Let the current layer be layer i, initialized with n. c Then, based on the i-th layer image g_e i Construct feature cover maps of the same size c i , This represents the number of feature points detected at the pixel position (x, y), with an initial value set to 0. It directly reflects the cluster density of feature points.

[0105] Traversing image g_e i For each feature point in the map, update the feature coverage map c. i Let the feature point with coordinates (x, y) be K(x, y). If If the feature point is not selected, discard it; otherwise, retain it and establish a w-axis with coordinates (x, y) as the center. c ×w c The coverage area is denoted as rect. K To traverse the points within this region, perform the following operations:

[0106]

[0107] Adjust w c This is equivalent to adjusting the pixel range represented by the feature point, and can be assigned a value according to the density of the texture of the printed pattern.

[0108] To establish the relationship between feature descriptions at different scales of the image pyramid, based on the feature coverage map c i The nearest neighbor interpolation method is used to obtain the image g_e at the (i-1)th layer of the image pyramid. i-1 c of the same size i-1 Next, the feature points obtained from the (i-1)th layer image are filtered, and the above operation is repeated until the 0th layer image g_e0 is obtained.

[0109] 4. Establish a four-valued feature descriptor.

[0110] The ORB algorithm uses BRIEF feature descriptors to construct feature vectors.

[0111] (1) First, taking the feature point K(x, y) as the center, at w b ×w b Select n within the neighborhood of the size b A fixed pair of pixels, p n p represents the nth pair of pixels of feature point K(x, y). n =((x) 1n y 1n ), (x 2n y 2n Set {p} n |n = 1, 2, ..., n b} constitutes the point set S. b Values ​​31 and n b The value is 256.

[0112] (2) When generating the BRIEF feature descriptor, the main method is to classify the gray values ​​of pixel pairs into two categories: greater than or equal to and less than, represented by a single bit of binary. The adaptive contrast-enhanced image obtained in the early stages of this invention has a prominent foreground edge. To more precisely describe the differences in texture features, the classification result δ(p) is used... n The design consists of four categories of numerical values, represented by two binary digits. The discrimination formula is as follows:

[0113]

[0114] Where t b1 , t b2 This is the threshold for judging pixel value differences.

[0115] (3) The classification result of each pixel pair in the point set S of feature point K(x,y) is used to calculate the descriptor b of the feature point. K (n b ):

[0116]

[0117] Step 3: During the assembly and production process, take an image f′ of the device under test, extract feature points using the method in Step 2, and establish a texture feature description.

[0118] Step 4: Perform region matching between the texture features of the product to be tested and the texture features of the standard image, and calculate the similarity. If the similarity is higher than the threshold, the assembly is correct; otherwise, the assembly is incorrect and the product fails the inspection.

[0119] 1. Use Hamming distance-based feature matching to divide feature points into a matching set and an unmatched set.

[0120] The similarity between any two feature points is calculated using the Hamming distance between feature descriptors; the smaller the Hamming distance, the more similar the two feature points. A BFMatcher matcher is used to perform brute-force matching of feature points in the product image f′ and the standard image f, and then the RANSAC method is used to eliminate mismatches. After these methods, all feature points are divided into a set P of matched feature points. r The set of unmatched feature points P in the standard image f ef The set of unmatched feature points P in the image f′ of the device under test ef′ .

[0121] 2. Calculate the matching and unmatched regions.

[0122] The coverage area of ​​feature point K(x, y) is defined as centered at (x, y), w r *w r A square, denoted as rect l .

[0123] Let N be the number of matched feature points in the standard image f. fr The union of the areas covered by the matched feature points constitutes the region describing the texture features, denoted as Area. fr :

[0124]

[0125] Similarly, the coverage area of ​​all unmatched feature points can be calculated, denoted as Area. fe .

[0126] Next, the difference between the unmatched and matched coverage areas is calculated to further modify the Area. fe :

[0127] Area fe =Area fe -Area fr

[0128] To obtain the coverage area of ​​all features in the device, the unmatched coverage area is joined with the matched coverage area, denoted as Area. f :

[0129] Area f =Area fr UArea fe

[0130] Similarly, the Area is calculated for the image f′ of the product to be tested. f′r Area f′e and Area f′ .

[0131] Figure 6 , Figure 7 and Figure 8 They were listed separately Figure 5 The image shows the overall coverage area and mismatched coverage area of ​​similar, dissimilar, and missing insertion devices in device (a), where (a) represents the overall coverage area of ​​the standard image. f (b) is the area of ​​coverage that does not match the standard image. fe (c) represents the overall coverage area of ​​the image under test. f′ (d) represents the unmatched coverage area of ​​the image under test. f′e .

[0132] 4. Similarity ratio calculation

[0133] Let D be the similarity ratio between the image f′ of the device under test and the standard image f. The area of ​​the region Area is calculated using the function S(Area). The formula for calculating the similarity ratio D is as follows:

[0134]

[0135] The closer D is to 1, the smaller the proportion of the mismatched area in the total area, and the more similar the tested image is to the standard image; conversely, the closer D is to 0, the larger the proportion of the mismatched area in the total area, and the greater the difference between the tested image and the standard image. Table 2 lists the similarities with... Figure 6 , Figure 7 and Figure 8 The calculation results of the coverage area and similarity ratio D for the corresponding similar, dissimilar and missed detections.

[0136] Table 2

[0137]

[0138]

[0139] When D>t D If the image f′ of the device under test and the standard image f are similar, the product assembly is correct; otherwise, the product assembly is incorrect. The threshold t can be adjusted appropriately according to the similarity of the components. D .

[0140] The implementation of the present invention has been described in detail above with reference to the accompanying drawings. Although specific terms are used in the description, they should not be used to limit the scope of protection of the present invention. Those skilled in the art can make changes or modifications to the present invention after understanding its spirit and principles to achieve equivalent purposes. Such equivalent changes and modifications should all be covered within the scope defined by the patent claims.

Claims

1. A method for texture detection and matching of printed patterns on the surface of electronic components, characterized in that, The steps of this method are as follows: Step 1: The industrial control computer system uses an industrial camera to capture images of the fuse box within a closed enclosure, ensuring that the printed patterns on the surface of the electronic components are clearly and completely imaged. Step 2: Before mass production of the fuse box, take and save standard images f of the printed patterns on the surface of the electronic components to establish texture feature descriptions; Step 3: During the assembly and production process, take an image f′ of the device under test, extract feature points using the method in Step 2, and establish a texture feature description; Step 4: Perform region matching between the texture features of the device under test and the texture features of the standard image, and calculate the similarity. If the similarity is higher than the threshold, the assembly is correct; otherwise, the assembly is incorrect and the product fails the inspection. The method for establishing texture feature descriptions in step two includes the following steps: 1) Convert the standard image f to a grayscale image g; 2) Then, the contrast enhancement image g_e is obtained using the adaptive contrast enhancement method; 3) Using the contrast-enhanced image g_e as the initial image g_e0, construct the image pyramid {g_e}. i |i=0,1,…,n c }, n c The total number of layers in the image pyramid is set; 4) The FAST algorithm is used to extract feature points from each layer of the image pyramid; The gray value of a point P in the image is g P , and its neighboring pixels P1 to P j They are divided into three categories: d (dark), s (similar), and b (b bright), with the corresponding category denoted as S. j The classification formula is as follows: Among them, g Δ The grayscale threshold is set; if there are consecutive pixels greater than or equal to N in the neighborhood of point P. P If there are 3 non-s pixels of the same category, then point P is taken as the feature point. 5) Feature point selection based on maximum density constraints; First, starting from the nth position of the image pyramid... c The process begins by traversing downwards and filtering feature points. Let the current layer be layer i, initialized with i = n. c Then, based on the i-th layer image g_e i Construct feature cover maps of the same size c i , This represents the number of feature points detected at the pixel position (x, y), with an initial value set to 0. It directly reflects the cluster density of feature points; Traversing image g_e i For each feature point in the map, update the feature coverage map c. i Let the feature point with coordinates (x, y) be K(x, y), t a To set a threshold, if If the feature point is not selected, discard it; otherwise, retain it and establish a w-axis with coordinates (x, y) as the center. c ×w c The coverage area is denoted as rect. K And iterate through and update the points in this region. Assignment: According to feature coverage map c i The nearest neighbor interpolation method is used to obtain the image g_e at the (i-1)th layer of the image pyramid. i-1 c of the same size i-1 Next, the feature points obtained from the (i-1)th layer image are filtered, and the above operation is repeated until the 0th layer image g_e0 is obtained. 6) Establish a four-valued feature descriptor; (1) First, taking the feature point K(x,y) as the center, at w b ×w b Randomly select n from the neighborhood of the size b A fixed pair of pixels, p n p represents the nth pair of pixels of feature point K(x,y). n =((x) 1n ,y 1n ),(x 2n ,y 2n )); (2) Classification result δ(p) n The design consists of four categories of numerical values, represented by two binary digits. The discrimination formula is as follows: Where t b1 , t b2 The threshold for judging pixel value differences; (3) Calculate the descriptor b of the feature point using the following formula. K (n b ): The implementation process of the texture feature region matching and similarity ratio calculation method in step four is as follows: (1) Use Hamming distance to perform brute-force matching of feature points in the standard image f and the image f′ of the device under test, and use the random sampling consistency method to eliminate mismatches; (2) Calculate the matching and unmatched regions The coverage area of ​​feature point K(x,y) is defined as centered at (x,y), w r ×w r A square, denoted as rect l ; Let N be the number of matched feature points in the standard image f. fr The union of the areas covered by the matched feature points constitutes the region describing the texture features, denoted as Area. fr : Similarly, the coverage area of ​​all unmatched feature points can be calculated, denoted as Area. fe ; Further modify the Area by taking the difference between the unmatched and matched coverage areas. fe : Area fe =Area fe -Has fr To obtain the coverage area of ​​all features in the device, the unmatched coverage area is joined with the matched coverage area, denoted as Area. f : Area f =Area fr ∪Area fe Similarly, for the image f′ of the device under test, its Srea is calculated. f′r Area f′e and Srea f′ ; Let D be the similarity ratio between the image f′ of the device under test and the standard image f. The area of ​​the region Area is calculated using the function S(Area). The formula for calculating the similarity ratio D is as follows: The closer D is to 1, the smaller the proportion of the mismatched area in the total area, and the more similar the image of the device under test is to the standard image; conversely, the closer D is to 0, the larger the proportion of the mismatched area in the total area, and the greater the difference between the image of the device under test and the standard image. When D>t D If the image f′ of the device under test and the standard image f are of the same type, the product assembly is correct; otherwise, the product assembly is incorrect; threshold t D Adjustments are made based on the similarity of the components.

2. The method for texture detection and matching of printed patterns on the surface of electronic components according to claim 1, characterized in that, The implementation process of the adaptive contrast enhancement method in step two is as follows: (1) Use the Sobel edge detection operator to traverse the grayscale image g to enhance edge features. The resulting image is denoted as sobel_g. (3) Perform mean filtering and normalization on the grayscale image g and the edge image sobel_g respectively to obtain images g_m and sobel_m; (4) For pixel (x,y) in grayscale image g, calculate its enhancement coefficient m(x,y) using image g_m and Sobel_m, as follows: m(x,y)=g_m(x,y)-k1(sobel_m(x,y)-k2) Adjust coefficients k1 and k2 so that when the pixel gradient is large, coefficient m is appropriately reduced; When the pixel gradient is small, the coefficient m should be increased appropriately; (5) Use the enhancement function of the following formula to traverse the grayscale image g and calculate the contrast enhancement image g_e of the standard image f. Adjusting E can control the slope of the enhancement function curve.

Citation Information

Patent Citations

  • V-SLAM pose estimation method based on Kinect camera

    CN112164117A

  • Visual implementation method for measuring assembly height and inclination degree of device in automobile fuse box

    CN113624145A