Membrane structure weld defect detection method based on image recognition
By employing techniques such as fixed-position imaging, grayscale conversion and segmented mapping, and boundary tracking, the problem of low defect segmentation accuracy in lap welds of flexible materials with unequal thicknesses has been solved, enabling efficient identification and classification of internal defects.
Patent Information
- Application Number
- CN202511621058.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-11-07
- Publication Date
- 2025-12-05
- Estimated Expiration
- 2045-11-07
AI Technical Summary
Existing technologies, when inspecting lap welds of flexible materials with unequal thicknesses, suffer from low defect segmentation accuracy due to continuous changes in image grayscale, making it impossible to effectively identify internal defects and increasing safety risks in membrane structure engineering.
A complete view of the weld area is obtained using a fixed-position imaging device. The acquisition parameters are recorded, grayscale conversion and segmented mapping are performed to adjust the grayscale values, and potential defects are extracted, classified and verified by combining boundary tracking logic and edge feature analysis.
It significantly improves the accuracy and reliability of detecting internal defects in lap welds of flexible materials with unequal thickness, overcomes the interference of continuous grayscale changes, and ensures the accuracy and reliability of the detection results.
Smart Images

Figure CN121068631A_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The application relates to the technical field of material nondestructive testing, in particular to a film structure welding seam defect detection method based on image recognition. BACKGROUND
[0002] The film structure is a kind of light-weight and high-strength building form, which is widely used in fields such as large sports stadiums, exhibition halls and transportation hubs. The core component of the film structure is a flexible film material (such as polyvinyl chloride or polytetrafluoroethylene film), which is connected through lap welding seams. The quality of the welding seams directly affects the overall stability and durability of the structure. Once internal defects (such as pores or cracks) occur, it may lead to structural failure or safety hazards. Therefore, the welding seam defect detection method based on image recognition has become a key technical means to ensure the quality of film structure engineering. This method collects welding seam images, performs gray scale analysis and defect segmentation, and identifies potential problems in a non-destructive manner. However, existing detection technologies face significant challenges when dealing with lap welding seams of flexible materials with uneven thickness. In the prior art, CN102279190A discloses a laser welding uneven thickness plate welding seam surface defect image detection method. This method uses structured light vision and data fitting processing to collect and analyze the welding seam surface image, mainly for identifying surface cracks and other defects during the laser welding process. By fitting the welding seam contour curve, this patent realizes preliminary detection of the surface morphology, but its focus is on extracting the geometric features of surface defects, without fully considering the internal gray scale changes caused by uneven thickness of flexible materials. Another existing technology, CN103914838A, discloses an industrial X-ray welding seam image defect recognition method. This method processes the welding seam image by size normalization, filtering and segmentation of sample images to extract defect features. This patent is suitable for general recognition of industrial welding seams, emphasizing the standardization of image preprocessing steps, but it also ignores the unique characteristics of lap welding seams of flexible materials with uneven thickness, i.e. the continuous change of gray scale caused by material thickness gradient, which affects the accurate segmentation of defect edges. The limitation of the above-mentioned prior art is that when applied to lap welding seams of flexible materials with uneven thickness, the continuous change of image gray scale causes the defect boundary to be blurred, resulting in low segmentation accuracy and ineffective identification of internal defects. Specifically, in the lap area of flexible film materials, due to uneven thickness, the image gray scale gradient presents a continuous transition, and traditional filtering and segmentation algorithms have difficulty in distinguishing defects from normal welding seam areas, resulting in high false detection or missed detection rates. This not only reduces the detection efficiency, but also increases the safety risk of film structure engineering. Therefore, there is an urgent need for an image recognition method that can overcome the interference of continuous gray scale changes and improve the accuracy of defect segmentation to meet the actual needs of film structure welding seam detection. SUMMARY
[0003] (I) Technical problems solved
[0004] In view of the deficiencies of the prior art, the present application provides a film structure weld defect detection method based on image recognition, which is used to solve the problem that the image gray scale of the lap weld of the flexible material with unequal thickness continuously changes in the traditional method, resulting in low defect segmentation accuracy and inability to effectively identify internal defects.
[0005] (II) Technical solutions
[0006] In order to achieve the purpose of overcoming the interference of continuous gray scale change and improving the defect segmentation accuracy mentioned in the background art, the present application provides the following technical solutions: A film structure weld defect detection method based on image recognition, comprising: S1: Collecting the original image of the lap weld of the flexible material with unequal thickness, using a fixed-position imaging device to obtain a complete view of the weld area, covering the overall appearance of the lap joint, and recording the acquisition parameters of the image; S2: Performing gray scale conversion on the collected original image, converting color or multi-channel images into single-channel gray scale images, unifying the image data format, and maintaining the original distribution of pixel values; S3: Analyzing the thickness gradient distribution in the gray scale image, identifying the continuous gray scale change caused by the unequal thickness area, adjusting the gray scale value using segmented mapping, balancing the contrast of the gradient transition area, and generating an adjusted gray scale image; S4: Based on the adjusted gray scale image, performing region segmentation to separate the weld area from the non-weld area, using boundary tracking logic to lock the specific range of the lap weld, and marking the boundary coordinates of the separated area; S5: In the separated weld area, extract the edge features of potential defects, locate the gray scale abnormal points using continuous pixel comparison, form the defect candidate area, and record the pixel range of each candidate area; S6: Classifying and verifying the defect candidate area, combining edge features and gray scale threshold logic to confirm the existence and type of internal defects, and outputting the verified defect information.
[0007] In a preferred embodiment, the original image of the lap weld of the flexible material with unequal thickness is collected, a fixed-position imaging device is used to obtain a complete view of the weld area, covering the overall appearance of the lap joint, and the acquisition parameters of the image are recorded, including: Performing preliminary evaluation on the lap weld area, measuring the thickness difference by contact or non-contact thickness gauge, identifying the thickness of the superimposed layer, and guiding camera exposure and light source adjustment; Using a high-resolution industrial camera equipped with a wide-angle lens, fixed on a bracket or mechanical arm, installed above or beside the weld, adjusting the distance and aligning the center line; Obtaining a complete view covering the weld and the buffer area on both sides; Using diffuse light source to reduce surface reflection, control light intensity and ambient temperature and humidity; In the calibration, the exposure is adjusted by using the gray card, the uncompressed format image is stored, the parameters and environmental factors are recorded, and the structured file is associated with the storage; In the automatic detection, the equipment moves along the weld path, and the position is recorded synchronously.
[0008] In a preferred embodiment, the collected original image is converted to grayscale, the color or multi-channel image is converted to a single-channel grayscale image, the image data format is unified, and the original distribution of pixel values is maintained, including: Based on the collected original image, the color or multi-channel image is converted to grayscale, the red, green and blue channels are merged into a single grayscale value after channel structure inspection, and the coefficients are calibrated according to the acquisition parameters; Unify the pixel value range to the standardized grayscale spectrum while maintaining the original pixel relative distribution; Perform histogram verification and re-adjust the merging coefficients in the deviation area of the distribution curve; Save the grayscale image in lossless format and embed the acquisition parameters through metadata; Implement adaptive logic for different film materials, apply pre-filtering operation in the channel separation stage for high-reflective surfaces, and preferentially isolate the weld foreground area for translucent materials; Integrated into an automatic system, read parameters to dynamically adjust compensation coefficients; In large image processing, perform merging and verification processes in blocks, and overlap and splice adjacent blocks.
[0009] In a preferred embodiment, the thickness gradient distribution in the grayscale image is analyzed, the continuous change of grayscale caused by the uneven thickness area is identified, the grayscale value is adjusted using segmented mapping, the contrast of the gradient transition area is balanced, and the adjusted grayscale image is generated, including: Load the converted grayscale image into the processing system, read the acquisition parameters to assist scanning, and verify the grayscale value coverage range; Scan the pixels row by row along the weld path, divide the strips to count the grayscale characteristics, and construct the thickness gradient curve; Identify the continuous change area of grayscale through trend analysis of pixel sequence, and confirm the thickness gradient influence with the aid of profile verification; Segment the image according to the change rate, and adjust the grayscale value of each segment; Optimize the grayscale distribution in the transition area through multiple mappings; Splice to generate the adjusted image, and save the mapping parameters to metadata; Adjust the mapping strategy dynamically according to environmental conditions, and perform specific preprocessing or compensation operations for different film materials.
[0010] In a preferred embodiment, based on the adjusted grayscale image, region segmentation is performed to separate the weld area from the non-weld area, the specific range of the lap weld is locked using boundary tracking logic, and the boundary coordinates of the separated area are marked, including: Load the adjusted grayscale image, read the mapping log auxiliary scan; Perform weld and non-weld area separation, calculate the grayscale mean value as the reference by global traversal, compare and classify pixel by pixel, and dynamically adjust the threshold value; Perform boundary tracking based on the separation mask, navigate along the pixels from the starting point, expand the path based on the adjacent grayscale difference, lock the main weld path and mark the sub-area, and generate a closed contour to cover the lap range; Perform neighborhood consistency check to confirm classification, introduce direction prediction tracking point for curve weld, and bridge the disconnected grayscale area to connect the boundary.
[0011] In a preferred embodiment, including: Mark the boundary coordinates, extract the key node coordinates and bounding box parameters; Calibrate to physical size based on acquisition parameters, mark the main weld as level one and the sub-area as level two, and embed metadata in a structured format; Apply reflective filtering for high-reflective films and cut the main area for translucent films; Perform coarse and fine separation for large welds in layers; Apply grayscale compensation to stabilize the baseline for outdoor scene applications; Integrate an automated system to output coordinates in real time to support positioning and reporting, and perform threshold value judgment, tracking and labeling in multiple threads.
[0012] In a preferred embodiment, in the separated weld area, the edge features of potential defects are extracted, the grayscale abnormal points are located using continuous pixel comparison, the defect candidate area is formed, and the pixel range of each candidate area is recorded, including: Load the separated weld area image and boundary coordinates, and crop the image through the bounding box parameters; Traverse the pixel grid row by row, get the pixel and its neighborhood grayscale value, and calculate the absolute difference value to mark the edge point; Perform continuous pixel chain analysis, extract the sequence along the weld direction, determine the consistent sequence as an abnormal point group, and expand the profile to the side to verify and merge the two-dimensional area; Aggregate adjacent abnormal point groups to form a closed candidate area through bridging logic; Adapt to different materials, apply noise filtering on high-reflective surfaces, and preferentially isolate defect foreground in translucent areas.
[0013] In a preferred embodiment, including: Record the pixel range of the candidate area, extract the boundary nodes to calculate the enclosing rectangle, record the coordinate pairs and the center coordinate, and calibrate to the physical size based on the acquisition parameters; Label the abnormal point density and embed the metadata in a structured format; Set the threshold value by analyzing the gray scale distribution and defect position through sample statistics, automatically select the demarcation point, and dynamically calibrate the range combined with the acquisition parameters; In batch processing, the extraction and recording are performed in layers.
[0014] In a preferred embodiment, the defect candidate area is classified and verified, combined with edge features and gray scale threshold logic, to confirm the existence and type of internal defects, and output the verified defect information, including: Load the candidate area list, crop the gray scale image according to the coordinate range, limit the pixel subset and strip the background area; Sort by abnormal point density, prioritize high-density areas, extract edge point sets for each area and construct connected chains, and classify according to geometric morphology; Collect gray scale statistical features, integrate edge geometry and gray scale values for classification; Set the gray scale threshold logic to determine the preliminary threshold value with the area mean value coefficient; Implement confirmation combined with threshold judgment and edge morphology, confirm the existence according to the edge point ratio, and label the type; Merge adjacent similar candidate areas into larger areas; Output a structured report including defect number, type, existence status, pixel range, center coordinate and statistical parameters in JSON or XML format, and embed the acquisition parameters.
[0015] Compared with the prior art, the present application provides a film structure weld defect detection method based on image recognition, which has the following beneficial effects: 1.The present application significantly improves the recognizability of the gray scale gradient caused by thickness variation in the image by starting from the original image of the weld area, using fixed position imaging, clear recording acquisition parameters, multi-exposure fusion, gray scale conversion and gradient mapping, segmented scanning and sub-image splicing, etc.; further combining segmented mapping to adjust the gray scale value, unify the pixel value distribution, and improve the contrast of the transition area, so that the original gray scale blur phenomenon caused by thickness variation is suppressed, thereby providing a clearer input for area segmentation; then, through the boundary tracking, area separation and candidate area extraction logic, the abnormal gray scale or edge features in the weld area are effectively focused, and the structured parameter record is used to realize the accurate mapping from the pixel level to the physical size; finally, in the classification verification stage, the method combining edge geometric morphological analysis and gray scale threshold dynamic adjustment can identify internal defects such as cracks, pores and interlayer cavities in the lap joint area with obvious thickness gradient variation, and output the detection results in a structured manner, including defect type, position, severity and physical range, thereby solving the problem of low defect segmentation accuracy and ineffective identification of internal defects caused by continuous gray scale variation in the image of the lap joint weld of the non-uniform thickness flexible material in the traditional method.
[0016] 2.The present application ensures the geometric consistency and gray scale response stability of the image data by using fixed position, high resolution equipment and recording environmental and optical parameters during the imaging stage; in the gray scale conversion and mapping stage, the pixel distribution is unified and the gray scale variation caused by thickness gradient is enhanced, so that the gray scale features of the thickness superposition area change from continuous blur to distinguishable gradient variation; in the candidate area extraction stage, segmented scanning, sub-image splicing, edge and gray scale joint determination and other logics are used to accurately locate the abnormal gray scale area; in the final verification stage, edge geometric morphology, set gray scale threshold, thickness gradient data and acquisition parameter correction are fused to realize the classification confirmation of different types of defects, and the structured output is used for subsequent maintenance or management; thereby overcoming the difficulty of identifying gray scale variation caused by thickness gradient in traditional technology, and significantly improving the detection accuracy, reliability and engineering applicability of internal defects in the lap joint weld. BRIEF DESCRIPTION OF DRAWINGS
[0017] Figure 1 The flowchart of a film structure weld defect detection method based on image recognition according to the present application. DETAILED DESCRIPTION
[0018] The technical solutions in the embodiments of the present application will be described clearly and completely below with reference to the drawings in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all. Based on the embodiments in the present application, all other embodiments obtained by those skilled in the art without creative labor are within the scope of protection of the present application.
[0019] Embodiments: Figure 1 A film structure weld defect detection method based on image recognition is given, comprising: S1: Collect the original image of the unequal thickness flexible material lap weld, use the fixed position imaging device to obtain the complete view of the weld area, cover the overall appearance of the lap joint, and record the acquisition parameters of the image; S2: Perform gray scale conversion on the collected original image, convert color or multi-channel image to single-channel gray scale image, unify image data format, and keep the original distribution of pixel value; S3: Analyze the thickness gradient distribution in the gray scale image, identify the gray scale continuous change caused by the unequal thickness area, adjust the gray scale value using segmented mapping, balance the contrast of the gradient transition area, and generate the adjusted gray scale image; S4: Based on the adjusted gray scale image, perform region segmentation to separate the weld area from the non-weld area, use boundary tracking logic to lock the specific range of the lap weld, and mark the boundary coordinates of the separated area; S5: In the separated weld area, extract the edge features of potential defects, use continuous pixel comparison to locate gray scale abnormal points, form defect candidate areas, and record the pixel range of each candidate area; S6: Classify and verify the defect candidate area, combine the edge feature and gray scale threshold logic to confirm the existence and type of internal defects, and output the verified defect information.
[0020] S1: Collect the original image of the unequal thickness flexible material lap weld, use the fixed position imaging device to obtain the complete view of the weld area, cover the overall appearance of the lap joint, and record the acquisition parameters of the image, which is implemented as: First, the lap weld area is preliminarily evaluated, the thickness difference of the lap joint is measured, the thickness range (e.g. 0.5mm to 2mm) is confirmed by contact thickness gauge or non-contact laser thickness gauge, and the possible superposition layer thickness (e.g. 1mm to 3mm) at the lap joint is identified; The thickness evaluation result is used to guide the subsequent camera exposure, lens selection and light source adjustment to avoid excessive exposure or underexposure caused by thickness gradient, and to ensure that the dynamic range of the collected image is sufficient to cover the subtle changes of gray scale gradient; The imaging device with fixed position is selected as the main acquisition tool, and a high-resolution industrial camera or digital imaging system with a resolution of not less than 2000*1500 pixels is used to ensure the clarity of image details. The device should be equipped with a wide-angle lens with a focal length of 28 mm to 50 mm to adapt to the wide view of the lap joint part of the flexible film material and reduce the distortion caused by the bending of the material. The imaging device is fixed through a special support, tripod or mechanical arm, installed above or beside the weld, and the distance from the weld surface is maintained at 20 cm to 50 cm, which is adjusted according to the length of the weld and the space on site. The device must be aligned with the center line of the weld through the adjusting mechanism (such as screw adjuster or pneumatic positioning system), and the optical axis must be perpendicular to the weld plane to ensure that the two-dimensional view obtained is free of tilt and perspective distortion. Avoiding the shaking or angle deviation introduced by handheld devices, so that each acquired image has consistent geometric projection, especially for lap welds of unequal thickness flexible materials with obvious thickness gradient; When acquiring the complete view of the weld area, the overall appearance of the lap joint part must be covered, that is, not only the weld itself is shot, but also the buffer area of 5 cm to 10 cm on both sides of the weld is included to provide background contrast reference. If the length of the weld is long (e.g. more than 1 meter), a segmented scanning mode should be used: starting from one end of the weld, moving the device position at a predetermined interval (e.g. 5 cm) along the length direction, acquiring sub-images segment by segment, and the recommended size of each segment image is 1920*1080 pixels. The adjacent sub-images should overlap at least 30% to facilitate subsequent software stitching into a complete view and geometric correction to eliminate seam errors. This overall coverage logic is derived from the fact that there may be a thickness gradient and internal stress concentration area at the lap weld of flexible film structure, and the gray scale change often spreads from the lap edge to the center. If the view is incomplete, it may miss small defects (such as pores or initial cracks) at the edge, thereby affecting the overall detection; Lighting and environmental condition control are also critical. A uniform diffuse light source (such as a ring-shaped LED light array) should be placed around the imaging device to provide diffuse light with a color temperature of about 4000 K for the weld area to reduce the reflection of the film material surface on the lens. The light source intensity should be controlled at 500 lux to 800 lux to prevent excessive enhancement of gray scale difference in the area of unequal thickness due to shadow. The environmental temperature should be maintained at 20°C to 25°C and the humidity should be less than 60% to prevent deformation caused by thermal expansion and contraction of flexible materials, thereby ensuring the stability and consistency of the lap structure state. If transparent or semi-transparent film materials are detected, a backlit illumination mode should be used: the light source is placed below the film to enhance the gray scale contrast of internal defects, and the illumination mode is recorded in the parameters; Before and during the collection, the equipment is calibrated and monitored in real time. A standard gray card can be placed next to the weld to adjust the exposure parameters using the automatic white balance function or manual correction to ensure that the image gray scale range covers 0 to 255 (full gray scale); the exposure time is set to 1 / 60 to 1 / 125 seconds, and the ISO value is set to 100 to 400 in shutter priority mode to balance noise control and detail retention; if the thickness evaluation shows significant changes in the thick end of the lap joint, a slightly longer exposure time can be used, while the thin end uses a shorter exposure time, which is recorded by the parameter; the device display screen should be monitored in real time during the collection to ensure that the weld area is not overexposed or underexposed, and the light source angle or device height should be adjusted in time if there is an abnormality; The format of the image should be selected as a non-compressed format (such as RAW or TIFF) to preserve the original pixel data and avoid the introduction of artifacts by JPEG compression. After the collection is complete, the image data should be backed up to a storage medium immediately, and the file integrity should be verified by checksum calculation to prevent data loss. The device model, lens focal length, aperture size, exposure time, ISO value, gain value, light source intensity, light source color temperature, environmental temperature, humidity, geometric position coordinates of the device and the weld (such as X-Y coordinate system with the start of the weld as the origin), device tilt angle (such as for curved welds), sensor temperature, noise level, operator ID, timestamp, and serial number should be recorded in detail. The above parameters should be stored in a one-to-one association with the image file using JSON structure or XML file, or embedded in the image file through EXIF metadata to ensure that the data chain from collection to processing is traceable and correctable. In addition, the device selection should prioritize wide dynamic range models (supporting HDR mode) to handle the overlapping of gray scale peaks caused by the reflection points and thickness changes on the surface of flexible film materials. When the device is fixed, the relative position error between the support and the weld should be less than 1 mm, and a laser alignment instrument can be used for auxiliary positioning. For curved welds, the device tilt angle should be calculated based on the radius of curvature, and the angle value should be recorded. The view width should be at least twice the width of the weld to fully capture the gray scale changes in the thickness transition zone. If integrated with an automated production line, the imaging device can be installed at the end of the mechanical arm, moving along the weld path at a speed of 10 cm / s, with the sampling interval and position recorded synchronously, and the parameters uploaded to the database in real time through the PLC system. For outdoor membrane structure detection, a light shield should be used to block natural light interference, the light source should be switched to a portable battery-powered LED, and the image resolution should be increased to 4K level to capture subtle thickness changes. In batch detection scenarios, multiple weld images are collected in parallel, and the image files are named with the weld unique ID prefix for easy subsequent processing. The image and parameter files can be packaged and transmitted to the processing module as input, directly supporting gray scale continuous change analysis and defect segmentation.
[0021] S2: The collected original image is converted to grayscale, and the color or multi-channel image is converted to a single-channel grayscale image, the image data format is unified, and the original distribution of pixel values is maintained, which is implemented as: Based on the unequal thickness flexible material lap joint weld original image collection and parameter recording work completed in S1, the collected color or multi-channel image is converted to grayscale. The purpose is to unify the multi-dimensional image data to a single-channel grayscale format, thereby laying a standardized input foundation for subsequent thickness gradient analysis. First, the image obtained from S1 is usually in color (such as RGB three channels) or multi-channel format with additional metadata. The image covers the full view of the weld area and is accompanied by detailed collection parameters (such as exposure time, aperture value, ISO, light source intensity, etc.). Before conversion, the image is loaded and the recorded collection parameters are queried to determine whether compensation for channel merging ratio or grayscale mapping is needed to avoid grayscale distortion caused by differences in collection conditions. Next, the image channel structure is checked: if it is a color RGB image, the values of the red, green, and blue channels are combined into a single grayscale value according to the standard weighted average logic. The traditional method usually has a red channel coefficient of 0.299, a green channel coefficient of 0.587, and a blue channel coefficient of 0.114. However, in this method, to accommodate the influence of the thickness gradient on the brightness in the unequal thickness flexible material lap joint weld, the above coefficients are moderately calibrated according to the collection parameters (such as light source intensity, gain value) to compensate for the high light or shadow area. For example: when the light source intensity is higher than the set value of 500 lux, the red channel coefficient can be adjusted to 0.28, the green channel to 0.60, and the blue channel to 0.12 to enhance the visibility of the thin end grayscale change. This ensures that the grayscale gradient continuity from thick to thin in the weld is preserved, avoiding breaks or jumps in the merging process. If the image contains a fourth channel (such as an alpha transparent channel) or a depth channel, the channel should be stripped first, and only the color main channel should be merged to ensure that the final grayscale image only reflects the physical thickness and surface grayscale difference, rather than transparency or background depth information interference. While generating the grayscale image, the format and pixel value range need to be unified. All pixel values are standardized to the range of 0 to 255 while maintaining the relative relationship between the original pixel values. That is, the pixel grayscale values before and after merging should satisfy: if the pixel A grayscale response in the original color image is higher than the response of pixel B (where A and B are any two different pixel points), then in the grayscale image, the relationship A > B should still be maintained. For this reason, the conversion program uses linear mapping without applying gamma correction or nonlinear transformation to maximize the preservation of the original brightness gradient characteristics. If the original image is 16-bit channel depth, it should be scaled to 8-bit format first: that is, all 16-bit pixel values are mapped to the 0-255 interval after being divided by 256. Nonlinear transformation or resampling blur is prohibited to ensure that the grayscale slope caused by the thickness change in the lap joint area remains unchanged. At the same time, histogram verification should be carried out before and after image conversion; after conversion, the gray histogram of the gray image is extracted and compared with the weighted histogram extracted from the original color channels; if the peak value deviates more than the preset threshold (for example, more than 5%), or the gray distribution curve appears broken or abnormal jumps, it needs to be rolled back to the channel merging coefficient or exposure compensation step to adjust again and perform conversion again; to ensure that the gray image faithfully reflects the brightness change in the original multi-channel image in numerical distribution, thereby supporting the reliability of subsequent thickness gradient analysis; After generating the gray image, the image should also be saved in a lossless format (such as TIFF or BMP), and the acquisition parameters recorded in S1 (including but not limited to device model, lens focal length, aperture, exposure time, ISO, gain, light source intensity, color temperature, environment temperature, humidity, device position coordinates, device tilt angle, sensor temperature, etc.) are embedded in the image file header through metadata or saved in the form of accompanying JSON / XML log files, and ensure that the image file name corresponds to the parameter record file, the file association logic builds a traceable data chain from acquisition to conversion, and provides convenience for subsequent processing module calls; In order to adapt to the characteristics of different film structure materials, this gray conversion step also includes adaptive logic; for high-reflective surface films, a pre-filtering operation should be applied before merging channels: for example, using low-pass filtering or median filtering of each channel pixel value to remove high-frequency noise, and then performing standard channel merging, thereby avoiding isolated peak values caused by high-reflective points in the gray image; this pre-filtering operation is only limited to the channel separation stage and does not change the merged gray distribution curve; for translucent films, the weld seam foreground area should be isolated first: using the weld seam boundary coordinates recorded in S1, automatically crop or calibrate the weld seam main area, and only convert the pixels in this area to avoid background transmission light interference with the gray distribution; a "backlight mode" identifier should be added to the parameter record to distinguish between general transmission / diffuse reflection acquisition; In the production line or field application environment, this gray conversion module can also be integrated into an automated detection system; the system can read acquisition parameters in real time and dynamically adjust the channel merging coefficient or exposure compensation coefficient, for example, if the humidity is higher than 60% and the temperature is higher than 30°C, a humidity or thermal expansion compensation coefficient (such as multiplying by 0.98) is applied to the channel value before merging to correct the deviation caused by material state changes on the gray response; the conversion program should be optimized to respond within milliseconds to adapt to the production rhythm of film structure weld seam detection; in batch processing scenarios, the average gray distribution of different angle images of the same weld seam after gray conversion can be performed to improve the robustness of gradient identification; In addition, when processing large weld images (such as width exceeding 1000 pixels or length view exceeding 1 meter), the method supports image block merging process: the original image is divided into several sub-blocks (such as 512x512 pixel blocks), each block independently performs channel merging, normalization, and verification process, and then spliced into a whole gray-scale image in sequence. The splicing process requires that the adjacent blocks overlap at least 30%, and the seam error is corrected through feature matching or histogram matching in the overlapping area of the sub-blocks to ensure the continuity of the overall gray-scale change without interruption due to block boundaries; after the sub-block processing is completed, the whole gray-scale image and the associated conversion log are generated.
[0022] S3: Analyze the thickness gradient distribution in the gray-scale image, identify the continuous change of gray-scale caused by the uneven thickness area, adjust the gray-scale value using segmented mapping, balance the contrast of the gradient transition area, and generate the adjusted gray-scale image. The specific implementation is as follows: First, load the single-channel gray-scale image output by S2 into the image processing system; the image has a unified data format and is accompanied by its acquisition parameters (such as exposure time, gain value, light source intensity, device position coordinates, etc.); the system reads these parameters to assist in the initial scanning of the image, such as confirming whether the gray-scale value covers the complete range of 0 to 255, and detecting whether there is a saturated or low overall response; the initial loading logic ensures seamless connection between the analysis starting point and the conversion stage, ensuring that image information is not lost or distorted due to previous processing; In the analysis stage, the thickness gradient distribution in the gray-scale image is scanned globally; the processing logic starts from the weld area of the image, traverses the pixel values row by row or column by column along the length direction of the weld (or according to the preset coordinates), and identifies the spatial variation pattern of the gray-scale value; for example, in the image of the lap joint part, a gradual transition from the thick part (lower gray-scale) to the thin part (higher gray-scale) can be observed, which reflects the physical characteristics of the material thickness; during the scanning process, the image can be divided into multiple horizontal strips (for example, each strip is set to 10 pixels wide), and the gray-scale mean and variance of each strip are calculated to generate a gradient curve related to the thickness; in addition, the previous thickness measurement results (such as the thickness gradually changing from 1 mm to 1.5 mm) can be used as a physical reference to preferentially focus on the corresponding gray-scale slope change section to enhance the physical relevance of the analysis; The continuous change of gray scale caused by the uneven thickness area is identified, which can be achieved by extracting the pixel value sequence along the center line of the weld, and observing the continuous increasing or decreasing paragraphs in the sequence. If the length of a paragraph exceeds the preset threshold (for example, 20 pixels) and the gray scale change trend is smooth (rather than jumping), it is marked as a "continuous change area". In the identification process, multiple vertical profiles can also be extracted from the weld edge to the center, and the gray scale profiles of each profile are compared. If multiple profiles show similar change trends, it is confirmed that the area is a gradient area caused by thickness change. Cross-validation logic can avoid false positives of isolated noise or reflection points, and with the help of the gray scale distribution maintained by S2, it can ensure the capture of subtle changes (for example, the gray scale fluctuation amplitude can be controlled within 0.05 relative units). After identifying the gradient area, the segmentation mapping adjustment phase is entered. The processing logic first divides the weld gray scale image into several sub-sections (for example, low gradient section, medium gradient section, high gradient section) according to the gradient profile, each section reflecting a different thickness gradient level. The segmentation standard can be based on the gray scale change rate (for example, pixels per unit distance with a gray scale rise rate below a certain threshold T1 are classified as a low gradient section, between T1 and T2 as a medium gradient section, and above T2 as a high gradient section, where T1 and T2 are the gray scale change rates in the image). Within each sub-section, the gray scale values are mapped using linear stretching or compression. For example, for a certain low-contrast paragraph, its pixel gray scale range is originally 50-100, which can be mapped and expanded to 30-120, thereby improving the contrast in the area. For thin sections, the low gray scale valley can be expanded and the thick section peak can be moderately compressed, so that the overall gray scale distribution is more balanced. The relative order of the pixels in the section is strictly maintained during the mapping process to ensure that the adjusted gray scale image still accurately reflects the original thickness information. This mapping is completely based on the statistics (such as mean, extreme value) within the sub-section and does not introduce external data. In order to further improve the visualization effect and identification performance of the transition area, a contrast balancing logic for the gradient transition area is also included. This logic is based on an iterative mapping mechanism: first, a preliminary mapping is performed on all identified continuous change areas; then, a global histogram analysis (such as entropy value, gray scale distribution smoothness) is performed on the adjusted image; if the entropy value is lower than the preset expected value (for example, 4.5 bits), or the gray scale distribution is still blurred, the sub-section with the steepest gradient change is selected as the target for secondary mapping; in the secondary mapping, local stretching logic is applied to the sub-section: according to the gray scale mean value of its neighborhood, the pixel value is offset to increase the gray scale difference by at least 20%, but to avoid distortion to non-gradient sections. This iteration is performed at most three times to balance efficiency and effectiveness. The gray scale blurred boundary at the thick-thin junction of the lap weld can be economically and effectively sharpened, enhancing the boundary locking ability of subsequent region segmentation. After the adjustment is completed, the final grayscale image output is generated; the pixel segments adjusted by each sub-section are spliced back to the original image coordinate system, and the size and position thereof remain consistent with the original grayscale image; the output image is accompanied by a mapping log, such as the adjustment coefficient of each sub-section, the response section position, the application times, etc., which are embedded in the image file in the form of metadata or accompanied by a JSON / XML format log file; if a large weld (such as a width exceeding 1000 pixels or a length exceeding 1 meter) is processed, the image blocking technology can be used: the original image is divided into several 512x512 pixel sub-blocks, each block independently performs identification, segmented mapping and verification, and is spliced and reconstructed into an overall output; when splicing, adjacent sub-blocks are required to overlap by at least 30%, and the joint error is corrected through overlapping area feature matching or histogram matching to ensure that the gradient continuity is not interrupted due to blocking; To adapt to industrialization or real-time detection systems in the field, the analysis and processing can also be integrated into a pipeline environment: the system can read the grayscale image and its acquisition parameters in real time, and adjust the identification threshold and mapping coefficient according to dynamic conditions such as humidity, temperature, light intensity, etc.; for example: if the system detects that the humidity is higher than 60% and the temperature is higher than 30°C, a compensation coefficient (such as 0.98) is multiplied by all sub-section pixel values before mapping to correct the grayscale shift caused by material thermal expansion; the overall processing logic can be executed in multiple threads: one thread performs gradient zone identification, and the other thread implements mapping adjustment, so that the delay is reduced to milliseconds, thereby meeting the production rhythm requirements; in a laboratory environment, the grayscale profile before and after adjustment can be compared to verify the gradient recognition and mapping effect, thereby enhancing the reliability of the method; In terms of material type differences, adaptive logic is included; for high-reflectivity PVC film, low-pass filtering or median filtering is preferentially applied to remove high-frequency reflection noise, and then the identification and mapping process is performed; for semi-transparent PTFE film, the foreground area of the weld should be preferentially isolated, the background transmission interference should be skipped, and a backlight mode identifier should be added to the labeling parameters; when identifying a continuously changing area, if an isolated noise point is detected, the system can apply neighborhood smoothing processing (such as 3x3 window averaging) before extracting the sequence to reduce mislabeling; for extreme gradient areas with a thickness difference exceeding 1 millimeter, the mapping logic can select curve segmentation (non-linear linear mapping), which is more consistent with the natural variation of the film structure gradient.
[0023] S4: Based on the adjusted grayscale image, region segmentation is performed to separate the weld area and the non-weld area, the specific range of the lap weld is locked using boundary tracking logic, and the boundary coordinates of the separated areas are marked, which is specifically implemented as: Firstly, the gray-scale image output by S3 is loaded into the processing system, and its mapping log (including the mapping coefficients of each sub-section, the paragraph position, the device acquisition coordinates, the scaling ratio, etc.) is read; the system uses these parameters for initial scanning to confirm whether the overall distribution of the image after gray-scale equalization has improved the edge contrast of the lap joint part as expected, ensuring seamless connection between the segmentation starting point and the previous adjustment stage; After loading, the first stage is entered: preliminary separation of the weld area and the non-weld area. The system globally traverses the gray-scale image, calculates the gray-scale mean value of the entire image as the initial segmentation reference, and then compares the pixel gray-scale value: points with a gray-scale value higher than the mean value are preliminarily classified as the film material background area (non-weld area), and pixels with a value lower than the mean value are preliminarily marked as the weld candidate area. The threshold-based comparison logic adapts to the feature of increased light absorption and lower gray-scale caused by the thickness overlap of the lap weld. In order to avoid edge blurring caused by gradual thickness change, dynamic adjustment logic is used: the threshold value can be appropriately reduced in sections with significant gradient changes (according to the gradient profile in S3); for example, the gray-scale threshold is lowered by about 10% at the thick-thin junction to ensure that the continuous transition area is also included in the weld candidate mask; this ensures that the gradual change area is not misclassified as the background, while maintaining the purity of the background film area, forming a binary-like mask. Then, the second stage is entered: boundary tracking and main area locking of the lap weld. The edge navigation is performed on the preliminary weld candidate mask, and the scanning starts from the preset starting point (such as the upper left corner of the image) to the first boundary pixel encountered, and the clockwise or counterclockwise tracking logic is started. During the tracking process, the gray-scale difference of adjacent pixels is judged: if the gray-scale difference between adjacent pixels is less than a preset value (for example, 5 gray-scale units) and the pixel connectivity meets the 8-neighborhood or 4-neighborhood, the boundary path is extended. The continuity judgment adapts to the lap weld of flexible film structure, as its boundary is mostly linear or slightly curved, and the gray-scale changes smoothly along the boundary. If a branch (such as a side crack extension) is encountered, the system preferentially identifies the main weld path and marks it as a primary boundary, and marks the branch path as a secondary sub-area, to ensure the complete locking of the main lap range. After the tracking is completed, a closed polygon contour is generated, covering the weld area from the lap starting point to the end point. The third stage is boundary coordinate labeling and calibration. For the locked contour, the key node coordinates are extracted, including the inflection points and equidistant sampling points, to form a list of (x, y) coordinate pairs. The region center coordinates and bounding box parameters (minimum x, maximum x, minimum y, maximum y) are also recorded. If the grayscale image has scaling or acquisition proportion offset (based on the device position coordinates or scaling ratio recorded in S1), the system will multiply the coordinates by the corresponding scaling factor to calibrate them to the actual physical size (e.g., millimeters or centimeters). The coordinate labeling also includes hierarchical information: the first level represents the main weld boundary, and the second level represents sub-cracks or auxiliary lap zones. All labeled records are saved in JSON or XML format and embedded in the image metadata. This structured labeling provides high-precision input for subsequent edge feature extraction. In addition, the system also considers various expansion and adaptation mechanisms when implemented. For image noise effects, the system performs neighborhood consistency checks before initial thresholding: only when more than a certain percentage (e.g., 75%) of pixels in a pixel neighborhood are consistent in class, the classification result is confirmed, thereby improving robustness. The boundary tracking logic introduces a direction prediction mechanism for curved welds: based on the distance and direction vector of the last few boundary pixels, the next candidate point is predicted to avoid deviating from the main path in grayscale fluctuation areas. If the weld has a grayscale interruption (e.g., due to material folding or reflection causing abnormal grayscale areas), a bridging logic is used: when the gap is less than, for example, 10 pixels, linear interpolation is performed to connect adjacent boundary segments, thereby avoiding split misjudgment. The system is adapted for different material types and application scenarios. For images of high-reflective PVC membranes, high-frequency reflection filtering logic can be used during initial separation: low-pass filtering is applied to the background flat area to reduce false edges before segmentation. For semi-transparent PTFE membranes, due to significant background transmission interference, the system prioritizes cropping the main weld area, excluding the background, and then performing segmentation and labeling. For large membrane structure welds (length exceeding 1 meter or width exceeding 1000 pixels), the system uses a hierarchical execution: global coarse separation is performed first, and then fine tracking is performed in the sub-region to improve processing efficiency. For outdoor detection scenarios, if the acquisition parameters indicate unstable lighting or significant environmental changes, a global grayscale compensation coefficient is applied before segmentation to stabilize the background baseline. In actual integrated applications, the segmentation module can be embedded in an automated detection system, connected with imaging devices, grayscale conversion modules, and defect recognition modules. The output image and mapping log from step S3 are received, real-time segmentation and coordinate output are performed, and the coordinate results are transmitted to the control system or database, supporting robot arm positioning, automatic defect labeling, or report generation. The software process is designed as multi-threaded: one thread performs thresholding, one thread performs boundary tracking, and one thread performs coordinate labeling to reduce latency to tens of milliseconds. For laboratory scenarios, the automatic labeling coordinates are compared with the manual labeling results to evaluate the locking accuracy, facilitating subsequent module invocation and audit tracking.
[0024] S5: In the isolated weld area, the edge features of potential defects are extracted, the gray abnormal points are located using continuous pixel comparison, the defect candidate area is formed, and the pixel range of each candidate area is recorded. The specific implementation is as follows: Firstly, the adjusted gray image output by S4 and the corresponding boundary coordinates, bounding box parameters and other information are loaded; the minimum x, maximum x, minimum y and maximum y coordinates recorded in the bounding box are read for image cropping, only the pixels inside the weld overlap area are retained to eliminate the interference of non-weld background, and the starting point of the extraction logic is seamlessly connected with the previous segmentation result, so that false detection caused by external area pixels is avoided; After cropping, enter the edge feature extraction stage; traverse the weld area pixel grid row by row, for each pixel, obtain its gray value and the gray values of the pixels in its neighborhood, and calculate the absolute difference value between the center pixel and the neighborhood pixels; when the difference value exceeds the preset threshold (for example, 10 gray units, which can be adjusted according to the specific material and acquisition parameters), the center pixel is marked as an "edge point"; this neighborhood comparison logic is based on the common edge detection principle in industrial image processing, which distinguishes gray level change areas to lock in crack, porosity and other defect signs; in addition, since the gray level change at the thick-thin junction has been enhanced by gradient mapping in the previous step, the identification of edge points is more reliable, thereby improving sensitivity and reducing background false detection; Next, the system performs continuous pixel chain analysis to locate the gray abnormal point sequence; the pixel value sequence is extracted along the weld length direction or along the image center line, and the continuous increasing or decreasing trend sequence is determined; if the length of a sequence reaches a preset number of pixels (for example, three or more consecutive pixels) and the gray level change direction remains the same, the sequence is located as an "abnormal point group"; then, the lateral expansion profile verification is performed: for the abnormal point group, the system extracts the transverse pixel chain in its left and right neighborhood, and if the transverse pixel difference also meets the abnormal trend, the point group is combined as a defect candidate center; the continuous pixel chain logic is suitable for the unequal thickness flexible film structure, as the thickness change at the overlap or internal porosity usually exhibits continuous gray level change rather than isolated points, thereby improving the positioning accuracy; On the basis of all the located abnormal points, enter the candidate area formation stage; according to the distance and spacing relationship, the abnormal points are aggregated: when the horizontal or vertical spacing between two abnormal point groups is less than a preset number of pixels (for example, 3 pixels), the system bridges them as a common candidate area; when multiple subgroups are close and the spacing is small, they are combined into a closed candidate area; this bridging logic takes into account the characteristics that flexible material weld defects may be distributed in a network or in series; finally, the system outputs several candidate areas, each area covering a group of abnormal points and their expanded neighborhood; each candidate area corresponds to a gray abnormal area that may be caused by thickness change or overlap stress concentration, matching the high-risk inspection area; After the candidate region is output, the system records the pixel range and coordinate information of each region; for each candidate region, its boundary nodes are extracted and the minimum enclosing rectangle is calculated, the coordinates of the upper left corner (x1, y1) and the lower right corner (x2, y2) are recorded, and the total number of pixels in the region and the center coordinates (xc, yc) are recorded; if the image is detected to have a scaling or sampling ratio factor (according to the device position coordinates recorded by S1 or the pixel-physical unit conversion ratio), the system automatically converts the pixel coordinates to standard physical size units (such as millimeters or centimeters); in addition, to support subsequent priority processing, each candidate region also records the density of abnormal points and marks the priority (such as high / medium / low) based on the density; all candidate region information is saved in a structured format (such as JSON or XML) and embedded in the image metadata or a separate log file; this recording logic not only ensures that the defect candidate region is traceable, but also facilitates defect classification, physical positioning, and report generation; The preset threshold values used (such as: gray difference 10 units, continuous pixel number 3 points, bridge spacing 3 pixels) are not randomly set; first, select several typical lap weld samples in the initial stage, covering the thickness range (such as film thickness 0.5mm to 2mm, lap overlap layer 1mm to 3mm), and complete the S1 to S4 process in the acquisition system; then, statistical analysis is performed on the gray scale images generated by these samples: including gray scale histogram distribution, neighborhood gray scale jump amplitude, continuous pixel chain length, etc. Based on histogram analysis, automatic threshold selection techniques can be used to identify the dividing point between the low gray scale group and the high gray scale group in the image gray scale distribution; then, taking the manually labeled defect position as a reference, compare the automatically generated threshold with the gray scale jump amplitude, defect point continuous length, and neighborhood expansion range in the real defect; through this verification, empirical threshold values such as: gray difference greater than about 10 units, continuous pixel chain length ≥ 3 pixels, abnormal point group spacing less than about 3 pixels can be obtained; subsequently, to adapt to different film structure materials, thickness variation range, and different acquisition parameters (such as light source intensity, exposure time, gain value), the above empirical threshold values can be set as adjustable ranges; for example: the gray difference threshold value can be adjusted between 8-15 units; the continuous pixel number can be adjusted between 2-5 pixels; finally, in the actual detection system, this threshold setting process is embedded in the software module, and after the system loads the acquisition parameters of this image (such as light source intensity, ambient temperature, exposure time), it can automatically recommend the initial threshold value for the current image, and if necessary, the operator or the system can fine-tune it through quick verification (such as repeated testing on known defect samples) to form the final threshold value for this weld detection; in this way, the preset threshold values used have statistical basis and can be dynamically corrected, thereby ensuring reliability and applicability in the detection of lap welds of non-uniform thickness flexible materials.
[0025] S6: Classify and verify the defect candidate region, confirm the existence and type of internal defects in combination with edge features and gray scale threshold logic, and output the verified defect information, which is implemented as: Firstly, the system loads the candidate region list generated in step S5, in which each region has recorded parameters such as the upper-left corner coordinate (x1, y1), the lower-right corner coordinate (x2, y2), the center coordinate, the total number of pixels, the abnormal point density, and the priority; according to the recorded coordinate range, the system limits the original gray-scale cropped image in the pixel subset of each candidate region, and peels off the non-candidate background area, so as to ensure that the verification analysis is accurately focused on the target range after extraction, and the external pixel interference is minimized; the cropping and loading logic closely follows the output of step S5, ensuring that the candidate region verification is started from the correct starting point; Then, the system sorts the candidate regions according to the abnormal point density from high to low, and processes the regions with the highest density first; this sorting logic is based on the experience that internal defects such as cracks or pores in the film structure lap weld often distribute in the form of point groups, chains or clusters; for each candidate region, the system extracts the edge point set generated by the edge detection in S5, and constructs these edge points into a connected chain; the system classifies the connected chain into three categories according to the geometric shape: if the chain extends in the form of a slender straight line or slightly curved, it is initially judged as a crack-type defect; if the chain is closed into a ring structure, it is initially judged as a pore-type defect; if the chain is scattered or distributed in the form of a net, without obvious extension or closure characteristics, it is judged as a scattered / net-type defect; on this basis, the system also collects the gray-scale statistical features of the candidate region (including the gray-scale mean, the gray-scale variance, and the edge point gray-scale distribution) as auxiliary judgment basis, forming an integrated classification logic of edge geometric features and gray-scale numerical features, so as to improve the verification accuracy in the face of the complex gray-scale behavior of thickness superposition, light absorption change and light transmission change in the lap weld of flexible materials with different thicknesses; At the same time, the method sets a gray-scale threshold logic to support the judgment of the existence and type of defects; specifically, the system determines the preliminary gray-scale threshold by multiplying the overall gray-scale mean of the image corresponding to the candidate region by a certain coefficient (for example, 0.8); if the gray-scale values of most edge points in the candidate region are lower than the threshold, the system strengthens the possibility that the region has defects; in addition, the threshold is adjusted according to the thickness gradient profile identified in step S3: in the section with a high thickness gradient, the system appropriately reduces the threshold (for example, from 0.8 to 0.7 or lower) to include the gray-scale gradual change area, because the thickness change may cause continuous gray-scale change; while in the low-gradient area of the thin part, the ratio can be maintained or slightly increased to enhance the discrimination ability; this dynamic adjustment mechanism ensures that the threshold is neither too sensitive to cause false positives, nor too conservative to cause false negatives; In combination with the gray threshold judgment and edge shape classification, the final confirmation logic is implemented for each candidate region: when the edge point ratio (i.e., the number of edge points / the total number of pixels in the candidate region) in a candidate region exceeds a predetermined ratio (for example, 30%) and the gray value is generally lower than the threshold value, the system confirms that the region has a defect; then, according to the classification as a crack, a pore or a scattered point defect, the type is specifically marked; for example: if a linear chain length ≥ 20 pixels and a width ≤ 3 pixels are detected, and the gray value is lower than the threshold value, it is marked as a crack; if the number of closed chain nodes ≥ 6 and the maximum diameter ≤ 10 pixels, it is marked as a pore; if the scattered point density is high, the chain is discontinuous but the overall anomaly, it is marked as a mesh / scattered point defect; the category determination also refers to the thickness difference parameter recorded in step S1: when the sample thickness difference is large (such as superimposed by more than 2 mm), the verification logic is more inclined to internal defects (such as pores, interlayer cavities) rather than surface cracks; in order to prevent false positives, if the gray anomaly but the edge point chain is discontinuous or the number of points is insufficient, the candidate region is marked as "unconfirmed defect" state, thereby forming a rigorous and traceable verification judgment mechanism; In addition, the system supports multi-candidate region merging logic: if two or more adjacent candidate regions show similar defect types, close boundaries (for example, the right bottom / left top coordinate distance of their enclosing rectangles is less than 3 pixels) and similar abnormal point densities, they are merged into a larger defect region to avoid splitting an actual defect into multiple outputs; and all confirmed defects are output in a structured report form, each report data item contains: defect number, type, existence state (True / False), pixel range (x1, y1, x2, y2), center coordinates, total number of pixels, number of abnormal points, abnormal point ratio, severity score (for example, High / Medium / Low), related assets such as original image link and acquisition parameters for traceability; the report adopts JSON or XML format, which is convenient for system storage, display and subsequent analysis; the output data not only contains the verification defect information, but also retains the complete data chain of the acquisition, conversion, analysis, extraction and verification process, ensuring the traceability from the original image to the final defect list, which is convenient for manual review and engineering application.
[0026] The scheme of the embodiment firstly, in the detection initial stage, the original image of the weld is collected by using the imaging device with fixed position, ensuring the complete view covering the lap joint part, and recording the collection parameters, providing reliable basic data for subsequent steps; then, the original image is converted to gray scale, unifying the multi-channel data into single-channel format, while keeping the original distribution of pixel values, to simplify the analysis and retain the thickness gradient information; this conversion directly prepares the image for thickness gradient distribution analysis, in which the gray scale continuously changing area is identified, the value is adjusted by piecewise mapping to balance the contrast, and the optimized gray scale image is generated, thereby improving the accuracy of subsequent processing; based on the adjusted image, further region segmentation is carried out to separate the weld and non-weld regions, and the specific range is locked by boundary tracking, and the coordinates are marked to accurately position the target area; this segmentation locks the extraction range, and the potential defect edge features are extracted in the weld area, the gray scale abnormal points are located by continuous pixel comparison, the defect candidate area is formed, and the pixel range is recorded to support verification; finally, the candidate area is classified and verified, the defect type is confirmed by combining the edge feature and gray scale threshold logic, the verification information is output, and the whole process data is integrated to complete the detection.
[0027] It should be noted that the present application can be deployed in the device itself to realize embedded application, or run on PC terminal or other terminal with user interface, so as to meet various hardware environments and use requirements.
[0028] The above embodiments can be realized by software, hardware, firmware or any combination thereof, in whole or in part. When realized by software, the above embodiments can be realized in the form of computer program product in whole or in part. The computer program product includes one or more computer instructions or computer programs. When the computer instructions or computer programs are loaded or executed on the computer, the processes or functions described in the embodiments of the present application are generated in whole or in part. The computer can be a general-purpose computer, a special-purpose computer, a computer network or other programmable devices. The computer instructions can be stored in a computer readable storage medium or transmitted from one computer readable storage medium to another, for example, the computer instructions can be transmitted from one website, computer, server or data center to another website, computer, server or data center through wireless or wired direction; the wired transmission mode includes optical fiber, twisted pair, coaxial cable, etc.; the wireless transmission includes infrared, microwave, etc. The computer readable storage medium can be any available medium that can be accessed by the computer or a data storage device such as a server, data center, etc. containing one or more available medium collections. The available medium can be magnetic medium (for example, floppy disk, hard disk, magnetic tape), optical medium (for example, DVD), or semiconductor medium. The semiconductor medium can be solid state disk.
[0029] Those skilled in the art can clearly understand that, for the convenience and brevity of description, the specific working process of the system, device and module described above can refer to the corresponding process in the foregoing method embodiments, and will not be repeated here.
[0030] In the embodiments provided in the present application, it should be understood that the disclosed system, device and method can be implemented in other ways. For example, the device embodiments described above are only schematic. The division of the modules is only a logical function division. There can be another division manner in actual implementation. For example, a plurality of modules or components can be combined or integrated into another system, or some features can be ignored or not executed. In addition, the displayed or discussed coupling or direct coupling or communication connection between the modules can be indirect coupling or communication connection through some interfaces, devices or modules, and can be electrical, mechanical or other forms.
[0031] The modules described as separate components can or can not be physically separate, and the components displayed as modules can or can not be physical modules, which can be located in one place or distributed on a plurality of network modules. Some or all of the modules can be selected according to actual needs to achieve the purpose of the embodiment.
[0032] In addition, each functional module in the embodiments of the present application can be integrated into a processing module, or each module can exist physically independently, or two or more modules can be integrated into one module.
[0033] If the functions are realized in the form of software function modules and sold or used as independent products, they can be stored in a computer readable storage medium. Based on this understanding, the technical solutions of the present application essentially or the part of the prior art or the part of the technical solutions can be embodied in the form of a software product. The computer software product is stored in a storage medium and includes a plurality of instructions for causing a computer device (which can be a personal computer, a server or a network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of the present application. The foregoing storage medium includes: a U disk, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk, and various program codes that can be stored in the medium.
[0034] The above merely provides the specific implementation of the present application, but the protection scope of the present application is not limited to this. Any person skilled in the art can easily think of the changes or replacements within the technical range disclosed by the present application, which should be included in the protection scope of the present application. Therefore, the protection scope of the present application should be subject to the protection scope of the claims.
[0035] Finally, the above merely provides the preferred embodiments of the present application, but is not used to limit the present application. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present application should be included in the protection scope of the present application.
Claims
1. An image recognition-based film structure weld defect detection method, characterized by, Comprising: S1: Collecting the original image of the unequal-thickness flexible material lap weld, using a fixed-position imaging device to obtain a complete view of the weld area, covering the overall appearance of the lap joint, and recording the acquisition parameters of the image; S2: Gray scale conversion is performed on the collected original image, color or multi-channel image is converted to single-channel gray scale image, image data format is unified, and original distribution of pixel value is maintained; S3: Analyzing the thickness gradient distribution in the gray scale image, identifying the continuous change of gray scale caused by unequal thickness area, adjusting the gray scale value using segmented mapping, balancing the contrast of gradient transition area, and generating the adjusted gray scale image; S4: Based on the adjusted gray scale image, region segmentation is performed to separate the weld area from the non-weld area, using boundary tracking logic to lock the specific range of lap weld, and marking the boundary coordinates of the separated area; S5: In the separated weld area, the edge features of potential defects are extracted, the gray scale abnormal points are located using continuous pixel comparison, the defect candidate area is formed, and the pixel range of each candidate area is recorded; S6: Classification verification is performed on the defect candidate area, combining edge features and gray scale threshold logic to confirm the existence and type of internal defects, and outputting the verified defect information.
2. The method of claim 1, wherein the method further comprises: The original image of the unequal-thickness flexible material lap weld is collected, a fixed-position imaging device is used to obtain a complete view of the weld area, covering the overall appearance of the lap joint, and the acquisition parameters of the image are recorded, including: Preliminary evaluation of the lap weld area is performed, thickness difference is measured by contact or non-contact thickness gauge, superimposed layer thickness is identified, camera exposure and light source adjustment are guided; High-resolution industrial camera is used, equipped with wide-angle lens, fixed on bracket or mechanical arm, installed above or beside the weld, distance is adjusted and center line is aligned; Complete view is obtained, covering the weld and both sides of the buffer area; Diffuse reflection light source is used to reduce surface reflection, light intensity and environmental temperature and humidity are controlled; In calibration, gray card is used to adjust exposure, uncompressed format image is stored, parameters and environmental factors are recorded, and structured file is used for associated storage; In automated detection, the device moves along the weld path, and the position is recorded synchronously.
3. The method of claim 1, wherein the method further comprises: Gray scale conversion is performed on the collected original image, color or multi-channel image is converted to single-channel gray scale image, image data format is unified, and original distribution of pixel value is maintained, including: Based on the collected original image, gray scale conversion is performed on the color or multi-channel image, red, green and blue channels are merged into a single gray scale value after channel structure check, and the coefficient is calibrated according to the acquisition parameters; The pixel value range is standardized to the gray scale spectrum, while the original pixel relative distribution is maintained; Histogram verification is performed, and the merging coefficient is adjusted again in the deviation area of the distribution curve; The gray scale image is saved in lossless format, and the acquisition parameters are embedded through metadata; Different film materials are implemented with adaptive logic, pre-filtering operation is applied to the channel separation stage for high-reflective surfaces, and semi-transparent materials preferentially isolate the weld foreground area; Integrated into the automated system, read parameters to dynamically adjust compensation coefficient; In large image processing, merging and verification process is performed in blocks, and adjacent blocks are overlapped and spliced.
4. The method of claim 1, wherein the method further comprises: Analyzing the thickness gradient distribution in the grayscale image, identifying the continuous change of gray value caused by the uneven thickness area, adjusting the gray value by segmented mapping, balancing the contrast of the gradient transition area, and generating the adjusted grayscale image, including: Load the converted grayscale image into the processing system, read the acquisition parameters to assist in scanning, and verify the gray value coverage range; Scan the pixels row by row along the weld path, divide the strips to count the gray characteristics, and construct the thickness gradient curve; Identify the gray continuous change area through pixel sequence trend analysis, supplemented by profile verification to confirm the thickness gradient influence; Process the image by segmenting according to the change rate, and adjust the gray value of each segment; Optimize the gray distribution in the transition area through multiple mappings; Generate the adjusted image by splicing, and save the mapping parameters to the metadata; Adjust the mapping strategy dynamically according to environmental conditions, and perform specific preprocessing or compensation operations for different film materials.
5. The method of claim 1, wherein the method further comprises: Based on the adjusted grayscale image, perform region segmentation to separate the weld area from the non-weld area, use boundary tracking logic to lock the specific range of the lap weld, and mark the boundary coordinates of the separated areas, including: Load the adjusted grayscale image, read the mapping log to assist in scanning; Separate the weld and non-weld areas, calculate the gray mean value as the reference by global traversal, compare and classify pixel by pixel, and dynamically adjust the threshold; Based on the separation mask, perform boundary tracking, navigate from the starting point, expand the path based on the adjacent gray difference, lock the main weld path and mark the sub-area, and generate a closed contour to cover the lap range; Perform neighborhood consistency check to confirm the classification, introduce direction prediction tracking points for curve welds, and bridge the disconnected gray area to connect the boundary.
6. The method of claim 5, wherein the method further comprises: Including: Mark the boundary coordinates, extract the key node coordinates and bounding box parameters; Calibrate to physical dimensions based on acquisition parameters, label the main weld as level one and the sub-area as level two, and embed the metadata in a structured format; Adapt to high-reflective films by applying reflection filtering, and trim the main area for translucent films; Layered execution of coarse and fine separation for large welds; Apply gray compensation to stabilize the baseline for outdoor scene applications; Integrate an automated system to output coordinates in real time to support positioning and reporting, and perform threshold judgment, tracking, and labeling in multiple threads.
7. The method of claim 1, wherein the method further comprises: In the separated weld area, extract the edge features of potential defects, locate the gray abnormal points using continuous pixel comparison, form defect candidate areas, and record the pixel range of each candidate area, including: Load the separated weld area image and boundary coordinates, and crop the image using the bounding box parameters; Traverse the pixel grid row by row, obtain the pixel and its neighborhood gray value, and calculate the absolute difference to mark the edge points; Perform continuous pixel chain analysis, extract the sequence along the weld direction, determine the consistent sequence as an abnormal point group, and expand the profile verification to the side to merge the two-dimensional area; Aggregate adjacent abnormal point groups to form closed candidate areas through bridging logic; Adapt to different materials, apply noise filtering on high-reflective surfaces, and preferentially isolate defect foreground in translucent areas.
8. The method of claim 7, wherein the method further comprises: Including: Record the pixel range of the candidate area, extract the boundary nodes to calculate the bounding rectangle, record the coordinate pairs and center coordinates, and calibrate to physical dimensions based on acquisition parameters; Label the abnormal point density and embed the metadata in a structured format; Through sample statistical analysis of gray scale distribution and defect position, threshold is set, automatic selection of demarcation point, combined with acquisition parameters dynamic calibration range; In batch processing, hierarchical execution of extraction and recording.
9. The method of claim 1, wherein the method further comprises: The classified verification of the defect candidate area, combined with the edge feature and the gray threshold logic, confirms the existence and type of internal defects, and outputs the verified defect information, including: Load the candidate area list, crop the gray scale image according to the coordinate range, limit the pixel subset and strip the background area; According to the abnormal point density sorting, the high density area is processed preferentially, the edge point set of each area is extracted and the connected chain is constructed, and the classification is made according to the geometric shape; Collect gray scale statistical characteristics, integrate edge geometry and gray scale values for classification; Set the gray scale threshold logic to determine the initial threshold value with the area mean value coefficient; Combined with threshold judgment and edge morphology, confirm the existence according to the proportion of edge points, and mark the type; Merge adjacent similar candidate areas into larger areas; Output structured report, including defect number, type, existence state, pixel range, center coordinates and statistical parameters, saved in JSON or XML format, and embedded with acquisition parameters.
Citation Information
Patent Citations
A method for detecting surface defects in laser-welded plates of unequal thickness
CN102279190A
Method for identifying defects of industrial x-ray weld joint image
CN103914838A
Calibration digital imaging detection method for long-focus transillumination sensitivity of tube plate thick weld DR
CN109932375A
Film surface defect detection system and method
CN115629079A
High-voltage line insulator coating thickness measuring device and application method thereof
CN116804531A
Cited By
Method and system for detecting small cracks of roof wall of house
CN121437495A
Image processing system and method for circumferential weld DR detection data
CN121544626A
An image processing system and method for DR inspection data of circumferential welds
CN121544626B
Method and system for automatically detecting thickness of zinc layer of galvanized steel pipe
CN121677635A
Metal foil surface defect detection system and method
CN121703123A