A Smart Quality Inspection Method and System for Rainbow Film Based on Image Recognition

By processing rainbow film images using the Sobel operator and frequency domain filtering techniques, the problems of edge blurring and false structure misjudgment in high-frequency or curvature discontinuous regions in existing methods are solved, achieving efficient and accurate rainbow film quality detection.

CN120976254BActive Publication Date: 2026-05-26DONGYANG BAITAN JIALE GOLD & SILVER SILK THREAD CO LTD

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
DONGYANG BAITAN JIALE GOLD & SILVER SILK THREAD CO LTD
Filing Date
2025-09-03
Publication Date
2026-05-26

AI Technical Summary

Technical Problem

Existing rainbow film image recognition methods suffer from problems such as blurred edges and false structure misjudgment when processing high-frequency or curvature discontinuous regions, resulting in poor detection performance.

Method used

The Sobel operator is used for convolution to calculate the curvature potential function and adaptive threshold to generate a binary mask. Median filtering is used to fill in discontinuous regions. The principal phase field is extracted through frequency domain filtering and one-dimensional Fourier transform. Combined with statistical threshold segmentation, a binary defect mask is generated, and a visualization interface is constructed to display the defects.

Benefits of technology

It enhances the stripe continuity and defect distinguishability of rainbow film images, improves the robust recognition capability of complex interference patterns, generates high-quality morpholuminance maps and smooth continuous phase fields, and improves the accuracy and reliability of detection.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120976254B_ABST
    Figure CN120976254B_ABST
Patent Text Reader

Abstract

This invention discloses an intelligent quality detection method and system for rainbow films based on image recognition, belonging to the field of image processing technology. The method includes convolving a rainbow film image using the Sobel operator to generate a binary mask, generating a filtered morpholuminescence map, performing a one-dimensional Fourier transform on the filtered morpholuminescence map, calculating the direction angle of the complex curl using the arctangent binary function, extracting the principal phase field, calculating the continuous phase field, convolving the continuous phase field to generate a smoothed continuous phase field, and calculating the gradient magnitude of the smoothed continuous phase field to generate a binary defect mask. This invention generates a high-quality morpholuminescence map through multi-level feature extraction and adaptive segmentation, enhancing the continuity of fringes and the distinguishability of defects. By constructing a smooth and continuous phase field and combining it with statistical thresholds for adaptive identification of defect regions, it improves the robust recognition capability for complex interference patterns.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of image processing technology, and in particular to a method and system for intelligent quality detection of rainbow film based on image recognition. Background Technology

[0002] With the rapid development of image processing and pattern recognition technologies, image recognition has been widely used in industrial inspection, medical diagnosis, security monitoring and other fields. Especially in the field of precision manufacturing, the analysis of optical interference images has become an important means of product quality inspection. In products with complex interference structures such as optical thin films, coating materials and rainbow films, image-based detection methods can identify minute defects and structural anomalies in a non-contact, high-precision and high-efficiency manner.

[0003] Existing image recognition and detection methods for rainbow film patterns still have certain limitations. Rainbow film images exhibit strong interference fringe structures with complex spatial frequency distributions. Existing methods suffer from problems such as blurred edges and false structure misjudgment in discontinuous fringe regions, and are particularly ineffective when processing high-frequency or curvature discontinuous regions. Summary of the Invention

[0004] In view of the aforementioned existing problems, the present invention is proposed.

[0005] Therefore, this invention provides an intelligent quality detection method and system for rainbow films based on image recognition, which solves the problems of rainbow film images exhibiting strong interference fringe structures with complex spatial frequency distributions, existing methods having problems such as blurred edges and false structure misjudgment in non-continuous fringe regions, and poor performance, especially when dealing with high-frequency or non-continuous curvature regions.

[0006] To solve the above-mentioned technical problems, the present invention provides the following technical solution:

[0007] In a first aspect, the present invention provides a method for intelligent quality detection of rainbow film based on image recognition, which includes the following steps:

[0008] Collect rainbow film images and preprocess them. Convolve the rainbow film images using the Sobel operator, calculate the curvature potential function using nonlinear transformation, calculate the adaptive threshold, generate a binary mask, fill discontinuous regions using median filtering, and generate a morpholuminance map.

