Large-format cross-scale adhesive film defect detection method and device
Through image difference method, anchor frame algorithm, genetic algorithm and improved Laplace pyramid fusion method, the stitching accuracy and efficiency problems in film engraving defect detection are solved, and efficient and accurate film defect detection is achieved.
Patent Information
- Application Number
- CN202510160183.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-02-13
- Publication Date
- 2025-10-21
- Estimated Expiration
- 2045-02-13
AI Technical Summary
Existing technologies for film stencil defect detection have problems with insufficient splicing accuracy, processing efficiency, and poor detail retention. In particular, it is difficult to accurately locate small defects under changing lighting conditions or complex backgrounds.
A large-scale cross-scale film defect detection method is adopted. The printed image and text information is extracted by image difference method. The scanning path is optimized by combining anchor frame algorithm and genetic algorithm. High-resolution images are acquired by dual-axis linkage control and fine focusing strategy. Image registration is performed by applying converter-based local feature matching network. Image stitching and fusion are performed by using improved Laplace pyramid fusion method.
It significantly improves detection accuracy and efficiency, reduces computing time, can handle the identification of more than 20,000 film defects, and avoids common problems in image fusion such as ghosting and misalignment.
Smart Images

Figure CN119991644B_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the field of industrial automation detection, and more specifically, relates to a large-scale cross-scale film defect detection method and device. Background Art
[0002] With the advancement of industrial automation, adhesive films are increasingly being used in electronics manufacturing, the photovoltaic industry, and printing. The quality of adhesive films directly impacts product reliability and appearance. During the production process, adhesive film stencils are prone to defects such as bubbles, scratches, residue, and uneven pattern printing. These defects not only impact subsequent processing but can also lead to finished product scrapping and increase production costs. Therefore, accurately detecting and locating adhesive film stencil defects has become a critical step in ensuring production quality. Currently, traditional methods for detecting adhesive film stencil defects rely primarily on manual visual inspection or simple machine vision algorithms. However, manual inspection is inefficient and susceptible to subjective factors, particularly when dealing with large numbers of adhesive film stencils, significantly increasing the probability of missed or false detections. While traditional machine vision-based inspection methods can partially replace manual inspection, they often rely on fixed rules (such as grayscale differences or texture features) and are prone to failure under varying lighting conditions or complex backgrounds. Furthermore, the complex patterns in adhesive film stencils complicate defect detection, making it particularly difficult to accurately locate small defects in finely printed patterns using traditional methods. Furthermore, traditional inspection systems suffer from shortcomings in processing efficiency and stitching accuracy. During the image stitching process, defective areas often cannot be accurately detected due to uneven boundary transitions or loss of details.
[0003] The invention patent with prior art publication number CN116167993A proposes a pipeline quality inspection method and pipeline quality inspection device based on panoramic vision. It first obtains multiple groups of local images of the target pipeline wall, then splices all the local images in each group to obtain multiple local panoramic images, and then splices multiple local panoramic images to obtain a pipeline panoramic image. Finally, based on the pipeline panoramic image, the pipeline panoramic image is detected based on a preset target detection model to identify and locate target defects. This method uses a Laplacian pyramid algorithm based on masks and optimal stitching lines to achieve smooth transitions at the image fusion point, but has shortcomings in splicing accuracy and processing efficiency. Summary of the Invention
[0004] In order to overcome the deficiencies in the prior art in terms of splicing accuracy, processing efficiency and detail retention, the present invention provides a large-scale cross-scale film defect detection method and device.
[0005] The primary purpose of the present invention is to solve the above technical problems, and the technical solutions of the present invention are as follows:
[0006] A first aspect of the present invention provides a large-scale cross-scale film defect detection method, comprising the following steps:
[0007] Performing coarse focusing on the camera and capturing the film image, coarsely scanning the film image and extracting information of printed images and texts in the film image using an image difference method, and outputting a differential image containing target image and text information;
[0008] Inputting the differential image into an anchor frame algorithm to obtain the coordinates of the fine scanning target area from the coarse scanning coordinates;
[0009] The coordinates of the target area of the fine scanning are input into the genetic algorithm, and the optimized fine scanning path is output in combination with the S-curve planning characteristics of the motor;
[0010] The path execution is completed by using the dual-axis linkage control combined with the precise scanning path to drive the motion platform. During the path execution, the precise focus search strategy is used to complete the camera focus and acquire high-resolution images of the defect area.
[0011] Performing image registration on the high-resolution images using an improved image registration algorithm based on a local feature matching network of a converter, performing image stitching and fusion on the registered images using an optimal seam line algorithm combined with an improved Laplace pyramid fusion method, and outputting a complete film image;
[0012] Perform defect detection on the complete film image and output the detection results.
[0013] Furthermore, the film image is roughly scanned and the information of the printed image and text in the film image is extracted using an image difference method, including the following steps:
[0014] Use a camera to acquire a film image to obtain an original input image;
[0015] Perform denoising on the original input image and output the denoised processed image;
[0016] Using historical frames or pre-collected background images as a comparison benchmark, a background image is obtained;
[0017] Perform a difference operation between the background image and the denoised processed image to obtain the difference map D(x,y), which is expressed as follows:
[0018] D(x,y)=255-|T(x,y)-S(x,y)|
[0019] Where (x, y) is the coordinate of the image pixel, T(x, y) is the pixel grayscale of the background image, and S(x, y) is the pixel grayscale of the film defect area in the current frame.
[0020] Furthermore, the differential image is input into the anchor frame algorithm to output the coordinates of the precise scan target area, including the following steps:
[0021] Perform multi-geometric feature filtering on the extracted difference image to remove artifacts and noise interference, and obtain the optimized foreground contour map;
[0022] The optimized foreground contour map is converted into coordinates through the anchor frame algorithm, the film foreground contour within the camera field of view is calculated, and converted into pixel coordinates under the fine scanning field of view, and the coordinates of the fine scanning target area are output.
[0023] Furthermore, the coordinates of the target area for fine scanning are input into the genetic algorithm, and the optimized fine scanning path is output in combination with the S-curve motion planning characteristics of the motor, including the following steps:
[0024] Read the center coordinate data of the precision scanning target area, set the population size and maximum evolutionary generations, and randomly generate the initial population. Each individual in the population represents a precision scanning path arrangement.
[0025] Calculate the fitness value of each individual in the population. The fitness function expression is as follows:
[0026]
[0027] Where n is the precise scanning coordinate set Q n The number of scan coordinates, C i is the current scanning coordinate, C i+1 is the next scanning coordinate, C i ∈Q n , C i+1 ∈Q n , T(C i ,C i+1 ) represents the time from the i-th target to the i+1-th target. According to the third-order S-curve motion planning, T(C i ,C j ) expression is as follows:
[0028] T(C i ,C j )=T a +T v +T d
[0029] Among them, T a For the acceleration period, the expression is as follows:
[0030]
[0031] T v is the uniform speed period, and the expression is as follows:
[0032]
[0033] T d is the deceleration time, and the expression is as follows:
[0034]
[0035] Among them, a a is the maximum acceleration in the acceleration section, V v is the maximum speed in the uniform speed section, a d is the deceleration in the deceleration stage, T v is the uniform speed period, a d is the deceleration in the deceleration stage, which is obtained from the S-curve motion planning. i ,C j ) is used to convert the Euclidean distance of the target area to the longest projection length in the X and Y directions. The expression is as follows:
[0036] d(C i ,C j )=max(|X i -X j |,|Y i -Y j |)
[0037] Among them, (X i ,Y i ) is point C i The coordinates of (X j ,Y j ) is point C j The coordinates of;
[0038] Sort the fitness values by size and assign selection probabilities according to the fitness values. The expression for selection probability is as follows:
[0039]
[0040] Among them, x represents the individual, FIT(x) represents the fitness of the individual, F j Represents the sum of all individual fitness values in the population;
[0041] The roulette wheel algorithm is used to select individuals from the next generation population based on the selection probability, and a partial matching crossover operation is performed on the selected population to generate new individuals while maintaining the rationality of the path structure. The path sequence of the individuals is randomly mutated and adjusted with a preset probability to avoid falling into a local optimum.
[0042] Construct a target optimization function to minimize the total time consumption. The target function expression is as follows:
[0043]
[0044] Where n is the precise scanning coordinate set Q n The number of scanned coordinates, the coordinate number range is [1,n], C i is the current scanning coordinate, C i+1 is the next scanning coordinate, C i ∈Q n , C i+1 ∈Q n , T(C i ,C i+1 ) is from scanning point C i To scanning point C i+1 Movement time, T(C n , C1) is from the last scan point C n Movement time back to the first scanning point C1;
[0045] Accumulate the current evolutionary generations and determine whether the maximum generation or fitness value convergence conditions are reached. If the conditions are not met, return to the fitness calculation step and continue iterative optimization; if the termination conditions are met, output the optimal path individual in the current population as the fine scanning path output.
[0046] Furthermore, the camera focus is completed using a fine focus search strategy, including the following steps:
[0047] Set the search step size of the camera focus module, and select a reasonable search step size based on geometric error compensation and coarse focus;
[0048] Calculate the clarity evaluation value F1 of the image at the current shooting position, set the initial search step length L, drive the camera motor to move one unit step length in a certain direction, and calculate the image clarity evaluation value F2 at the position after the movement. If F2>F1, continue to move in the current direction; otherwise, adjust the movement direction to the opposite direction and drive the camera motor to move twice the step length in the opposite direction;
[0049] Get the image after moving in the opposite direction and calculate its clarity evaluation value F3. If F3>F2, it means that the opposite direction is more conducive to improving clarity, and continue moving in this direction; otherwise, adjust the moving direction to the opposite direction again, and reduce the current step length L to 0.618 times the original step length;
[0050] Determine whether the current step size is less than the preset minimum step size d. If the step size is less than d, stop searching and the process ends; otherwise, return to iterate the above operations until the termination condition is met and the camera fine focus is completed.
[0051] Furthermore, the high-resolution image is registered using an improved image registration algorithm based on a local feature matching network of a converter, comprising the following steps:
[0052] For high-resolution images, the first preset method is used to calculate the average gradient amplitude of the image. If the average gradient amplitude is less than a preset threshold, it is judged as sparse feature. If the average gradient amplitude is greater than the preset threshold, it is judged as dense feature. For images to be registered with dense features, the second preset method is used to extract feature points. For images to be registered with sparse features, the third preset method is used to extract local feature points to obtain a high-quality feature point set.
[0053] Matching the feature point set using a feature matching algorithm to generate a matching point pair list;
[0054] Randomly select n pairs of points from the matching point pairs, calculate the transformation matrix based on the selected point pairs and evaluate whether the transformation model is an approximate standard translation transformation model. If it does not meet the approximate standard translation transformation conditions, reselect n pairs of points; if it meets the approximate standard translation transformation conditions, calculate the average distance error l between all matching points and the transformation model based on the translation transformation model. The expression is as follows:
[0055]
[0056] Among them, P i is the matching point, M is the point corresponding to the transformation model, and n is the number of selected matching points; the average distance error l is used as the error threshold t to divide the inliers and outliers. Points smaller than the threshold t are inliers, and points larger than the threshold t are outliers. The number of inliers is counted;
[0057] Repeat the above steps until the preset number of iterations is reached, and output the translation transformation model containing the largest number of inliers;
[0058] The output transformation model is applied to the image to be registered, and the image is geometrically transformed in combination with the model parameters to complete the image registration and output the registered image.
[0059] Furthermore, the first preset method is a Sobel operator fast calculation method, the second preset method is a SURF algorithm that adds color information, and the third preset method is a LoFTR algorithm.
[0060] Furthermore, the optimal seam line algorithm is combined with the improved Laplacian pyramid fusion method to perform image stitching and fusion to output a complete film image, including the following steps:
[0061] Extract the overlapping areas of the high-resolution images after image registration;
[0062] Calculate the energy function value of each pixel in the overlapping area to obtain the energy matrix of the area, where the expression of the energy function is as follows:
[0063]
[0064] Among them, E(x,y) represents the energy value of the point (x,y) itself, E c It represents the difference in pixel color intensity, that is, the sum of the grayscale differences of the three channels at the corresponding points in the overlapping area, E g Indicates the intensity of image structure difference;
[0065] The optimal stitching line algorithm is used to find the optimal stitching line trajectory in the overlapping area according to the energy minimization principle;
[0066] Convert the pixel color space of the overlapping area from RGB space to HSL space, where H represents hue, S represents saturation, and L represents brightness;
[0067] Calculate the differences between the hue, saturation, and brightness of the stitched images, and calculate the overall similarity based on adjustable preset weights:
[0068] Based on the optimal stitching line trajectory, the Gaussian-Laplacian pyramid method is used to perform multi-scale decomposition of the image and construct a weight matrix pyramid. The number of decomposition layers of the Laplacian pyramid is adjusted according to the comprehensive similarity. If the similarity is high, the number of decomposition layers is reduced; if the similarity is low, the number of decomposition layers is increased.
[0069] The multi-scale decomposed image is reconstructed layer by layer to generate a seamless and complete film image.
[0070] The second aspect of the present invention provides a large-format cross-scale adhesive film defect detection device, which is used to implement the steps of a large-format cross-scale adhesive film defect detection method. The device includes: a rack module, an imaging module, a lighting module, and a motion platform module; wherein the rack module includes several guide rails; the imaging module includes a Z-axis motion mechanism and an imaging camera, which are located at the top of the rack module and are slidably connected to the guide rails at the top of the rack module; the lighting module is located below the imaging module, partially slidably connected to the guide rails in the rack module, and partially moves synchronously with the motion platform module; the motion platform module includes a motion platform, an X-axis motion mechanism, and a Y-axis motion mechanism, which are arranged inside the rack module and below the lighting module and the imaging module.
[0071] Furthermore, the X-axis motion mechanism includes a linear motor and a first guide rail, which are arranged at the bottom of the motion platform module; the Y-axis motion mechanism includes a linear motor, which is arranged on the X-axis motion mechanism, and the X-axis motion mechanism and the Y-axis motion mechanism are both parallel to the plane where the lighting module is located.
[0072] Furthermore, the Z-axis motion mechanism includes a motor and a screw.
[0073] Furthermore, the imaging module includes an area array camera module and a global camera module. The area array camera module includes a Z-axis motion mechanism and an area array camera, which are slidably connected to the second guide rail; the global camera module includes a Z-axis motion mechanism and a global camera, which are slidably connected to the fifth guide rail; the height of the global camera module above the ground is greater than the height of the area array camera module above the ground.
[0074] Furthermore, the lighting module includes a coaxial light source, a white strip light source, and a surface light source; the coaxial light source is slidably connected to the third guide rail; the white strip light source is slidably connected to the fourth guide rail; the coaxial light source and the white strip light source are located on the same side as the area array camera module; the surface light source moves synchronously with the motion platform module; the height of the coaxial light source from the ground is greater than the height of the white strip light source from the ground, and the height of the white strip light source from the ground is greater than the height of the surface light source from the ground.
[0075] Furthermore, the coaxial light source is a visual blue coaxial light source, the white strip light source is a machine vision linear scanning light source, and the surface light source is a square direct machine vision light source for an industrial camera.
[0076] Furthermore, the white strip light source is slidably connected to the guide rail via a linear light source mounting seat, and the linear light source mounting seat is provided with an arc groove for adjusting the irradiation angle and range of the light source.
[0077] Compared with the prior art, the technical solution of the present invention has the following beneficial effects:
[0078] This paper proposes an image registration algorithm based on a transformer-based local feature matching network. For images with dense features, the SURF algorithm, which adds color information, is used for feature extraction, ensuring fast computation. For images with sparse features, the LoFTR algorithm is used to maintain high sensitivity to subtle features. After matching points are extracted, an improved RANSAC algorithm is used to solve the image transformation relationship, significantly improving the utilization of matching points and achieving superior computational efficiency and matching accuracy compared to existing methods.
[0079] In addition, the present invention introduces an optimal seam line algorithm, which aims to find the optimal image stitching trajectory. The core evaluation criteria is to minimize color and geometric differences to achieve more accurate image alignment. The Laplace pyramid fusion algorithm is further improved, and an adaptive decomposition layer method is added: the decomposition layer number is increased in the seam area with large visual differences to improve the fusion quality, and the layer number is reduced in the area with small visual differences, thereby improving the operation efficiency while maintaining the image fusion effect. Through the adaptive layer number strategy and the method of constructing the image pyramid only for the overlapping area, the amount of calculation is effectively reduced, and the overall time consumption is reduced by 58.7% compared with the traditional image pyramid fusion algorithm. In the subjective evaluation, the algorithm showed stable structural retention and good seam color transition, effectively avoiding the common "ghosting" and misalignment phenomena in image fusion, and achieved while improving the fusion quality while controlling the calculation time within a reasonable range. The overall improved algorithm can handle the film defect recognition of more than 20,000 stitched images. BRIEF DESCRIPTION OF THE DRAWINGS
[0080] In order to make the purpose and technical solution of the present invention clearer, the present invention provides the following drawings and descriptions:
[0081] Figure 1 A flow chart of a method provided by an embodiment of the present invention;
[0082] Figure 2 A difference effect diagram between the current frame image of the film and the original background image provided by the embodiment of the present invention;
[0083] Figure 3 A schematic diagram of the optimal seam line search algorithm provided by an embodiment of the present invention;
[0084] Figure 4 A schematic diagram of the anchor frame algorithm provided by an embodiment of the present invention;
[0085] Figure 5 A schematic diagram of the effect of the path planning algorithm provided by an embodiment of the present invention;
[0086] Figure 6 A Laplace pyramid flow chart provided for an embodiment of the present invention;
[0087] Figure 7 This is a schematic diagram of the detection state of a film defect detection device;
[0088] Figure 8 This is a schematic diagram of a film defect detection device in a state to be detected;
[0089] Figure 9 This is a front view of a film defect detection device;
[0090] Figure 10 This is a top view of a film defect detection device;
[0091] Figure 11 This is the right view of a film defect detection device. DETAILED DESCRIPTION
[0092] In order to more clearly understand the above-mentioned objects, features and advantages of the present invention, the present invention is further described in detail below in conjunction with the accompanying drawings and specific embodiments. It should be noted that, in the absence of conflict, the embodiments of the present application and the features therein can be combined with each other.
[0093] In the following description, many specific details are set forth to facilitate a full understanding of the present invention. However, the present invention may also be implemented in other ways different from those described herein. Therefore, the scope of protection of the present invention is not limited to the specific embodiments disclosed below.
[0094] Example 1:
[0095] The present invention provides a large-scale cross-scale film defect detection method, such as Figure 1 The figure shows a flow chart of a large-scale cross-scale film defect detection method. The specific steps are as follows:
[0096] S1: Performing coarse focusing on the global camera and capturing the film image, coarsely scanning the film image and extracting the information of the printed image and text in the film image using the image difference method, and outputting a differential image containing the target image and text information.
[0097] The specific process is:
[0098] Use the global camera to acquire the film image to obtain the original input image;
[0099] Perform denoising on the original input image and output the denoised processed image;
[0100] Using historical frames or pre-collected background images as a comparison benchmark, a background image is obtained;
[0101] Perform a difference operation between the background image and the denoised processed image to obtain the difference map D(x,y), which is expressed as follows:
[0102] D(x,y)=255-|T(x,y)-S(x,y)|
[0103] Among them, (x, y) is the coordinate of the image pixel, T(x, y) is the pixel grayscale of the background image, S(x, y) is the pixel grayscale of the defective area of the film in the current frame, and the difference effect between the current frame image of the film and the original background image is shown in the figure below. Figure 2 shown.
[0104] S2: Input the differential image into the anchor frame algorithm to obtain the fine scanning target area coordinates from the coarse scanning coordinates.
[0105] The specific process is:
[0106] Perform multi-geometric feature filtering on the extracted difference image to remove artifacts and noise interference, and obtain the optimized foreground contour map;
[0107] The optimized foreground contour map is converted into coordinates through the anchor frame algorithm, and the film foreground contour within the global camera field of view is calculated and converted into the pixel coordinate system coordinates under the fine scanning field of view, and the coordinates of the fine scanning target area are output, such as Figure 4 As shown, the red zigzag line is the foreground contour of the film defect P i The maximum external rectangular box is represented by the blue dotted box in the figure, where the number of windows to be scanned is O i The expression is as follows:
[0108]
[0109] Among them, W i is the width of the rectangular frame in pixel coordinate system, H i is the length of the rectangular frame in the pixel coordinate system, C W is the horizontal resolution of the camera, which is 3072 in this embodiment, C H is the vertical resolution of the camera, which is 2048 in this embodiment, q is the ratio of the field of view of fine scanning to that of coarse scanning, P i The pixel coordinate O in the image coordinate system of the jth fine scan i_j The expression is as follows:
[0110]
[0111] Where c is the correction coefficient of the anchor frame algorithm, n is the n acquisition windows obtained by the anchor frame algorithm, represents the correction value of the lower left corner of the starting scan under the fine scan, and (x, y) is the coordinate O i_j The coordinates of (x i ,y i ) are the center coordinates of the maximum bounding rectangle.
[0112] S3: Input the coordinates of the target area of the fine scanning into the genetic algorithm, and output the optimized fine scanning path in combination with the S-curve planning characteristics of the motor.
[0113] The specific process is:
[0114] Read the center coordinate data of the precision scanning target area, set the population size and maximum evolutionary generations, and randomly generate the initial population. Each individual in the population represents a precision scanning path arrangement.
[0115] Calculate the fitness value of each individual in the population. The fitness function expression is as follows:
[0116]
[0117] Where x represents an individual, n is the precise scanning coordinate set Q n The number of scan coordinates, C i is the current scanning coordinate, C i+1 is the next scanning coordinate, C i ∈Q n , C i+1 ∈Q n , T(C i ,C i+1 ) represents the time from the i-th target to the i+1-th target. According to the third-order S-curve motion planning, T(C i ,C j ) expression is as follows:
[0118] T(C i ,C j )=T a +T v +T d
[0119] Among them, T a For the acceleration period, the expression is as follows:
[0120]
[0121] T v is the uniform speed period, and the expression is as follows:
[0122]
[0123] T d is the deceleration time, and the expression is as follows:
[0124]
[0125] Among them, a a is the maximum acceleration in the acceleration section, V v is the maximum speed in the uniform speed section, a d is the deceleration in the deceleration stage, T v is the uniform speed period, a d is the deceleration in the deceleration stage, which is obtained from the S-curve motion planning. i ,C j ) is used to convert the Euclidean distance of the target area to the longest projection length in the X and Y directions. The expression is as follows:
[0126] d(C i ,Cj )=max(|X i -X j |,|Y i -Y j |)
[0127] Among them, (X i ,Y i ) is point C i The coordinates of (X j ,Y j ) is point C j coordinates of
[0128] Sort the fitness values by size and assign selection probabilities according to the fitness values. The expression for selection probability is as follows:
[0129]
[0130] Among them, x represents the individual, FIT(x) represents the fitness of the individual, F j Represents the sum of all individual fitness values in the population;
[0131] The roulette wheel algorithm is used to select individuals from the next generation population based on the selection probability, and a partial matching crossover (PMX) operation is performed on the selected population to generate new individuals while maintaining the rationality of the path structure. The path order of the individuals is randomly mutated and adjusted with a preset probability to avoid falling into a local optimum.
[0132] Construct a target optimization function to minimize the total time consumption. The target function expression is as follows:
[0133]
[0134] Where n is the precise scanning coordinate set Q n The number of scanned coordinates, the coordinate number range is [1,n], C i is the current scanning coordinate, C i+1 is the next scanning coordinate, C i ∈Q n , C i+1 ∈Q n , T(C i ,C i+1 ) is from scanning point C i To scanning point C i+1 Movement time, T(C n , C1) is from the last scan point C n The movement time back to the first scanning point C1 forms a closed loop;
[0135] Accumulate the current evolutionary generations. In this embodiment, the maximum number of iterations is set to 700. It is judged whether the maximum generation or fitness value convergence condition is reached. If the condition is not met, it returns to the fitness calculation step and continues iterative optimization. If the termination condition is reached, the optimal path individual in the current population is output as the fine scanning path output, and the effect is achieved as follows: Figure 5 shown.
[0136] S4: Utilize dual-axis linkage control in combination with the precise scanning path to drive the motion platform to complete path execution. During the path execution process, utilize the precise focus search strategy to complete the focus of the area array camera and acquire a high-resolution image of the defect area.
[0137] The area array camera focusing is completed using the fine focus search strategy. The specific process is as follows:
[0138] Set the search step size of the camera focus module, and select a reasonable search step size based on geometric error compensation and coarse focus;
[0139] Calculate the clarity evaluation value F1 of the image at the current shooting position, set the initial search step length L, drive the camera motor to move one unit step in a certain direction, and calculate the image clarity evaluation value F2 at the position after movement. If F2>F1, it means that the clarity has improved and continue to move in the current direction; otherwise, adjust the moving direction to the opposite direction and drive the camera motor to move twice the step length in the opposite direction.
[0140] Obtain the image after moving in the opposite direction and calculate its clarity evaluation value F3. If F3>F2, it means that the opposite direction is more conducive to improving clarity, and continue moving in this direction; otherwise, adjust the moving direction to the opposite direction again, and reduce the current step length L to 0.618 times the original step length.
[0141] Next, the process checks whether the current step size L is less than the preset minimum step size d. If so, the search stops and the process ends. Otherwise, the process iterates again until the termination condition is met. This entire process, through multiple adjustments and comparisons of clarity evaluation values, ultimately achieves precise camera focus.
[0142] S5: performing image registration on the high-resolution image using an improved image registration algorithm based on a local feature matching network of a converter, performing image stitching and fusion on the registered images using an optimal seam line algorithm combined with an improved Laplace pyramid fusion method, and outputting a complete film image.
[0143] The high-resolution images are registered using an improved image registration algorithm based on a local feature matching network of a transformer. The specific process is as follows:
[0144] The Sobel operator is used to quickly calculate the average gradient amplitude of the high-resolution image. Let the image be I(x,y), where x and y represent the horizontal and vertical coordinates of the image, S x (x,y),S y (x, y) represents the Sobel gradient in the horizontal and vertical directions respectively, M and N represent the width and height of the image respectively. The gradient magnitude G(x, y) is calculated for each pixel using the following formula:
[0145]
[0146] Then use the following formula to calculate the average gradient amplitude
[0147]
[0148] When the feature content in the image gradually decreases, its gradient average value also decreases. Therefore, a threshold t can be set. In this embodiment, it is set to 9. If the gradient amplitude average value is less than the preset threshold, it is judged as sparse feature. If the gradient amplitude average value is greater than the preset threshold, it is judged as dense feature. For images to be registered with dense features, the SURF algorithm with color information is used to extract feature points. For images to be registered with sparse features, the LoFTR algorithm is used to extract local feature points to obtain a high-quality feature point set.
[0149] Matching the feature point set using a feature matching algorithm to generate a list of matching point pairs for use in subsequent transformation model estimation;
[0150] Randomly select n pairs of points from the matching point pairs, and calculate the transformation matrix based on the selected point pairs. The standard translation transformation model formula is as follows:
[0151]
[0152] Where (x, y, 1) represents the homogeneous coordinates of a pixel before translation, (x', y', 1) represents the homogeneous coordinates of the pixel after translation, and Δx and Δy are the translation amounts.
[0153] Evaluate whether the transformation model is an approximate translation transformation model. That is, compare whether the seven values in the matrix, excluding Δx and Δy, are similar to those in the standard translation transformation model. Due to certain calculation errors, this embodiment sets the numerical deviation to no more than 2% to be considered an approximate translation transformation. The numerical deviation calculation expression is as follows:
[0154]
[0155] Among them, δ i Indicates the numerical deviation of the i-th element, T est,iRepresents the i-th element in the estimated transformation matrix, T ref,i Represents the corresponding i-th element in the standard translation transformation model matrix.
[0156] If the approximate translation transformation condition is not met, n pairs of points are reselected; if the approximate translation transformation condition is met, the average distance error l between all matching points and the transformation model is calculated based on the translation transformation model. The expression is as follows:
[0157]
[0158] Among them, P i is the matching point, M is the point corresponding to the transformation model, and n is the number of selected matching points; the average distance error l is used as the error threshold t to divide the inliers and outliers. Points smaller than the threshold t are inliers, and points larger than the threshold t are outliers. The number of inliers is counted;
[0159] Repeat the above steps until the preset number of iterations is reached. In this embodiment, the number of iterations is 50, and the translation transformation model containing the largest number of inliers is output.
[0160] The output transformation model is applied to the image to be registered, and the image is geometrically transformed in combination with the model parameters to complete the image registration. The registered image is output as the input for the subsequent stitching and fusion stage. The present invention proposes an improved image registration algorithm based on a local feature matching network of a converter. For images with dense features, the SURF algorithm with added color information is used for feature extraction to ensure fast calculation; for images with sparse features, the LoFTR algorithm is used to maintain a high sensitivity to subtle features. After the matching points are extracted, the improved RANSAC algorithm is used to solve the image transformation relationship, which significantly improves the utilization rate of the matching points, making the computational efficiency and matching accuracy better than the existing methods.
[0161] The optimal seam line algorithm is combined with the improved Laplace pyramid fusion method to perform image stitching and fusion to output a complete film image. The specific process is as follows:
[0162] Extract the overlapping areas of the high-resolution images after image registration;
[0163] Calculate the energy function value of each pixel in the overlapping area to obtain the energy matrix of the area, where the expression of the energy function is as follows:
[0164]
[0165] Among them, E(x,y) represents the energy value of the point (x,y) itself, E c It represents the difference in pixel color intensity, that is, the sum of the grayscale differences of the three channels at the corresponding points in the overlapping area, E gRepresents the intensity of image structure difference; traverse and calculate each pixel in the overlapping area to obtain the energy matrix of the area, and search for the best seam line on this basis. First, all the points in the first row of the energy matrix are set as the starting point of a seam line, that is, the initial number of seam lines is equal to the number of columns in the energy matrix. Then calculate the energy value of the next row, set the current point as (x, y), and find the energy values E of the three points (x-1, y+1), (x, y+1), and (x+1, y+1) closest to (x, y) in the next row. The point with the smallest E value is used as the extension point of the current seam line, and gradually move downward until it touches the bottom. The current seam line search is completed. Repeat the above steps to find all seams, and sum the energy values of all positions along the path of each line. The one with the smallest total energy value is the best seam line for the area. The search process is as follows: Figure 3 shown.
[0166] Using the optimal stitching algorithm, the optimal stitching trajectory is found in the overlapping area according to the energy minimization principle. The pixels on both sides of the trajectory from different images are divided into fusion areas and non-fusion areas to ensure a smooth transition after stitching.
[0167] The pixel color space of the overlapping area is converted from RGB space to HSL space, where H represents hue, and the color expression is closer to the intuitive perception of the human eye; S represents saturation, which is a label for the vividness of the color; L represents brightness, which is a label for the brightness of the color, reflecting the intensity of the light source and the reflection coefficient; assuming that the components of the pixel in RGB space are (r, g, b) components, the maximum value and the minimum value are represented by max and min, and the following formula is used to convert them into the (h, s, l) components of HSL:
[0168]
[0169] The pixel points of the converted image A are represented as B is represented by N is the number of pixels. The normalized cumulative mean difference of each channel is calculated using the following formula.
[0170]
[0171] Next, the similarity y of the stitching line pixels of the two images to be stitched is calculated using the following formula:
[0172]
[0173] Among them, w H 、w S 、w L is the weight of each component, usually w H +w S +w L= 1, adjust the number of decomposition layers of the Laplacian pyramid based on the similarity y. The closer y is to 1, the more similar the seam area is visually. The number of decomposition layers can be reduced to improve computational efficiency and reduce memory consumption. Conversely, the closer y is to 0, the number of decomposition layers should be increased to improve fusion quality. H 、w S 、w L The value of follows the following rules:
[0174] Regarding the value of hue H, if the defect has a characteristic that is obviously different from the normal area in terms of color hue, such as a stain of a certain color or a discolored defect, then the weight of hue (H) may be more important for detection, w H For example, when detecting different-colored ink dots on printed materials, the hue difference is the key feature, w H Possible values are between 0.4 and 0.6.
[0175] Regarding the value of saturation S, when the color vividness of the defective area is significantly different from that of the normal area, the weight of saturation (S) w S For example, some surface coating defects may cause significant changes in local color saturation. If this change is the main manifestation of the defect, w S The value can be 0.3-0.5. However, if the change in saturation of the defect is not obvious, w S It can be relatively small, such as 0.1-0.3.
[0176] Regarding the value of brightness L, brightness (L) may be an important basis for judging some defects caused by light, wear, etc. For example, scratches on the metal surface may cause local brightness changes. L The value can be larger, such as 0.3-0.5.
[0177] Since this defect detection requires high accuracy, it is necessary to comprehensively consider the three components of HSL, w H 、w S 、w L The value should be relatively balanced. In the embodiment, the value w H =0.35, w S =0.3, w L =0.35 to ensure that all aspects of the characteristics are fully considered and avoid missing important defect information due to too low a weight of a certain component.
[0178] Calculate the differences between the hue, saturation, and brightness of the stitched images, and calculate the overall similarity based on adjustable preset weights:
[0179] Based on the optimal seam line trajectory, the Gaussian-Laplacian pyramid method is used to perform multi-scale decomposition of the image and construct a weight matrix pyramid. The number of layers of the Laplacian pyramid decomposition is adjusted according to the comprehensive similarity. If the similarity is high, the number of decomposition layers is reduced to improve efficiency and reduce storage requirements; if the similarity is low, the number of decomposition layers is increased to retain more details. The mapping function expression between the number of layers n and the comprehensive similarity is as follows:
[0180] n=n min +(n max -n min )·(1-y)
[0181] Among them, n min and n max Represents the minimum and maximum number of layers that can be decomposed. In this embodiment, n is set min There are 3 layers, n max It has 7 floors.
[0182] The multi-scale decomposed image is reconstructed layer by layer to generate a seamless and complete film image. This invention introduces the optimal seam line algorithm to find the optimal image stitching trajectory. The core evaluation criteria is to minimize the color and geometric differences to achieve more accurate image alignment. The Laplace pyramid fusion algorithm is further improved by adding a decomposition layer adaptive method: the number of decomposition layers is increased in the seam area with large visual differences to improve the fusion quality, while the number of layers is reduced in the area with small visual differences, thereby improving the operation efficiency while maintaining the image fusion effect. The algorithm flow is as follows: Figure 6 As shown, images A and B were subjected to Gaussian-Laplace decomposition, followed by image fusion using a weighted pyramid. By implementing an adaptive layer strategy and constructing image weighted pyramids only for overlapping regions, the algorithm effectively reduced computational effort, reducing overall processing time by 58.7% compared to traditional image pyramid fusion algorithms. Subjective evaluations demonstrated stable structural preservation and excellent seam color transitions, effectively avoiding the "ghosting" and misalignment artifacts common in image fusion. This approach improved fusion quality while keeping computational time within a reasonable range. The improved algorithm can handle film defect recognition for over 20,000 stitched images.
[0183] S6: Perform defect detection on the complete film image and output the detection results.
[0184] This solution proposes an advanced EVA film inspection system with significant advantages in detection capabilities. It not only identifies common defects caused by poorly finished products, such as lumps, crystals, and holes, as well as defects caused by foreign matter such as mosquitoes, dirt, and oil, but also expands its detection range to accurately detect subtle defects in film-engraved images, including threads, bubbles, dropped dots, scratches, liquid marks, dents, nubby spots, and bumps. This comprehensive detection capability makes this solution more reliable in ensuring film product quality. Through a highly automated and precise inspection process, it not only improves inspection efficiency and reduces labor costs, but also helps reduce the production of defective products during the production process, thereby enhancing the product's market competitiveness.
[0185] Example 2:
[0186] This embodiment provides a large-scale cross-scale film defect detection method and device, which is used to implement the steps of the large-scale cross-scale film defect detection method as described in Example 1. Figure 7 The figure shows a schematic diagram of the detection state of a film defect detection device. Figure 8 The figure shows a schematic diagram of a film defect detection device in a state to be detected, and the front view, top view and right view of the film defect detection device are shown as follows: Figure 9 、 Figure 10 、 Figure 11 shown.
[0187] A film defect detection device includes: a frame module 21, an imaging module 22, a lighting module 23, and a motion platform module 24.
[0188] The rack module 21 supports the entire system's mechanical framework, ensuring the stable, precision-controlled positioning of the guide rails, imaging module 22, lighting module 23, and motion platform module 24. The rack module 21 includes several guide rails made of aluminum alloy to ensure long-term stable operation and high-precision testing. Furthermore, the rack module 21 is equipped with several feet and anti-slip pads to enhance overall stability and reduce vibration, ensuring the precise positioning of the imaging module 22 and lighting module 23 during testing.
[0189] The imaging module 22 includes an area array camera module 8 and a global camera module 12. The area array camera module 8 includes a Z-axis motion mechanism and an area array camera, and is slidably connected to the second guide rail 13. The global camera module 12 includes a Z-axis motion mechanism and a global camera, and is slidably connected to the fifth guide rail 16. The global camera module 12 is located at a greater height above the ground than the area array camera module 8. The area array camera and the global camera can be moved or fine-tuned in specific directions along their respective guide rails to accommodate different inspection requirements. The Z-axis motion mechanism includes a motor and a lead screw, which serve as an auxiliary focusing mechanism to adjust the distance between the camera and the film being inspected, ensuring clear, high-resolution images while effectively increasing the camera's scale span and shortening focusing time. In this embodiment, the global camera module 12 utilizes a single global camera configuration, while the area array camera module 8 utilizes a multi-area array camera configuration, with three area array cameras evenly spaced along the rails, enabling multi-view and multi-resolution inspection.
[0190] The lighting module 23 includes a coaxial light source 7, a white strip light source 6, and a surface light source 5; in this embodiment, the coaxial light source 7 is a visual blue coaxial light source, which is slidably connected to the third guide rail 14; the white strip light source 6 is a machine vision linear scanning light source, which is slidably connected to the fourth guide rail 15; the coaxial light source 7 and the white strip light source 6 are located on the same side as the area array camera module 8; the surface light source 5 is a square direct machine vision light source for an industrial camera, and moves synchronously with the motion platform module 24; the height of the coaxial light source 7 from the ground is greater than the height of the white strip light source 6 from the ground, and the height of the white strip light source 6 from the ground is greater than the height of the surface light source 5 from the ground. There are three coaxial light sources 7, which are evenly spaced on the track and are arranged directly below the area array camera module 8. There are six white bar light sources 6, which are arranged below the coaxial light source 7. A white bar light source 6 is arranged on the left and right sides below each coaxial light source 7. The white bar light source 6 is slidably connected to the guide rail through a linear light source mounting seat. The linear light source mounting seat is provided with an arc groove 25 for adjusting the angle and range of the light source to meet the optical requirements of different film defect detection, such as Figure 9 shown.
[0191] The motion platform module 24 includes a motion platform 4, an X-axis motion mechanism and a Y-axis motion mechanism. The motion platform module 24 is arranged inside the frame module 21 and is located below the lighting module 23 and the imaging module 22. The X-axis motion mechanism includes a linear motor 1 and a first guide rail 2, which are arranged at the bottom of the motion platform module 24. The linear motor 1 and the first guide rail 2 are used to realize the movement of the motion platform module 24 along the X-axis direction; the Y-axis motion mechanism is arranged on the X-axis motion mechanism, and includes a linear motor 3. The linear motor 3 is used to realize the movement of the motion platform 4 along the Y-axis direction. The X-axis motion mechanism and the Y-axis motion mechanism are both parallel to the plane where the lighting module 23 is located. By moving the motion platform along the guide rails in the XY axis direction, the sliding range of the motion platform can be effectively expanded. The motion platform 4 is also provided with a clamping and fixing device 11 for positioning the film. When the film is placed on the motion platform 4, the clamping and fixing device 11 can abut and position the side wall of the film to realize rapid alignment of the film on the motion platform 4, thereby improving the detection efficiency. Figure 8 shown.
[0192] In this embodiment, the defect detection platform has an X-axis movement range of 0-1000mm, a Y-axis movement range of 0-550mm, and a Z-axis movement range of 0-80mm, enabling film defect detection from 10 microns to meters. The working process is as follows:
[0193] Before testing, if Figure 8 As shown, the motion platform module 24 moves to the initialization position, that is, the position below the global camera module 12. The film is mounted on the surface light source 5 in the motion platform 4 and fixed using the clamping fixture 11. The global camera module 12 performs a global scan of the film to determine the overall size and shape of the film, as well as the specific area to be inspected. After the global scan, the surface light source 5 below the film illuminates the film. Defects and impurities such as bubbles in the film will appear on the film due to different light transmittances. During the movement, as shown in FIG. Figure 7 As shown, the platform drives the surface light source and the film in motion, while the area array camera 8, white strip light source 6, and coaxial light source 7 are all stationary. A linear motor drives the inspection platform 4 in XY-axis motion control. A path planning algorithm analyzes the data obtained from the global scan and plans the shortest path covering all required inspection areas, ensuring inspection accuracy and efficiency. Furthermore, since bubbles or impurities within the film do not produce significant multidirectional scattered reflections when illuminated, surface defects do reflect light in multiple directions. Therefore, when the white strip light source 6 and coaxial light source 7 illuminate the film, the area array camera 8 can effectively identify and determine the presence of defects based on these multidirectional scattered reflection characteristics.
[0194] Obviously, the above embodiments of the present invention are merely examples for the purpose of clearly illustrating the present invention, and are not intended to limit the embodiments of the present invention. Those skilled in the art will appreciate that other variations or modifications can be made based on the above description. It is not necessary and impossible to enumerate all embodiments here. Any modifications, equivalent substitutions, and improvements made within the spirit and principles of the present invention are intended to be included within the scope of protection of the claims of the present invention.
Claims
1. A large-scale cross-scale film defect detection method, characterized in that: The steps include: Performing coarse focusing on the camera and capturing the film image, coarsely scanning the film image and extracting information of printed images and texts in the film image using an image difference method, and outputting a differential image containing target image and text information; Inputting the differential image into an anchor frame algorithm to obtain the coordinates of the fine scanning target area from the coarse scanning coordinates; The coordinates of the target area of the fine scanning are input into the genetic algorithm, and the optimized fine scanning path is output in combination with the S-curve planning characteristics of the motor; The path execution is completed by using the dual-axis linkage control combined with the precise scanning path to drive the motion platform. During the path execution, the precise focus search strategy is used to complete the camera focus and acquire high-resolution images of the defect area. The Sobel operator is used to calculate the average gradient amplitude of high-resolution images. If the average gradient amplitude is less than the preset threshold, it is judged as sparse feature. If the average gradient amplitude is greater than the preset threshold, it is judged as dense feature. For images with dense features to be registered, the SURF algorithm with color information is used to extract feature points. For images with sparse features to be registered, the LoFTR algorithm is used to extract local feature points to obtain a high-quality feature point set. This high-quality feature point set is then used for image registration. The registered images are then stitched and fused using the optimal seam line algorithm combined with the improved Laplace pyramid fusion method to output a complete film image. Perform defect detection on the complete film image and output the detection results; Among them, the optimal seam line algorithm is combined with the improved Laplacian pyramid fusion method to perform image stitching and fusion to output a complete film image, including the following steps: Extract the overlapping areas of the high-resolution images after image registration; Calculate the energy function value of each pixel in the overlapping area to obtain the energy matrix of the area, where the expression of the energy function is as follows: Among them, E(x,y) represents the energy value of the point (x,y) itself, E c It represents the difference in pixel color intensity, that is, the sum of the grayscale differences of the three channels at the corresponding points in the overlapping area, E g Indicates the intensity of image structure difference; The optimal stitching line algorithm is used to find the optimal stitching line trajectory in the overlapping area according to the energy minimization principle; Convert the pixel color space of the overlapping area from RGB space to HSL space, where H represents hue, S represents saturation, and L represents brightness; Calculate the differences between the hue, saturation and brightness of the stitched images, and calculate the comprehensive similarity based on adjustable preset weights; Based on the optimal stitching line trajectory, the Gaussian-Laplacian pyramid method is used to perform multi-scale decomposition of the image and construct a weight matrix pyramid. The number of decomposition layers of the Laplacian pyramid is adjusted according to the comprehensive similarity. If the similarity is high, the number of decomposition layers is reduced; if the similarity is low, the number of decomposition layers is increased. The multi-scale decomposed image is reconstructed layer by layer to generate a seamless and complete film image.
2. The large-scale cross-scale film defect detection method according to claim 1, characterized in that: The film image is roughly scanned and the information of the printed image and text in the film image is extracted using an image difference method, including the following steps: Use a camera to acquire a film image to obtain an original input image; Perform denoising on the original input image and output the denoised processed image; Using historical frames or pre-collected background images as a comparison benchmark, a background image is obtained; Perform a difference operation between the background image and the denoised processed image to obtain the difference map D(x,y), which is expressed as follows: D(x,y)=255-|T(x,y)-S(x,y)| Where (x, y) is the coordinate of the image pixel, T(x, y) is the pixel grayscale of the background image, and S(x, y) is the pixel grayscale of the film defect area in the current frame.
3. The large-scale cross-scale film defect detection method according to claim 1, characterized in that: The differential image is input into the anchor frame algorithm to output the coordinates of the precise scan target area, including the following steps: Perform multi-geometric feature filtering on the extracted difference image to remove artifacts and noise interference, and obtain the optimized foreground contour map; The optimized foreground contour map is converted into coordinates through the anchor frame algorithm, the film foreground contour within the camera field of view is calculated, and converted into pixel coordinates under the fine scanning field of view, and the coordinates of the fine scanning target area are output.
4. The large-scale cross-scale film defect detection method according to claim 1, characterized in that: The coordinates of the target area for fine scanning are input into the genetic algorithm, and the optimized fine scanning path is output based on the motor S-curve motion planning characteristics, including the following steps: Read the center coordinate data of the precision scanning target area, set the population size and maximum evolutionary generations, and randomly generate the initial population. Each individual in the population represents a precision scanning path arrangement. Calculate the fitness value of each individual in the population. The fitness function expression is as follows: Where n is the precise scanning coordinate set Q n The number of scan coordinates, C i is the current scanning coordinate, C i+1 is the next scanning coordinate, C i ∈Q n , C i+1 ∈Q n , T(C i ,C i+1 ) represents the time from the i-th target to the i+1-th target. According to the third-order S-curve motion planning, T(C i ,C j ) expression is as follows: T(C i ,C j )=T a +T v +T d Among them, T a For the acceleration period, the expression is as follows: T v is the uniform speed period, and the expression is as follows: T d is the deceleration time, and the expression is as follows: Among them, a a is the maximum acceleration in the acceleration section, V v is the maximum speed in the uniform speed section, a d is the deceleration in the deceleration stage, T v is the uniform speed period, a d is the deceleration in the deceleration stage, which is obtained from the S-curve motion planning. i ,C j ) is used to convert the Euclidean distance of the target area to the longest projection length in the X and Y directions. The expression is as follows: d(C i ,C j )=max(|X i -X j |,|Y i -Y j |) Among them, (X i ,Y i ) is point C i The coordinates of (X j ,Y j ) is point C j coordinates of Sort the fitness values by size and assign selection probabilities according to the fitness values. The expression for selection probability is as follows: Among them, x represents the individual, FIT(x) represents the fitness of the individual, Represents the sum of all individual fitness values in the population; The roulette wheel algorithm is used to select individuals from the next generation population based on the selection probability, and a partial matching crossover operation is performed on the selected population to generate new individuals while maintaining the rationality of the path structure. The path order of the individuals is randomly mutated and adjusted with a preset probability to avoid falling into a local optimum. Construct a target optimization function to minimize the total time consumption. The target function expression is as follows: Where n is the precise scanning coordinate set Q n The number of scanned coordinates, the coordinate number range is [1,n], C i is the current scanning coordinate, C i+1 is the next scanning coordinate, C i ∈Q n , C i+1 ∈Q n , T(C i ,C i+1 ) is from scanning point C i To scanning point C i+1 Movement time, T(C n , C1) is from the last scan point C n Movement time back to the first scanning point C1; Accumulate the current evolutionary generations and determine whether the maximum generation or fitness value convergence conditions are reached. If the conditions are not met, return to the fitness calculation step and continue iterative optimization; if the termination conditions are met, output the optimal path individual in the current population as the fine scanning path output.
5. The large-scale cross-scale film defect detection method according to claim 1, characterized in that: The method of using the fine focus search strategy to complete camera focus includes the following steps: Set the search step size of the camera focus module, and select a reasonable search step size based on geometric error compensation and coarse focus; Calculate the clarity evaluation value F1 of the image at the current shooting position, set the initial search step length L, drive the camera motor to move one unit step length in a certain direction, and calculate the image clarity evaluation value F2 at the position after the movement. If F2>F1, continue to move in the current direction; otherwise, adjust the movement direction to the opposite direction and drive the camera motor to move twice the step length in the opposite direction; Get the image after moving in the opposite direction and calculate its clarity evaluation value F3. If F3>F2, it means that the opposite direction is more conducive to improving clarity, and continue moving in this direction; otherwise, adjust the moving direction to the opposite direction again, and reduce the current step length L to 0.618 times the original step length; Determine whether the current step size is less than the preset minimum step size d. If the step size is less than d, stop searching and the process ends; otherwise, return to iterate the above operations until the termination condition is met and the camera fine focus is completed.
6. The large-scale cross-scale film defect detection method according to claim 1, characterized in that: Image registration using a high-quality feature point set includes the following steps: Use feature matching algorithm to match high-quality feature point sets and generate a list of matching point pairs; Randomly select n pairs of points from the matching point pairs, calculate the transformation matrix based on the selected point pairs and evaluate whether the transformation model is an approximate standard translation transformation model. If it does not meet the approximate standard translation transformation conditions, reselect n pairs of points; if it meets the approximate standard translation transformation conditions, calculate the average distance error l between all matching points and the transformation model based on the translation transformation model. The expression is as follows: Among them, P i is the matching point, M is the point corresponding to the transformation model, and n is the number of selected matching points; the average distance error l is used as the error threshold t to divide the inliers and outliers. Points smaller than the threshold t are inliers, and points larger than the threshold t are outliers. The number of inliers is counted; Repeat the above steps until the preset number of iterations is reached, and output the translation transformation model containing the largest number of inliers; The output transformation model is applied to the image to be registered, and the image is geometrically transformed in combination with the model parameters to complete the image registration and output the registered image.
7. A large-scale cross-scale film defect detection device, characterized in that: The device is used to implement the steps of a large-scale cross-scale film defect detection method as described in any one of claims 1 to 6, and the device comprises: a rack module (21), an imaging module (22), a lighting module (23), and a motion platform module (24); wherein the rack module (21) comprises a plurality of guide rails; the imaging module (22) comprises a Z-axis motion mechanism and an imaging camera, which are located at the top of the rack module (21) and are slidably connected to the guide rail at the top of the rack module (21); the lighting module (23) is located below the imaging module (22), and comprises a first lighting module and a second lighting model, the first lighting module is slidably connected to the guide rail in the rack module (21), and the second lighting model moves synchronously with the motion platform module (24); the motion platform module (24) comprises a motion platform (4), an X-axis motion mechanism and a Y-axis motion mechanism, and is arranged inside the rack module (21) and below the lighting module (23) and the imaging module (22).
8. The large-scale cross-scale film defect detection device according to claim 7, characterized in that: The X-axis motion mechanism includes a linear motor (1) and a first guide rail (2), which are arranged at the bottom of the motion platform module (24); the Y-axis motion mechanism includes a linear motor (3), which is arranged on the X-axis motion mechanism, and the X-axis motion mechanism and the Y-axis motion mechanism are both parallel to the plane where the lighting module (23) is located.
Citation Information
Patent Citations
Panoramic vision-based pipeline quality inspection method and pipeline quality inspection device
CN116167993A
Image splicing method for large-diameter optical crystal surface micro-defect detection
CN108760766A
Spinning cake defect detection method based on improved LoFTR algorithm
CN116993709A