[0009] The morpholuminance map is transformed from the spatial domain to the frequency domain. The gradient direction angle of the morpholuminance map is calculated, a high-pass filter mask is constructed, and a dot product operation is performed on the frequency domain representation and the high-pass filter mask. The filtered frequency domain representation is transformed back from the frequency domain to the spatial domain to generate a filtered morpholuminance map. The filtered morpholuminance map is then subjected to a one-dimensional Fourier transform along the x-direction to calculate the principal period. The period difference field is calculated, and the direction angle of the complex curl is calculated using the arctangent binary function. The principal phase field is extracted, and the continuous phase field is calculated. The continuous phase field is then convolved to generate a smoothed continuous phase field.

[0010] The gradient magnitude of the smoothed continuous phase field is calculated, the detection threshold is set using statistical threshold segmentation, a binary defect mask is generated, and a visualization interface is constructed to display the binary defect mask.

[0011] As a preferred embodiment of the image recognition-based intelligent quality detection method for rainbow film described in this invention, the step of convolving the rainbow film image using the Sobel operator to generate a morphology-brightness map includes:

[0012] The Sobel operator is used to convolve the iris image, the gradient of the iris image is calculated, the normal curvature is calculated based on the gradient of the iris image, the second derivative is calculated using the Laplacian operator, the curvature potential function is calculated using nonlinear transformation, and then normalization is performed.

[0013] An adaptive threshold is calculated using median statistics to generate a binary mask. Median filtering is then used to fill in discontinuous regions equal to 0 in the binary mask, generating a morpholuminance map.

[0014] As a preferred embodiment of the image recognition-based intelligent quality detection method for rainbow films according to the present invention, wherein: the generation of the filtered morphology-brightness map includes:

[0015] The morpholuminance map is transformed from the spatial domain to the frequency domain using a two-dimensional fast Fourier transform to obtain a frequency domain representation;

[0016] The Sobel operator is used to calculate the gradient of the morphology brightness map, the gradient direction angle of the morphology brightness map is calculated, the histogram of the gradient direction angle is statistically analyzed, the main direction angle is determined, and a high-pass filter mask is constructed.

[0017] Perform a dot product operation on the frequency domain representation and the high-pass filter mask to obtain the filtered frequency domain representation.

[0018] As a preferred embodiment of the image recognition-based intelligent quality detection method for rainbow films according to the present invention, the step of calculating the continuous phase field and performing a convolution operation on the continuous phase field to generate a smoothed continuous phase field includes:

[0019] Perform a one-dimensional Fourier transform on the filtered morpholuminance map along the x-direction to calculate the main period;

[0020] The filtered morpholuminance map is used to construct a difference field by periodically differencing along the x and y directions, and the periodic difference field is calculated.

[0021] Based on the periodic difference field, a complex graph is constructed, and the complex curl is calculated by partial derivatives. The direction angle of the complex curl is calculated by the arctangent bivariate function, and the principal phase field is extracted.

[0022] Initialize the continuous phase field and integer compensation term. Take the center point of the filtered morpholuminance map as the starting point, initialize the integer compensation term to 0, use the path integral method to start from the starting point, use breadth-first search to traverse all pixels, calculate the phase difference, update the integer compensation term, and calculate the continuous phase field.

[0023] Using a fixed window indexing method to set the offset relative to the center pixel, a Gaussian kernel is defined, and a convolution operation is performed on the continuous phase field to generate a smoothed continuous phase field.

[0024] As a preferred embodiment of the image recognition-based intelligent quality detection method for rainbow films according to the present invention, wherein: the calculation of the gradient modulus of the smoothed continuous phase field to generate a binary defect mask includes:

[0025] Calculate the gradient magnitude of the smoothed continuous phase field;

[0026] Statistical thresholding is used to set the detection threshold and generate a binary defect mask.

[0027] As a preferred embodiment of the image recognition-based intelligent quality detection method for rainbow films described in this invention, the step of constructing a visual interface to display the binary defect mask includes:

[0028] A visual interface is built using the front-end framework React.js to visualize the binary defect mask;

[0029] Users who have completed real-name verification are allowed to view this information.

[0030] As a preferred embodiment of the image recognition-based intelligent quality detection method for rainbow film described in this invention, the step of collecting and preprocessing rainbow film images includes:

[0031] Images of the rainbow film were collected using an industrial-grade camera and then denoised and normalized.

[0032] Secondly, the present invention provides an intelligent quality inspection system for rainbow film based on image recognition, comprising:

[0033] The morphology collection module is used to collect rainbow film images and perform preprocessing. It uses the Sobel operator to convolve the rainbow film images, uses nonlinear transformation to calculate the curvature potential function, calculates the adaptive threshold, generates a binary mask, uses median filtering to fill discontinuous regions, and generates a morphology brightness map.

[0034] The filtering and smoothing module is used to transform the morpholuminescence map from the spatial domain to the frequency domain, calculate the gradient direction angle of the morpholuminescence map, construct a high-pass filter mask, perform a dot product operation on the frequency domain representation and the high-pass filter mask, transform the filtered frequency domain representation back from the frequency domain to the spatial domain, generate a filtered morpholuminescence map, perform a one-dimensional Fourier transform on the filtered morpholuminescence map along the x-direction, calculate the principal period, calculate the period difference field, use the arctangent binary function to calculate the direction angle of the complex curl, extract the principal phase field, calculate the continuous phase field, perform a convolution operation on the continuous phase field, and generate a smoothed continuous phase field.

[0035] The detection visualization module is used to calculate the gradient magnitude of the smoothed continuous phase field, set the detection threshold using statistical threshold segmentation, generate a binary defect mask, and build a visualization interface to display the binary defect mask.

[0036] Thirdly, the present invention provides a computer device including a memory and a processor, wherein the memory stores a computer program, wherein the computer program, when executed by the processor, implements any step of the image recognition-based intelligent quality detection method for rainbow film as described in the first aspect of the present invention.

[0037] Fourthly, the present invention provides a computer-readable storage medium having a computer program stored thereon, wherein: when the computer program is executed by a processor, it implements any step of the image recognition-based intelligent quality detection method for rainbow film as described in the first aspect of the present invention.

[0038] The beneficial effects of this invention are as follows: This invention generates high-quality morphological brightness maps through multi-level feature extraction and adaptive segmentation, which enhances the continuity of stripes and the distinguishability of defects. By constructing a smooth and continuous phase field and combining statistical thresholds to adaptively identify defect regions, it improves the robust recognition capability of complex interference patterns. Attached Figure Description

[0039] To more clearly illustrate the technical solutions of the embodiments of the present invention, the drawings used in the following description of the embodiments will be briefly introduced. Obviously, the drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0040] Figure 1 This is a flowchart of the image recognition-based intelligent quality detection method for rainbow film in Example 1.

[0041] Figure 2 This is a schematic diagram of the image recognition-based intelligent quality inspection system for rainbow film in Example 1. Detailed Implementation

[0042] To make the above-mentioned objects, features and advantages of the present invention more apparent and understandable, the specific embodiments of the present invention will be described in detail below with reference to the accompanying drawings.

[0043] Many specific details are set forth in the following description in order to provide a full understanding of the invention. However, the invention may also be practiced in other ways different from those described herein, and those skilled in the art can make similar extensions without departing from the spirit of the invention. Therefore, the invention is not limited to the specific embodiments disclosed below.

[0044] Secondly, the term "one embodiment" or "embodiment" as used herein refers to a specific feature, structure, or characteristic that may be included in at least one implementation of the present invention. The phrase "in one embodiment" appearing in different places in this specification does not necessarily refer to the same embodiment, nor is it a single or selective embodiment that is mutually exclusive with other embodiments.

[0045] Example 1, referring to Figure 1 This is the first embodiment of the present invention, which provides a method for intelligent quality detection of rainbow film based on image recognition, including the following steps:

[0046] S1. Collect rainbow film images and preprocess them. Convolve the rainbow film images using the Sobel operator, calculate the curvature potential function using nonlinear transformation, calculate the adaptive threshold, generate a binary mask, fill in discontinuous regions using median filtering, and generate a morpholuminance map.

[0047] Specifically, the process involves collecting and preprocessing rainbow film images, including:

[0048] Images of the rainbow film were collected using an industrial-grade camera and then denoised and normalized.

[0049] Industrial-grade cameras are used for image acquisition to ensure image clarity and stability; grayscale normalization is used to suppress the interference of ambient brightness changes on feature recognition and improve the versatility and robustness of the processing algorithm.

[0050] Furthermore, the Sobel operator is used to convolve the rainbow film image to generate a morpholuminance map, including:

[0051] The iris image is convolved using the Sobel operator to calculate its gradient. The normal curvature is then calculated based on this gradient using the following formula: ,

[0052] , , ,

[0053] in This is the normalized rainbow film image, where x and y are the horizontal and vertical coordinates of the image, specifying the center pixel position. and , represent the gradients of the iris image, and represent the gradients along the x and y directions, respectively. and These are the horizontal and vertical convolution kernels of the Sobel operator, respectively, where n is the gradient normal direction. It is a small constant of the normal curvature to prevent the gradient magnitude from being divided by zero. Normal curvature;

[0054] The second derivative is calculated using the Laplace operator, with the following formula:

[0055] ,

[0056] in Let be the second derivative, representing the result of the Laplace operator. The neighborhood set of the Laplace operator is defined using the fixed neighborhood method. Let be the number of neighboring points, and i and j be the offsets in the horizontal and vertical directions, respectively, representing the values ​​relative to the pixel coordinates. The coordinate offset;

[0057] The curvature potential function is calculated using a nonlinear transformation and then normalized. The formula is as follows: ,

[0058] in Let be the curvature potential function, which characterizes the geometric continuity and curvature response of the fringes;

[0059] An adaptive threshold is calculated using median statistics to generate a binary mask, as shown in the formula:

[0060] , ,

[0061] in For adaptive threshold, The threshold offset was set using an experimental optimization method to enhance the ability to distinguish discontinuous regions. For a binary mask, 0 represents a discontinuous pseudo-structure region and 1 represents a continuous stripe region;

[0062] Median filtering is used to fill in discontinuous regions equal to 0 in the binary mask, generating a morpholuminance map.

[0063] The Sobel operator has the advantages of strong directionality and good edge preservation, making it suitable for extracting weak and complex interference fringe structures in rainbow film images. Normal curvature is used to characterize the degree of local surface changes in the image, effectively identifying pseudo-fringe regions (discontinuous curvature) and real fringe regions (smooth curvature). The Laplacian operator is sensitive to edge response and can accurately locate the positions of brightness abrupt changes and texture changes in the image. Combined with the first derivative characteristics for fusion processing, it improves the recognition rate of discontinuous pseudo-structure regions. Through curvature and second derivative co-modeling, it realizes multi-scale expression of image structure. The normalization process unifies the regional response scale and reduces the interference of external environmental factors. The adaptive threshold is generated based on local statistical features, avoiding the risk of missegmentation caused by fixed thresholds. Median filtering can smoothly fill small broken regions without destroying the real fringe structure, restoring the morphological integrity of the fringe. It has good repair capabilities for random noise or small breaks in the image.

[0064] S2. Transform the morpholuminance map from the spatial domain to the frequency domain, calculate the gradient direction angle of the morpholuminance map, construct a high-pass filter mask, perform a dot product operation on the frequency domain representation and the high-pass filter mask, transform the filtered frequency domain representation back to the spatial domain, generate the filtered morpholuminance map, perform a one-dimensional Fourier transform on the filtered morpholuminance map along the x-direction, calculate the principal period, calculate the period difference field, use the arctangent binary function to calculate the direction angle of the complex curl, extract the principal phase field, calculate the continuous phase field, perform a convolution operation on the continuous phase field, and generate a smoothed continuous phase field.

[0065] Specifically, the generated filtered morpholuminance map includes:

[0066] The morpholuminance map is transformed from the spatial domain to the frequency domain using a two-dimensional fast Fourier transform to obtain a frequency domain representation;

[0067] The Sobel operator is used to calculate the gradient of the morpholuminescence map, and the gradient direction angle is calculated using the following formula:

[0068] ,

[0069] ,

[0070] ,

[0071] in and The gradient of the morphological brightness map, This is a morphological brightness map. The gradient direction angle, It is a small constant of the gradient direction angle. This is a two-dimensional convolution operation;

[0072] The principal direction angle is determined by plotting a histogram of the gradient direction angles using the following formula:

[0073] ,in The principal direction angle corresponds to the peak value of the histogram and represents the principal direction of the interference fringes. This is a histogram of gradient direction angles;

[0074] The formula for constructing a high-pass filter mask is:

[0075] ,

[0076] ,

[0077] ,in Let u and v be the frequency direction angle in the frequency domain, respectively, representing the horizontal and vertical frequency coordinates in the frequency domain. The frequency amplitude represents the distance of the frequency component from the origin. The frequency radius threshold is set using the dominant frequency peak location method. The half-width of the main direction angle range is set using the direction distribution analysis method. This is a high-pass filter mask in binary form. Let be a small constant representing the frequency direction angle in the frequency domain. Perform a dot product operation on the frequency domain representation and the high-pass filter mask, retaining the high-frequency components of the main direction, to obtain the filtered frequency domain representation, as shown in the formula:

[0078] ,

[0079] in This is the filtered frequency domain representation. Represented in the frequency domain;

[0080] The filtered frequency domain representation is transformed back to the spatial domain using a two-dimensional inverse fast Fourier transform to generate a filtered morpholuminance map.

[0081] By transforming periodic structures such as stripes into clear frequency components and removing background noise, the method provides a basis for extracting the main frequency direction and high-pass filtering. It accurately locates the main direction of the stripes, ensuring that subsequent directional filtering is targeted, overcoming multi-directional overlapping interference, purifying the main axis of the structure, accurately preserving high-frequency stripe information in the main direction, suppressing background interference in other directions, and effectively enhancing the directional consistency and structural integrity of the image. The filtered image has higher stripe clarity and directional consistency, laying a clean background and highlighting the main structure for main period extraction and phase reconstruction.

[0082] Furthermore, the continuous phase field is calculated, and a convolution operation is performed on the continuous phase field to generate a smoothed continuous phase field, including:

[0083] The filtered morpholuminance image is subjected to a one-dimensional Fourier transform along the x-direction, and the principal period is calculated using the following formula: ,

[0084] ,,

[0085] in The frequency corresponding to the maximum amplitude. The height of the filtered morphological brightness image is , For floor operations, This is the filtered morpholuminance map. For a one-dimensional fast Fourier transform along the x-direction, the output is a complex spectrum, where f is the frequency and T is the dominant period;

[0086] The filtered morpholuminance map is periodically differencing along the x and y directions to construct a difference field, and the periodic difference field is calculated using the following formula: , , ,

[0087] in and These are the period differences along the x and y directions, respectively, characterizing the intensity change after the principal period shift. For periodic difference fields, It is a small constant of the periodic difference field;

[0088] Based on the periodic difference field, a complex graph is constructed, and the complex curl is calculated using partial derivatives. The formula is as follows: , ,in This is a complex graph, where s is the imaginary unit. It is a complex exponential function. and are the partial derivatives of the complex graph along the x and y directions, respectively, calculated using the Sobel operator. The complex curl characterizes the spinor properties of the phase field;

[0089] The direction angle of the complex curl is calculated using the arctangent bivariate function, and the principal phase field is extracted using the following formula:

[0090] ,

[0091] in The principal phase field characterizes the phase distribution of the interference fringes. For the imaginary part of the complex curl, is the real part of the complex curl;

[0092] Initialize the continuous phase field and integer compensation term. Taking the center point of the filtered morpholuminance map as the starting point, initialize the integer compensation term to 0. Using the path integral method, starting from the starting point, use breadth-first search to traverse all pixels, calculate the phase difference, update the integer compensation term, and calculate the continuous phase field. The formula is: , , ,

[0093] in and These are the principal phase field values, and The coordinates of the neighboring pixels are set using the fixed-window neighborhood method. For continuous phase field, and For integer compensation terms, integer values, This is the phase difference value;

[0094] Using a fixed window indexing method to set the offset relative to the center pixel, a Gaussian kernel is defined, and a convolution operation is performed on the continuous phase field to generate a smoothed continuous phase field. The formula is as follows: , ,

[0095] in Let m be a Gaussian kernel and h be the offsets relative to the center pixel. The standard deviation is set using a data-driven approach to control the smoothness, and k is the window half-width, set using an empirical method for window size. It is a smoothed continuous phase field.

[0096] Constructing a periodic difference field clarifies the relative offset trend of the periodic structure and enhances the directional consistency of the periodic phase field. Introducing periodic difference into complex space modeling, complex curl provides an expression of the phase offset and spinor characteristics of the image structure, improving the stability of phase reconstruction. Complex modeling combined with path integrals constructs a continuous phase field with high consistency and strong anti-interference ability. Gaussian smoothing controls the scale, preserving the real structure while suppressing noise, effectively eliminating the glitch effect caused by local phase discontinuities, and improving the robustness of phase data for subsequent tasks such as 3D reconstruction and contour recognition.

[0097] S3. Calculate the gradient magnitude of the smoothed continuous phase field, use statistical threshold segmentation to set the detection threshold, generate a binary defect mask, and build a visualization interface to display the binary defect mask.

[0098] Specifically, the gradient magnitude of the smoothed continuous phase field is calculated to generate a binary defect mask, including:

[0099] The gradient magnitude of the smoothed continuous phase field is calculated using the following formula: ,

[0100] in and These are the partial derivatives of the smoothed continuous phase field along the x and y directions, respectively, calculated using the Sobel operator. For gradient mode;

[0101] A detection threshold is set using statistical threshold segmentation. Regions exceeding the threshold are marked as potential defect regions, generating a binary defect mask. The formula is as follows:

[0102] ,

[0103] ,

[0104] in For the detection threshold, and These are the global mean and standard deviation of the gradient magnitude, respectively. It is a binary defect mask.

[0105] Defective regions are often accompanied by abrupt phase changes, exhibiting a high-amplitude response in the gradient domain. Background regions with slow phase changes have a lower response in the gradient magnitude, while edges or aberration regions are clearly highlighted. An adaptive threshold based on the statistical distribution of the image itself avoids over-detection or under-detection problems caused by manually set parameters. Since the statistics are calculated from the global gradient distribution, it has a significant enhancement effect on local abrupt change regions while having a smaller impact on the background.

[0106] Furthermore, a visual interface is constructed to display the binary defect mask, including:

[0107] A visual interface is built using the front-end framework React.js to visualize the binary defect mask;

[0108] Users who have completed real-name verification are allowed to view this information.

[0109] It provides a clear and intuitive view of defects, making it easy for users to quickly determine the nature, location, and shape of defects. It controls data access permissions through real-name verification, meeting the privacy management needs of research institutions or industrial systems for sensitive images.

[0110] Example 2, refer to Figure 2 As a second embodiment of the present invention, a rainbow film intelligent quality inspection system based on image recognition includes:

[0111] The morphology collection module is used to collect rainbow film images and perform preprocessing. It uses the Sobel operator to convolve the rainbow film images, uses nonlinear transformation to calculate the curvature potential function, calculates the adaptive threshold, generates a binary mask, uses median filtering to fill discontinuous regions, and generates a morphology brightness map.

[0112] The filtering and smoothing module is used to transform the morpholuminescence map from the spatial domain to the frequency domain, calculate the gradient direction angle of the morpholuminescence map, construct a high-pass filter mask, perform a dot product operation on the frequency domain representation and the high-pass filter mask, transform the filtered frequency domain representation back from the frequency domain to the spatial domain, generate a filtered morpholuminescence map, perform a one-dimensional Fourier transform on the filtered morpholuminescence map along the x-direction, calculate the principal period, calculate the period difference field, use the arctangent binary function to calculate the direction angle of the complex curl, extract the principal phase field, calculate the continuous phase field, perform a convolution operation on the continuous phase field, and generate a smoothed continuous phase field.

[0113] The detection visualization module is used to calculate the gradient magnitude of the smoothed continuous phase field, set the detection threshold using statistical threshold segmentation, generate a binary defect mask, and build a visualization interface to display the binary defect mask.

[0114] This embodiment also provides a computer device applicable to the intelligent quality detection method for rainbow film based on image recognition, comprising: a memory and a processor; the memory is used to store computer-executable instructions, and the processor is used to execute the computer-executable instructions to implement the intelligent quality detection method for rainbow film based on image recognition as proposed in the above embodiment.

[0115] The computer device can be a terminal, comprising a processor, memory, communication interface, display screen, and input devices connected via a system bus. The processor provides computing and control capabilities. The memory includes non-volatile storage media and internal memory. The non-volatile storage media stores the operating system and computer programs. The internal memory provides an environment for the operation of the operating system and computer programs stored in the non-volatile storage media. The communication interface is used for wired or wireless communication with external terminals; wireless communication can be achieved through Wi-Fi, carrier networks, NFC (Near Field Communication), or other technologies. The display screen can be an LCD screen or an e-ink screen. The input devices can be a touch layer covering the display screen, buttons, a trackball, or a touchpad on the computer device's casing, or an external keyboard, touchpad, or mouse.

[0116] This embodiment also provides a storage medium storing a computer program, which, when executed by a processor, implements the image recognition-based intelligent quality detection method for rainbow films as proposed in the above embodiments. The storage medium can be implemented by any type of volatile or non-volatile storage device or a combination thereof, such as Static Random Access Memory (SRAM), Electrically Erasable Programmable Read-Only Memory (EEPROM), Erasable Programmable Read Only Memory (EPROM), Programmable Red-Only Memory (PROM), Read-Only Memory (ROM), magnetic storage, flash memory, magnetic disk, or optical disk.

[0117] It should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention and are not intended to limit it. Although the present invention has been described in detail with reference to preferred embodiments, those skilled in the art should understand that modifications or equivalent substitutions can be made to the technical solutions of the present invention without departing from the spirit and scope of the technical solutions of the present invention, and all such modifications or substitutions should be covered within the scope of the claims of the present invention.

Claims

1. A method for intelligent quality detection of rainbow film based on image recognition, characterized in that: Includes the following steps: Rainbow film images are collected and preprocessed. The Sobel operator is used to convolve the rainbow film images, and a nonlinear transformation is used to calculate the curvature potential function, which is then normalized. The formula is as follows: , in Let be the curvature potential function. It is the second derivative. Normal curvature; Calculate the adaptive threshold, generate a binary mask, use median filtering to fill in discontinuous regions, and generate a morpholuminance map. The morpholuminance map is transformed from the spatial domain to the frequency domain. The gradient direction angle of the morpholuminance map is calculated, a high-pass filter mask is constructed, and a dot product operation is performed on the frequency domain representation and the high-pass filter mask. The filtered frequency domain representation is transformed back from the frequency domain to the spatial domain to generate a filtered morpholuminance map. The filtered morpholuminance map is then subjected to a one-dimensional Fourier transform along the x-direction to calculate the principal period. The period difference field is calculated, and the direction angle of the complex curl is calculated using the arctangent binary function. The principal phase field is extracted, and the continuous phase field is calculated. The continuous phase field is then convolved to generate a smoothed continuous phase field. The gradient magnitude of the smoothed continuous phase field is calculated, a detection threshold is set using statistical threshold segmentation, regions above the threshold are marked as potential defect regions, a binary defect mask is generated, and a visualization interface is constructed to display the binary defect mask.

2. The intelligent quality detection method for rainbow film based on image recognition as described in claim 1, characterized in that: The step of convolving the rainbow film image using the Sobel operator to generate a morphological brightness map includes: The Sobel operator is used to convolve the iris image, the gradient of the iris image is calculated, the normal curvature is calculated based on the gradient of the iris image, the second derivative is calculated using the Laplacian operator, the curvature potential function is calculated using nonlinear transformation, and then normalization is performed. An adaptive threshold is calculated using median statistics to generate a binary mask. Median filtering is then used to fill in discontinuous regions equal to 0 in the binary mask, generating a morpholuminance map.

3. The intelligent quality detection method for rainbow film based on image recognition as described in claim 2, characterized in that: The generated filtered morphology-luminance map includes: The morpholuminance map is transformed from the spatial domain to the frequency domain using a two-dimensional fast Fourier transform to obtain a frequency domain representation; The Sobel operator is used to calculate the gradient of the morphology brightness map, the gradient direction angle of the morphology brightness map is calculated, the histogram of the gradient direction angle is statistically analyzed, the main direction angle is determined, and a high-pass filter mask is constructed. Perform a dot product operation on the frequency domain representation and the high-pass filter mask to obtain the filtered frequency domain representation.

4. The intelligent quality detection method for rainbow film based on image recognition as described in claim 3, characterized in that: The calculation of the continuous phase field, which involves performing a convolution operation on the continuous phase field to generate a smoothed continuous phase field, includes: Perform a one-dimensional Fourier transform on the filtered morpholuminance map along the x-direction to calculate the main period; The filtered morpholuminance map is used to construct a difference field by periodically differencing along the x and y directions, and the periodic difference field is calculated. Based on the periodic difference field, a complex graph is constructed, and the complex curl is calculated by partial derivatives. The direction angle of the complex curl is calculated by the arctangent bivariate function, and the principal phase field is extracted. Initialize the continuous phase field and integer compensation term. Take the center point of the filtered morpholuminance map as the starting point, initialize the integer compensation term to 0, use the path integral method to start from the starting point, use breadth-first search to traverse all pixels, calculate the phase difference, update the integer compensation term, and calculate the continuous phase field. Using a fixed window indexing method to set the offset relative to the center pixel, a Gaussian kernel is defined, and a convolution operation is performed on the continuous phase field to generate a smoothed continuous phase field.

5. The intelligent quality detection method for rainbow film based on image recognition as described in claim 4, characterized in that: The gradient magnitude of the smoothed continuous phase field is calculated to generate a binary defect mask, including: Calculate the gradient magnitude of the smoothed continuous phase field; Statistical thresholding is used to set the detection threshold and generate a binary defect mask.

6. The intelligent quality detection method for rainbow film based on image recognition as described in claim 5, characterized in that: The construction of a visual interface to display the binary defect mask includes: A visual interface is built using the front-end framework React.js to visualize the binary defect mask; Users who have completed real-name verification are allowed to view this information.

7. The intelligent quality detection method for rainbow film based on image recognition as described in claim 6, characterized in that: The process of collecting and preprocessing rainbow film images includes: Images of the rainbow film were collected using an industrial-grade camera and then denoised and normalized.

8. A rainbow film intelligent quality inspection system based on image recognition, used to implement the method described in any one of claims 1 to 7, characterized in that: include: The morphology collection module is used to collect rainbow film images and perform preprocessing. It uses the Sobel operator to convolve the rainbow film images, uses nonlinear transformation to calculate the curvature potential function, calculates the adaptive threshold, generates a binary mask, uses median filtering to fill discontinuous regions, and generates a morphology brightness map. The filtering and smoothing module is used to transform the morpholuminescence map from the spatial domain to the frequency domain, calculate the gradient direction angle of the morpholuminescence map, construct a high-pass filter mask, perform a dot product operation on the frequency domain representation and the high-pass filter mask, transform the filtered frequency domain representation back from the frequency domain to the spatial domain, generate a filtered morpholuminescence map, perform a one-dimensional Fourier transform on the filtered morpholuminescence map along the x-direction, calculate the principal period, calculate the period difference field, use the arctangent binary function to calculate the direction angle of the complex curl, extract the principal phase field, calculate the continuous phase field, perform a convolution operation on the continuous phase field, and generate a smoothed continuous phase field. The detection visualization module is used to calculate the gradient magnitude of the smoothed continuous phase field, set the detection threshold using statistical threshold segmentation, generate a binary defect mask, and build a visualization interface to display the binary defect mask.

9. A computer device comprising a memory and a processor, wherein the memory stores a computer program, characterized in that: When the processor executes the computer program, it implements the steps of the image recognition-based intelligent quality detection method for rainbow film as described in any one of claims 1 to 7.

10. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by the processor, it implements the steps of the image recognition-based intelligent quality detection method for rainbow film as described in any one of claims 1 to 7.