Welded steel plate surface quality detection system and method based on PLC

By controlling the light source and camera to enter the pre-acquisition state after the PLC receives the signal of the steel plate approaching, and continuously acquiring and generating position marks, the problem of small defects not being effectively identified in the existing technology of welded steel plate inspection is solved, and higher detection accuracy and reliability are achieved.

CN122631656APending Publication Date: 2026-08-25YANGZHOU NINGXING MATERIAL TECHNOLOGY CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202610804720.6
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-06-05
Publication Date
2026-08-25

AI Technical Summary

Technical Problem

In high-speed conveying scenarios, existing PLC-controlled welding steel plate inspection methods may encounter defects such as small cracks, pinholes, or short scratches that have already passed the optimal imaging area before or after the acquisition is triggered. This results in normal brightness in the acquired image, but the defects are not effectively identified, affecting the accuracy and reliability of the inspection.

Method used

After receiving the steel plate approach signal by the PLC, the light source and industrial camera are controlled to enter the pre-acquisition state, continuously acquire images and write them into the ring buffer, generate position marks, and use the buffer locking instruction to extract continuous images before and after the position signal to form a detection image sequence covering the weld seam passing through the optimal imaging area, and perform effective frame screening and multi-frame defect identification.

Benefits of technology

It improves the integrity and stability of surface quality inspection of welded steel plates, reduces the risk of misjudgment caused by single-frame errors, missed shots, and transient interference, and enhances the reliability and traceability of the inspection.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122631656A_ABST
    Figure CN122631656A_ABST
Patent Text Reader

Abstract

The application discloses a welding steel plate surface quality detection system and method based on PLC, belongs to the technical field of welding steel plate detection, and after PLC receives a steel plate proximity signal in front of a detection station, controls a light source, an industrial camera and a collection unit to enter a pre-collection state; the industrial camera continuously collects a welding seam and a steel plate surface area, and writes a collected image into a ring buffer area, and simultaneously generates a position marker; after the PLC receives a steel plate in-place signal, sends a buffer locking instruction; the collection unit extracts continuous images before and after the in-place signal according to the buffer locking instruction and the position marker, and forms a detection image sequence; an image processing unit carries out effective frame screening and multi-frame defect identification, and obtains a defect detection result; the PLC controls alarm, marking, sorting or shutdown according to the defect detection result; and the application can reduce the risk of missing small defects caused by PLC trigger delay.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of welded steel plate inspection technology, and specifically to a PLC-based surface quality inspection system and method for welded steel plates. Background Technology

[0002] During the production of welded steel plates, defects such as cracks, pinholes, scratches, pits, and weld beads are easily generated in the weld seams and on the surface of the steel plates. Existing detection methods typically involve a PLC controlling the activation of a light source, industrial camera, and acquisition device based on the steel plate's arrival signal to acquire images of the weld seam and steel plate surface area, and then judging the surface quality of the steel plate based on the image processing results. However, existing PLCs mostly use a periodic scanning method to execute control logic, and there can easily be a time deviation between the trigger signal and the exposure window of the industrial camera, the illumination window of the light source, and the actual movement position of the steel plate. Especially in high-speed steel plate conveying inspection scenarios, defects such as small cracks, pinholes, or short scratches may have already passed the optimal imaging area before or after the trigger acquisition, resulting in acquired images with normal brightness and complete weld seam contours, but the real defects are not effectively acquired and identified, thus forming hidden missed detections and affecting the accuracy and reliability of welded steel plate surface quality inspection. Summary of the Invention

[0003] The purpose of this invention is to provide a PLC-based surface quality inspection system and method for welded steel plates, in order to address the shortcomings of the prior art.

[0004] To achieve the above objectives, the present invention provides the following technical solution: a PLC-based method for inspecting the surface quality of welded steel plates, comprising: After receiving the proximity signal of the steel plate set at the front of the inspection station, the PLC controls the light source, industrial camera and acquisition unit to enter the pre-acquisition state. In the pre-acquisition state, the industrial camera continuously acquires images of the weld seam and the surface area of ​​the steel plate, and writes the acquired images into the circular buffer in the acquisition order, while generating a corresponding position mark for each frame of image. After receiving the signal that the steel plate is in place, the PLC sends a buffer lock command to the acquisition unit. The acquisition unit extracts continuous images before and after the position signal is generated from the annular buffer according to the buffer locking instruction and the position mark, forming a detection image sequence covering the process of the weld passing through the optimal imaging area; The image processing unit performs effective frame filtering and multi-frame defect identification on the detected image sequence to obtain defect detection results; The PLC controls alarms, marking, sorting, or shutdown based on the defect detection results.

[0005] Preferably, the acquisition unit establishes a circular buffer for temporarily storing acquired images, including: The acquisition unit allocates cyclic write addresses to the ring buffer according to the sequence of continuous frame signals output by the industrial camera, divides the ring buffer into a temporary coverage area and a candidate retention area, writes the acquired images of the weld center texture area that have not yet entered the preset effective acquisition area into the temporary coverage area, and writes the acquired images of the weld center texture area that have entered the preset effective acquisition area into the candidate retention area.

[0006] Preferably, the acquisition unit determines whether the texture area at the center of the weld seam enters the preset valid acquisition area, including the following steps: The acquisition unit selects the search zone through which the weld is expected to pass in the current acquired image and performs grayscale processing on the pixels within the search zone; it determines the candidate columns of weld texture based on the amount of grayscale change of each column of pixels within the search zone; and it determines the area with a continuous column width of 10 to 60 pixels and a continuous column height covering more than 60% of the search zone height as the center texture area of ​​the weld. When the center column coordinates of the texture area at the center of the weld are between 0.30 and 0.70 times the image width, and its vertical coverage height reaches more than 0.50 times the image height, the acquisition unit determines that it has entered the preset effective acquisition area.

[0007] Preferably, generating corresponding location markers for each frame of the image includes: The acquisition unit uses the weld center texture area of ​​the previous frame image as a reference and performs translational comparison within the search band of the current image along the steel plate conveying direction. Calculate the grayscale similarity between the currently acquired image and the previously acquired image at each translation position; When the highest grayscale similarity reaches 0.72, the acquisition unit determines the corresponding translation amount as the texture displacement of the current acquired image relative to the previous frame acquired image; A position marker is generated based on the sequence number of consecutive frame signals, the center column coordinates of the texture region at the center of the weld, the texture displacement, and the corrected sequence number, and the position marker is then bound to the corresponding acquired image.

[0008] Preferably, the acquired image is written to a circular buffer and then cyclically overwritten, including: When the write address of the circular buffer reaches the end, the acquisition unit returns to the starting address to continue writing the acquired image; During cyclic coverage, the acquisition unit first covers the acquired image with the earliest writing time in the temporary coverage area; When there are no addresses to cover in the temporary coverage area, the acquisition unit covers the acquired images whose location markers are discontinuous in the candidate reserved area; When the location markers of the acquired images within the candidate retention area are all continuous, the acquisition unit covers the acquired image with the lowest gray-level similarity.

[0009] Preferably, after receiving the steel plate arrival signal, the PLC sends a buffer lock command to the acquisition unit, including the following steps: The PLC receives the steel plate arrival signal output by the arrival detection element set at the inspection station; The PLC determines that the steel plate proximity signal exists, the pre-acquisition state has been established, the industrial camera is in continuous acquisition state, the acquisition unit is writing the acquired image to the circular buffer, and the detection station is in the detection allowed state. When all conditions are met, the PLC generates a buffer lock instruction containing a lock flag, an arrival confirmation time, the current acquisition frame number, and the current circular buffer write address; The PLC sends a buffer lock command to the acquisition unit, keeping the industrial camera and light source in the pre-acquisition state.

[0010] Preferably, the acquisition unit extracts consecutive images before and after the position signal is generated from the circular buffer according to the buffer locking command and position marker, including the following steps: The acquisition unit matches the current acquisition frame number and the current circular buffer write address in the buffer lock instruction with the position markers of each acquisition image to determine the reference image corresponding to the steel plate arrival signal; The acquisition unit reads the acquired images along the forward and backward directions of the acquisition sequence, with the position mark of the reference image as the center. The acquisition unit retains the acquired images with continuous position markers, continuous texture displacement, and the central texture area of ​​the weld located within the preset effective acquisition area; When the position markers are discontinuous, the texture displacement is discontinuous, or the texture area at the center of the weld seam deviates from the preset effective acquisition area during the reading process, the acquisition unit stops reading in the corresponding direction.

[0011] Preferably, forming a sequence of detection images covering the process of the weld seam passing through the optimal imaging area includes the following steps: The acquisition unit reorders the acquired images retained from the forward and backward reads according to the corrected sequence number in the position markers to form a candidate image chain; The acquisition unit performs grayscale similarity verification on the central texture region of the weld seam in adjacent acquired images in the candidate image chain; When the difference in texture displacement between two adjacent frames is 0 pixels or 1 pixel and the grayscale similarity reaches 0.95, the acquisition unit deletes the acquired image of the next frame. When the grayscale similarity between two adjacent frames is less than 0.72 or the center column coordinate jump of the texture region at the center of the weld exceeds 8 pixels, the acquisition unit deletes the texture fracture image and determines the remaining continuous image as the detection image sequence.

[0012] Preferably, the defect detection results are obtained by performing effective frame screening and multi-frame defect identification on the detected image sequence, including the following steps: The weld center texture region in the detected image sequence is aligned according to the position markers, and images with missing weld center texture regions, abnormal exposure, motion blur, or discontinuous textures are removed to obtain a valid image sequence. Extract the light and dark transition points, edge break points, and local texture anomalies in the central texture region of the weld and the surface regions of the steel plates on both sides of the effective image sequence, and map similar anomalies to the same steel plate location based on the location markers; Connect consecutively occurring anomaly points in adjacent valid images to form defect candidate trajectories, and eliminate transient interference trajectories formed by light source flicker, motion blur, or repeated surface textures. Based on the remaining defect candidate trajectories, the defect type, defect location, and defect range are determined to form the defect detection result. The PLC controls alarms, marking, sorting, or shutdown based on the defect detection result.

[0013] This invention also provides a PLC-based surface quality inspection system for welded steel plates, comprising: The PLC control module receives the proximity signal of the steel plate set at the front end of the inspection station and controls the light source, industrial camera and acquisition unit to enter the pre-acquisition state. The image acquisition and caching module allows the industrial camera to continuously acquire images of the weld seam and steel plate surface area in the pre-acquisition state, and write the acquired images into the circular buffer in the acquisition order, while generating a corresponding position mark for each frame of image. After receiving the signal that the steel plate is in place, the PLC control module sends a buffer lock command to the acquisition unit. The cache backtracking extraction module, the acquisition unit extracts continuous images before and after the position signal is generated from the annular cache area according to the cache locking instruction and the position mark, forming a detection image sequence covering the process of the weld passing through the optimal imaging area; The image processing and defect recognition module performs effective frame filtering and multi-frame defect recognition on the detected image sequence to obtain defect detection results. The PLC executes the control module, and the PLC controls alarms, marking, sorting or shutdown based on the defect detection results.

[0014] The technical effects and advantages provided by the present invention in the above technical solution are as follows: The core technical approach of this invention, which distinguishes it from existing technologies, is as follows: upon receiving a signal indicating the steel plate's approach, the PLC immediately controls the light source, industrial camera, and acquisition unit to enter a pre-acquisition state. This allows the industrial camera to continuously acquire images and write them to the circular buffer before the steel plate is fully in place, instead of waiting for the PLC to receive the arrival signal before triggering a single image capture. Consequently, the PLC's arrival signal is converted into a buffer lock instruction, used to lock and retrieve already acquired images. This solves the problem of small cracks, pinholes, or short scratches missing the optimal imaging area and not being captured when there is a time discrepancy between the PLC's periodic scanning, the camera's exposure window, and the light source's illumination window.

[0015] This invention further generates position markers for each frame of acquired image and extracts the positioning signal based on the buffer locking command and position markers to generate continuous images before and after the acquisition, forming a detection image sequence covering the entire process of the weld seam passing through the optimal imaging area. This method does not simply increase the number of shots, but rather associates the buffered images before and after the trigger according to the actual movement position of the steel plate. This allows the image processing unit to filter valid frames in the continuous images and perform multi-frame defect identification, thereby reducing the risk of misjudgment caused by single-frame errors, missed shots, and transient interference, and improving the integrity, stability, and traceability reliability of welded steel plate surface quality inspection. Attached Figure Description

[0016] To more clearly illustrate the technical solutions in the embodiments of this application or the prior art, the drawings used in the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments recorded in this invention. For those skilled in the art, other drawings can be obtained based on these drawings.

[0017] Figure 1 This is a flowchart of the method of the present invention.

[0018] Figure 2 This is a flowchart of the system modules of the present invention. Detailed Implementation

[0019] To make the objectives, technical solutions, and advantages of the embodiments of the present invention clearer, the technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.

[0020] Example 1, please refer to Figure 1 As shown in this embodiment, the PLC-based surface quality inspection method for welded steel plates includes: After receiving the proximity signal of the steel plate set at the front of the inspection station, the PLC controls the light source, industrial camera and acquisition unit to enter the pre-acquisition state.

[0021] In this invention, the front end of the detection station refers to the pre-detection position located before the formal image detection area of ​​the welded steel plate. This position is equipped with a steel plate proximity detection element for identifying the steel plate's entry status. The steel plate proximity detection element can be a photoelectric sensor, a proximity switch, a laser beam sensor, or a limit detection switch.

[0022] When the welded steel plate is conveyed to the front end of the inspection station by the conveyor roller or conveyor mechanism, the steel plate front edge or the predetermined inspection reference position triggers the steel plate proximity detection element, and the steel plate proximity detection element outputs a steel plate proximity signal to the PLC.

[0023] After receiving the steel plate approach signal, the PLC first performs a validity check on the signal, such as checking whether the signal duration meets the preset requirements, whether the states of the front and rear sensors match, whether the conveying mechanism is in operation, and whether the detection station is idle, in order to avoid the system entering the acquisition process prematurely due to steel plate shaking, reflective interference, or sensor mis-triggering.

[0024] Once the PLC confirms that the steel plate proximity signal is valid, it does not immediately perform the final quality judgment acquisition. Instead, it outputs pre-start control signals to the light source controller, industrial camera, and acquisition unit, respectively, so that the above components enter the pre-acquisition state.

[0025] The pre-acquisition state refers to the state in which the light source, industrial camera, and acquisition unit are in preparation or working condition to continuously acquire images of the weld and steel plate surface.

[0026] The PLC controls the light source controller to illuminate the detection light source or enter a strobe-ready state, ensuring stable illumination of the weld and steel plate surface area. The PLC also controls the industrial camera to load preset exposure time, gain, acquisition frame rate, trigger mode, and region of interest parameters, enabling the industrial camera to continuously image the detection area before the steel plate is fully in place. Furthermore, the PLC controls the acquisition unit to establish or clear the corresponding image buffer space, allowing the acquisition unit to receive and temporarily store the image data output by the industrial camera.

[0027] It should be noted that when the welded steel plate has not yet fully reached the formal inspection position but is already close to the inspection station, the industrial camera and acquisition unit can enter the working state in advance, providing the image data basis for subsequent ring buffer and pre-triggered backtracking acquisition.

[0028] Therefore, when the PLC receives the subsequent steel plate arrival signal, it does not need to start the camera and light source from scratch. Instead, it can directly lock the continuously acquired buffered image, thereby reducing the acquisition lag caused by the PLC scanning cycle, camera start delay or light source response delay, and improving the reliability of capturing small defects on the surface of high-speed conveyed steel plates.

[0029] In the pre-acquisition state, the industrial camera continuously acquires images of the weld seam and the surface area of ​​the steel plate, and writes the acquired images into the circular buffer in the acquisition order, while generating a corresponding position mark for each frame of image.

[0030] In one embodiment of the present invention, after the industrial camera enters the pre-acquisition state, the acquisition unit first allocates addresses to the circular buffer. The circular buffer is set with write addresses according to the sequence of continuous frame signals output by the industrial camera, and after the write address reaches the end, it returns to the starting address to continue writing.

[0031] The circular buffer includes a temporary overlay area and a candidate retention area. The temporary overlay area is used to temporarily store images of the weld center texture region that have not yet entered the preset effective acquisition area, while the candidate retention area is used to store images of the weld center texture region that have already entered the preset effective acquisition area. The total capacity of the circular buffer is determined according to the pre-acquisition time and the industrial camera's acquisition frame rate, that is, the total capacity is the number of images that can be acquired within the pre-acquisition time plus a 20% redundancy. Preferably, the industrial camera's acquisition frame rate is 200 frames / second, the pre-acquisition time is 0.5 seconds, and the total capacity of the circular buffer is 120 frames, of which the temporary overlay area is 80 frames and the candidate retention area is 40 frames.

[0032] After receiving the currently acquired image, the acquisition unit selects the search zone that the weld is expected to pass through in the image and performs grayscale processing on the pixels within the search zone.

[0033] The texture area at the center of the weld is determined by the column-wise grayscale change: for each column of pixels in the search band, the absolute value of the grayscale difference between adjacent pixels is calculated and accumulated to obtain the grayscale change of that column; then the average value and standard deviation of the grayscale change of all columns in the search band are calculated, and the average value plus 1.5 times the standard deviation is used as the texture judgment limit.

[0034] A continuous column whose grayscale variation reaches the texture determination limit is identified as a candidate column for weld texture. When the width of the continuous column is between 10 and 60 pixels and the height of the continuous column covers more than 60% of the search band height, the area corresponding to the continuous column is determined as the center texture region of the weld. The center column coordinates of the weld center texture region are taken as the average of the coordinates of the left boundary column and the coordinates of the right boundary column.

[0035] The preset effective acquisition area is determined based on the image width W and image height H of the industrial camera. The horizontal range is from the column coordinate corresponding to 0.30W to the column coordinate corresponding to 0.70W, and the vertical range is from the row coordinate corresponding to 0.20H to the row coordinate corresponding to 0.80H.

[0036] The acquisition unit determines whether the weld center texture region in the currently acquired image falls within the preset valid acquisition area. When the center column coordinates of the weld center texture region are between 0.30W and 0.70W, and the coverage height of the weld center texture region in the vertical range reaches 0.50H or more, the currently acquired image is written into the candidate retention area. When the above conditions are not met simultaneously, the currently acquired image is written into the temporary coverage area. Through this process, the acquired images stored in the candidate retention area all correspond to welds located in areas with stable imaging quality of the industrial camera.

[0037] Before writing the current image, the acquisition unit also performs continuous offset correction on the weld center texture region in the current image and the previous frame image.

[0038] During calibration, the weld center texture region of the previous frame image is used as a reference. The image is then compared by translation along the steel plate conveying direction within the same search band of the current image, with a translation range of 20 pixels forward and 20 pixels backward. Gray-level similarity is calculated at each translation position. The calculation method is as follows: first, the gray-level average of the two texture regions to be compared is calculated; then, the gray-level values ​​of each pixel are subtracted from the corresponding average value, and the results are multiplied point by point and summed. Finally, this sum is divided by the square root of the sum of the squares of the gray-level differences between the two texture regions. When the gray-level similarity is the highest and reaches 0.72, the corresponding translation amount is determined as the texture displacement of the current image relative to the previous frame image. When the highest gray-level similarity does not reach 0.72, the current image is only written to the temporary coverage area according to the sequence of consecutive frame signals and does not participate in candidate retention.

[0039] The acquisition unit corrects the writing order of the currently acquired images based on the texture displacement. When the absolute value of the difference between the current texture displacement and the texture displacement of the previous frame does not exceed 3 pixels, the adjacent acquired images are considered to have a continuous offset state, and the sequence number of the continuous frame signal, the center column coordinates of the texture region at the center of the weld, the texture displacement, and the corrected sequence number are used together as position markers. The position markers and the corresponding acquired images are written together into the circular buffer.

[0040] When a circular overwrite occurs in the circular buffer, the acquisition unit first overwrites the acquired image with the earliest write time in the temporary overwrite area; if there is no address to cover in the temporary overwrite area, it then overwrites the acquired images with discontinuous position markers in the candidate reserved area; if all position markers in the candidate reserved area are continuous, it overwrites the acquired image with the lowest grayscale similarity value.

[0041] Therefore, when the PLC sends a buffer lock command, the acquisition unit can extract the acquisition images with continuous position markers and weld seams located within the preset effective acquisition area from the annular buffer, providing a stable data foundation for the subsequent formation of the detection image sequence.

[0042] After receiving the signal that the steel plate is in place, the PLC sends a buffer lock command to the acquisition unit.

[0043] In this invention, the steel plate arrival signal is used to indicate that the weld area of ​​the welded steel plate has reached the reference position of the inspection station. The steel plate arrival signal can be output by a photoelectric sensor, proximity switch, or limit detection switch installed at the inspection station. When the welded steel plate arrives at the inspection station during the conveying process, the arrival detection element is triggered by the leading edge of the steel plate, the positioning edge of the steel plate, or the detection reference position corresponding to the weld, and outputs the steel plate arrival signal to the PLC.

[0044] After receiving the steel plate arrival signal, the PLC does not immediately control the industrial camera to take a single frame picture. Instead, it first verifies the steel plate arrival signal. Verification includes checking whether the steel plate proximity signal already exists, whether the pre-acquisition state has been established, whether the industrial camera is in continuous acquisition mode, whether the acquisition unit is writing the acquired image to the circular buffer, and whether the detection station is in an allowable detection state. When all the above conditions are met, the PLC considers the steel plate arrival signal valid. If any of the above conditions are not met, the PLC does not send a buffer lock command and outputs a detection anomaly warning to avoid buffer image lock errors caused by sensor mis-triggers, steel plate reflection interference, or the acquisition unit not being ready.

[0045] After the PLC confirms the validity of the steel plate arrival signal, it generates a buffer lock instruction and sends it to the acquisition unit. The buffer lock instruction instructs the acquisition unit to use the time corresponding to the steel plate arrival signal as a backtracking reference to retain and prepare for the retrieval of the acquired images already written in the circular buffer. The buffer lock instruction includes at least a lock flag, the arrival confirmation time, the current acquisition frame number, and the current circular buffer write address, enabling the acquisition unit to determine the acquisition position corresponding to the generation of the steel plate arrival signal and use this position as the reference for subsequently extracting consecutive images before and after the arrival signal.

[0046] When the PLC sends a buffer lock command, the industrial camera and light source remain in pre-acquisition mode. This allows the acquisition unit to continue receiving and writing images acquired after the arrival signal while simultaneously locking the image before the arrival signal is generated. Thus, the annular buffer retains both the weld images acquired before the steel plate arrives and continues to generate weld images after the steel plate arrives, providing a data foundation for subsequent image sequences covering the process of the weld passing through the optimal imaging area.

[0047] Upon receiving the buffer lock command, the acquisition unit pauses the cyclic overwriting of the buffer address range associated with the arrival confirmation time, and maps the current acquisition frame number and the current circular buffer write address in the buffer lock command to the position marker bound to each of the aforementioned acquired images. Through this mapping, the acquisition unit can determine the reference image located in the circular buffer when the arrival signal is generated, and extract continuous images by tracing back and extending forward using this reference image as the center.

[0048] It should be noted that the PLC's steel plate arrival signal is no longer used as the sole trigger signal for taking pictures, but rather as a locking reference signal for the annular buffer. Even if there is a time deviation between the PLC receiving the steel plate arrival signal and the industrial camera's exposure window, images that have been continuously acquired and written into the annular buffer before the steel plate arrives can still be retained. This prevents small cracks, pinholes, or short scratches from passing through the optimal imaging area before the PLC triggers and thus not being recorded, thereby improving the completeness and reliability of welded steel plate surface quality inspection.

[0049] The acquisition unit extracts continuous images before and after the position signal is generated from the annular buffer area according to the buffer locking instruction and the position mark, forming a detection image sequence covering the process of the weld passing through the optimal imaging area.

[0050] In this invention, after receiving the buffer lock instruction, the acquisition unit first reads the current acquisition frame number and the current circular buffer write address contained in the buffer lock instruction, and matches them with the position markers bound to each acquisition image in the circular buffer.

[0051] The location marker includes the sequence number of consecutive frame signals, the write address of the circular buffer, the center column coordinates of the texture region at the center of the weld, the texture displacement, and the corrected sequence number.

[0052] During matching, first look for images whose consecutive frame signal numbers are the same as the current acquisition frame number; when multiple consecutive frame signal numbers are the same, compare the write addresses of the circular buffer; when the write addresses are consistent, the acquisition image is determined as the reference image corresponding to the position signal.

[0053] If no completely identical acquired image is found, the acquired image with the smallest absolute difference between the consecutive frame signal number and the current acquired frame number, and the shortest distance of the write address along the circular buffer direction, is selected as the reference image. The absolute difference between the consecutive frame signal numbers must not exceed 2 frames, and the distance of the write address must not exceed 2 address bits. If these ranges are exceeded, the current buffer lock is invalid.

[0054] After determining the reference image, the acquisition unit reads the acquired images forward and backward, centered on the position markers of the reference image. Forward reading is used to obtain images acquired before the position signal is generated, and backward reading is used to obtain images acquired after the position signal is generated. For each frame of acquired image read, the acquisition unit determines whether the position markers of that acquired image are continuous with adjacent retained images. Continuity determination uses corrected sequence numbers; if the difference between the corrected sequence numbers of the currently read image and the adjacent retained image is 1, the position markers are considered continuous. Simultaneously, if the absolute value of the texture displacement difference does not exceed 3 pixels, the steel plate movement correspondence is considered continuous. When both conditions are met, it is then determined whether the weld center texture region is located within the preset effective acquisition area. When the center column coordinates of the weld center texture region are between 0.30 and 0.70 times the image width, and the coverage height of the weld center texture region within the range of 0.20 to 0.80 times the image height reaches 0.50 times the image height, the acquired image is retained.

[0055] During forward or backward reading, if the difference in the corrected sequence number is not 1, the absolute value of the difference in texture displacement exceeds 3 pixels, or the texture area at the center of the weld does not fall into the preset effective acquisition area, the acquisition unit stops reading in that direction to avoid adding images unrelated to the weld passing through the optimal imaging area to subsequent analysis.

[0056] After forward and backward readings are completed, the acquisition unit arranges the retained acquired images in ascending order according to the corrected sequence number in the position markers, forming a candidate image chain.

[0057] In the candidate image chain, the reference image is located at the position corresponding to the position signal. The acquired images before the reference image correspond to the weld movement process before the position signal is generated, and the acquired images after the reference image correspond to the weld movement process after the position signal is generated. This allows the candidate image chain to cover the complete time period during which the weld passes through the optimal imaging area.

[0058] To prevent duplicate and texture-broken images from entering the detection image sequence, the acquisition unit performs continuity verification on the weld center texture region of adjacent acquired images in the candidate image chain. The method for determining duplicate images is as follows: take the weld center texture region of two adjacent frames and calculate the absolute value of the difference in texture displacement between the two frames; when the difference is 0 pixels or 1 pixel, and the grayscale similarity between the two frames reaches 0.95, the latter frame is identified as a duplicate image and deleted.

[0059] The grayscale similarity is calculated as follows: Let the two texture regions to be compared be A and B, which are the same size and contain N corresponding pixels; let the grayscale values ​​of the k-th pixel be Ak and BK, respectively. Calculate their average grayscale values ​​WAK and WBK, and then use the Pearson correlation coefficient to calculate the grayscale similarity between the two texture regions.

[0060] The method for determining texture breakage images is as follows: when the grayscale similarity between two adjacent frames is less than 0.72, or when the column coordinate jump of the center of the texture region at the center of the weld exceeds 8 pixels, the adjacent relationship is identified as a texture breakage, and images with a continuous length of less than 5 frames after the breakage position are deleted; if the continuous length after the breakage position reaches 5 frames, the segment with a longer continuous length is used as the retained image chain.

[0061] After the above deletion process, the remaining continuous images are determined as the detection image sequence, which is used for subsequent effective frame screening and multi-frame defect identification.

[0062] The image processing unit performs effective frame screening and multi-frame defect identification on the detected image sequence to obtain defect detection results.

[0063] In one embodiment of the present invention, after receiving the detection image sequence, the image processing unit first aligns the position of the weld center texture region according to the position markers bound to each acquired image.

[0064] Using the reference image in the detected image sequence as the alignment reference, the center column coordinates C0 of the weld center texture region in the reference image are read, and the center column coordinates Ci of the weld center texture region in the i-th frame of the acquired image are read; the horizontal translation amount of the i-th frame of the acquired image is C0 - Ci.

[0065] The image processing unit translates the i-th frame of the acquired image according to the horizontal translation amount, so that the weld center texture region in each acquired image is at the same column coordinate position. After alignment, the image processing unit calculates the average gray value, saturated pixel ratio, and Laplacian sharpness value of each frame of the acquired image. If the average gray value is lower than 45 or higher than 210, or if the combined ratio of pixels with gray values ​​of 0 to 5 and gray values ​​of 250 to 255 exceeds 8%, it is judged as an exposure abnormality; the Laplacian sharpness value is obtained by averaging the absolute values ​​of the second-order gray value differences between adjacent pixels, and if it is lower than 80, it is judged as motion blur; if the coverage height of the weld center texture region in the range of 0.20 to 0.80 times the image height is lower than 0.50 times the image height, or if there is a break interval of more than 12 pixels in the weld center texture region in the same frame, it is judged as texture discontinuity.

[0066] Images with missing texture areas in the center of the weld, abnormal exposure, or discontinuous texture are discarded. The remaining images are arranged according to the corrected sequence number in the position marker to obtain a valid image sequence.

[0067] The image processing unit then extracts outliers from the central texture region of the weld and the surface regions of the steel plates on both sides of it in the valid image sequence. For each valid image frame, an analysis region is selected, centered on the central texture region of the weld and extending 120 pixels to the left and right.

[0068] The brightness-dark transition point is obtained through local gray-level difference: take a 9x9 pixel neighborhood centered on the pixel to be detected, calculate the average gray-level M and the gray-level standard deviation S of the neighborhood. If the absolute value of the difference between the gray-level value of the pixel and M reaches the judgment limit corresponding to M plus 2.2 times S, and the absolute value of the difference between the pixel and the average gray-level of the neighborhood is not less than 18, then it is marked as a brightness-dark transition point.

[0069] Edge break points are obtained through horizontal and vertical grayscale gradients: the horizontal gradient is the grayscale of the adjacent pixel on the right minus the grayscale of the adjacent pixel on the left, and the vertical gradient is the grayscale of the adjacent pixel on the bottom minus the grayscale of the adjacent pixel on the top. The gradient strength is the square root of the sum of the squares of the horizontal gradient and the squares of the vertical gradient. When the gradient strength of a continuous edge changes from not less than 35 to less than 12 within a range of 5 pixels, and the break length reaches 4 to 25 pixels, it is marked as an edge break point.

[0070] Local texture anomalies are obtained through texture difference: the gray-level variance of the current 9x9 pixel neighborhood is compared with the gray-level variance of the neighborhood of the same steel plate position in the previous and next frames. When the absolute value of the difference between the current variance and the average variance of the previous and next frames reaches 0.60 times the average variance of the previous and next frames, it is marked as a local texture anomaly.

[0071] To ensure that outliers in different valid images correspond to the same steel plate location, the image processing unit performs coordinate mapping based on location markers. The horizontal coordinate of an outlier is calculated by subtracting the column coordinate of the center texture region of the weld in the current frame from the column coordinate of the outlier. The vertical coordinate of an outlier is calculated by multiplying the difference between the corrected sequence number of the current frame and the corrected sequence number of the reference image by the average texture displacement of adjacent frames within the detection image sequence, and then adding the row coordinate of the outlier. Outliers of the same type in different valid images are considered to be mapped to the same steel plate location if the difference in their horizontal coordinates does not exceed 3 pixels and the difference in their vertical coordinates does not exceed 5 pixels.

[0072] The image processing unit connects anomalies mapped to the same steel plate location and appearing consecutively in adjacent valid images to form defect candidate trajectories. Each defect candidate trajectory contains at least three consecutive valid images, and the lateral coordinate variation of adjacent anomalies does not exceed 4 pixels, while the vertical coordinate variation does not exceed 1.5 times the texture displacement of adjacent frames. After forming the defect candidate trajectory, the image processing unit calculates the trajectory's continuous length, principal orientation angle, and distance to the texture region at the weld center.

[0073] Trajectories appearing only in 1 or 2 frames are deleted; trajectory grayscale changes appear synchronously throughout the entire frame analysis area, and the width of the abnormal point distribution exceeds 0.80 times the width of the analysis area, indicating that they are formed by light source flicker and are deleted; trajectory directions consistent with the direction of steel plate movement, Laplacian sharpness values ​​below 80, and trajectory widths exceeding 12 pixels are indicated that they are formed by motion blur and are deleted; trajectories repeating more than 3 times at fixed intervals with each interval difference not exceeding 2 pixels are indicated that they are formed by surface repetitive textures and are deleted.

[0074] The image processing unit reads back the corresponding effective local area of ​​the remaining defect candidate trajectory. The local area is the region formed by extending 10 pixels outward from the bounding rectangle of the trajectory. Connectivity analysis is performed on this local area to obtain the defect area, length, width, aspect ratio, average grayscale difference, and position relative to the weld center texture region. A defect is identified as a crack or scratch if the aspect ratio is not less than 6 and the average grayscale difference is negative 18 or more; a pinhole is identified if the area is 4 to 80 pixels, the roundness value is 0.55 to 1.00, and it is located within the weld center texture region; a pit is identified if the bounding region has a dark center and a bright edge, and the area of ​​the dark center is more than 0.20 times the area of ​​the local region. The image processing unit combines the defect type, defect location, defect range, and corresponding effective image number into a defect detection result and sends it to the PLC.

[0075] The PLC controls alarms, marking, sorting, or shutdown based on the defect detection results.

[0076] In this invention, after the image processing unit generates a defect detection result, it sends the result to the PLC. The defect detection result includes the steel plate inspection number, defect type, defect location, defect range, and defect judgment status, which includes qualified, re-inspectable, and unqualified. After receiving the defect detection result, the PLC binds it to the corresponding welded steel plate currently entering the inspection station to avoid mismatch between the detection result and subsequent steel plates.

[0077] After receiving the defect detection results, the PLC first determines the defect status. When the defect status is qualified, the PLC controls the conveyor mechanism to transport the welded steel plate to the next production station and writes the qualified information into the inspection record. When the defect status is re-inspectable, the PLC controls the alarm device to output a prompt signal and controls the conveyor mechanism to transport the welded steel plate to the re-inspection station or keep it at the inspection station for manual review. At the same time, the defect type, defect location, and corresponding acquired image number are sent to the human-machine interface to facilitate operators in quickly locating suspected defect areas.

[0078] When a defect is deemed unqualified, the PLC executes corresponding control actions based on the defect type and location. For surface defects such as cracks, pinholes, dents, and scratches, the PLC controls the marking device to spray code, paint, or mark the area on the steel plate surface corresponding to the defect location, enabling the defect area to be identified by subsequent processes. Simultaneously, the PLC controls the audible and visual alarm to output an alarm signal and displays the defect type, defect range, and steel plate inspection number on the human-machine interface. If the defect range exceeds the allowable range or the defect is located in a critical position in the center texture area of ​​the weld, the PLC controls the conveyor mechanism to stop operating to prevent unqualified steel plates from continuing into subsequent production processes.

[0079] In continuous production scenarios, the PLC also controls the sorting actuators based on defect detection results. When welded steel plates arrive at the sorting position, the PLC controls the pusher, baffle, lifting roller conveyor, or steering conveyor to move the qualified steel plates to the qualified channel and the unqualified steel plates to the rework channel or scrap channel, based on the correspondence between the steel plate's inspection number and the conveying position. For steel plates that need to be re-inspected, the PLC conveys them to the re-inspection channel and retains the corresponding inspection image sequence and defect detection results for easy traceability later.

[0080] Through the above processing, the PLC does not simply issue an alarm based on a single defect signal. Instead, it executes alarms, marking, sorting, or shutdown controls based on the defect type, location, range, and status of the defect detection results. This allows the detection results to be directly translated into production line control actions. Consequently, the risk of defective steel plates mistakenly flowing into subsequent processes is reduced, and the efficiency and traceability reliability of handling welded steel plate surface quality inspections are improved.

[0081] Example 2, please refer to Figure 2 As shown, the PLC-based welded steel plate surface quality inspection system described in this embodiment includes: The PLC control module receives the proximity signal of the steel plate set at the front end of the inspection station and controls the light source, industrial camera and acquisition unit to enter the pre-acquisition state. The image acquisition and caching module allows the industrial camera to continuously acquire images of the weld seam and steel plate surface area in the pre-acquisition state, and write the acquired images into the circular buffer in the acquisition order, while generating a corresponding position mark for each frame of image. After receiving the signal that the steel plate is in place, the PLC control module sends a buffer lock command to the acquisition unit. The cache backtracking extraction module, the acquisition unit extracts continuous images before and after the position signal is generated from the annular cache area according to the cache locking instruction and the position mark, forming a detection image sequence covering the process of the weld passing through the optimal imaging area; The image processing and defect recognition module performs effective frame filtering and multi-frame defect recognition on the detected image sequence to obtain defect detection results. The PLC executes the control module, and the PLC controls alarms, marking, sorting or shutdown based on the defect detection results.

[0082] The above description is merely a specific embodiment of this application, but the scope of protection of this application is not limited thereto. Any changes or substitutions that can be easily conceived by those skilled in the art within the scope of the technology disclosed in this application should be included within the scope of protection of this application.

Claims

1. A PLC-based method for inspecting the surface quality of welded steel plates, characterized in that, include: After receiving the proximity signal of the steel plate set at the front of the inspection station, the PLC controls the light source, industrial camera and acquisition unit to enter the pre-acquisition state. In the pre-acquisition state, the industrial camera continuously acquires images of the weld seam and the surface area of ​​the steel plate, and writes the acquired images into the circular buffer in the acquisition order, while generating a corresponding position mark for each frame of image. After receiving the signal that the steel plate is in place, the PLC sends a buffer lock command to the acquisition unit. The acquisition unit extracts continuous images before and after the position signal is generated from the annular buffer according to the buffer locking instruction and the position mark, forming a detection image sequence covering the process of the weld passing through the optimal imaging area; The image processing unit performs effective frame filtering and multi-frame defect identification on the detected image sequence to obtain defect detection results; The PLC controls alarms, marking, sorting, or shutdown based on the defect detection results.

2. The PLC-based method for inspecting the surface quality of welded steel plates according to claim 1, characterized in that, The acquisition unit establishes a circular buffer for temporarily storing acquired images, including: The acquisition unit allocates cyclic write addresses to the ring buffer according to the sequence of continuous frame signals output by the industrial camera, divides the ring buffer into a temporary coverage area and a candidate retention area, writes the acquired images of the weld center texture area that have not yet entered the preset effective acquisition area into the temporary coverage area, and writes the acquired images of the weld center texture area that have entered the preset effective acquisition area into the candidate retention area.

3. The PLC-based method for inspecting the surface quality of welded steel plates according to claim 2, characterized in that, The acquisition unit determines whether the texture area at the center of the weld has entered the preset valid acquisition area, including the following steps: The acquisition unit selects the search zone through which the weld is expected to pass in the current acquired image and performs grayscale processing on the pixels within the search zone; it determines the candidate columns of weld texture based on the amount of grayscale change of each column of pixels within the search zone; and it determines the area with a continuous column width of 10 to 60 pixels and a continuous column height covering more than 60% of the search zone height as the center texture area of ​​the weld. When the center column coordinates of the texture area at the center of the weld are between 0.30 and 0.70 times the image width, and its vertical coverage height reaches more than 0.50 times the image height, the acquisition unit determines that it has entered the preset effective acquisition area.

4. The PLC-based method for inspecting the surface quality of welded steel plates according to claim 3, characterized in that, Generate corresponding location markers for each frame of the image, including: The acquisition unit uses the weld center texture area of ​​the previous frame image as a reference and performs translational comparison within the search band of the current image along the steel plate conveying direction. Calculate the grayscale similarity between the currently acquired image and the previously acquired image at each translation position; When the highest grayscale similarity reaches 0.72, the acquisition unit determines the corresponding translation amount as the texture displacement of the current acquired image relative to the previous frame acquired image; A position marker is generated based on the sequence number of consecutive frame signals, the center column coordinates of the texture region at the center of the weld, the texture displacement, and the corrected sequence number, and the position marker is then bound to the corresponding acquired image.

5. The PLC-based method for inspecting the surface quality of welded steel plates according to claim 1, characterized in that, After the acquired images are written to the circular buffer, they are overwritten cyclically, including: When the write address of the circular buffer reaches the end, the acquisition unit returns to the starting address to continue writing the acquired image; During cyclic coverage, the acquisition unit first covers the acquired image with the earliest writing time in the temporary coverage area; When there are no addresses to cover in the temporary coverage area, the acquisition unit covers the acquired images whose location markers are discontinuous in the candidate reserved area; When the location markers of the acquired images within the candidate retention area are all continuous, the acquisition unit covers the acquired image with the lowest gray-level similarity.

6. The PLC-based method for inspecting the surface quality of welded steel plates according to claim 5, characterized in that, After receiving the steel plate arrival signal, the PLC sends a buffer lock command to the acquisition unit, including the following steps: The PLC receives the steel plate arrival signal output by the arrival detection element set at the inspection station; The PLC determines that the steel plate proximity signal exists, the pre-acquisition state has been established, the industrial camera is in continuous acquisition state, the acquisition unit is writing the acquired image to the circular buffer, and the detection station is in the detection allowed state. When all conditions are met, the PLC generates a buffer lock instruction containing a lock flag, an arrival confirmation time, the current acquisition frame number, and the current circular buffer write address; The PLC sends a buffer lock command to the acquisition unit, keeping the industrial camera and light source in the pre-acquisition state.

7. The PLC-based method for inspecting the surface quality of welded steel plates according to claim 6, characterized in that, The acquisition unit extracts consecutive images before and after the position signal is generated from the circular buffer according to the buffer lock command and position marker, including the following steps: The acquisition unit matches the current acquisition frame number and the current circular buffer write address in the buffer lock instruction with the position markers of each acquisition image to determine the reference image corresponding to the steel plate arrival signal; The acquisition unit reads the acquired images along the forward and backward directions of the acquisition sequence, with the position mark of the reference image as the center. The acquisition unit retains the acquired images with continuous position markers, continuous texture displacement, and the central texture area of ​​the weld located within the preset effective acquisition area; When the position markers are discontinuous, the texture displacement is discontinuous, or the texture area at the center of the weld seam deviates from the preset effective acquisition area during the reading process, the acquisition unit stops reading in the corresponding direction.

8. The PLC-based method for inspecting the surface quality of welded steel plates according to claim 7, characterized in that, The process of forming a sequence of detection images covering the weld seam as it passes through the optimal imaging area includes the following steps: The acquisition unit reorders the acquired images retained from the forward and backward reads according to the corrected sequence number in the position markers to form a candidate image chain; The acquisition unit performs grayscale similarity verification on the central texture region of the weld seam in adjacent acquired images in the candidate image chain; When the difference in texture displacement between two adjacent frames is 0 pixels or 1 pixel and the grayscale similarity reaches 0.95, the acquisition unit deletes the acquired image of the next frame. When the grayscale similarity between two adjacent frames is less than 0.72 or the center column coordinate jump of the texture region at the center of the weld exceeds 8 pixels, the acquisition unit deletes the texture fracture image and determines the remaining continuous image as the detection image sequence.

9. The PLC-based method for inspecting the surface quality of welded steel plates according to claim 8, characterized in that, The process of filtering valid frames and identifying defects across multiple frames in the detected image sequence to obtain defect detection results includes the following steps: The weld center texture region in the detected image sequence is aligned according to the position markers, and images with missing weld center texture regions, abnormal exposure, motion blur, or discontinuous textures are removed to obtain a valid image sequence. Extract the light and dark transition points, edge break points, and local texture anomalies in the central texture region of the weld and the surface regions of the steel plates on both sides of the effective image sequence, and map similar anomalies to the same steel plate location based on the location markers; Connect consecutively occurring anomaly points in adjacent valid images to form defect candidate trajectories, and eliminate transient interference trajectories formed by light source flicker, motion blur, or repeated surface textures. Based on the remaining defect candidate trajectories, the defect type, defect location, and defect range are determined to form the defect detection result. The PLC controls alarms, marking, sorting, or shutdown based on the defect detection result.

10. A PLC-based surface quality inspection system for welded steel plates, used to implement the PLC-based surface quality inspection method for welded steel plates according to any one of claims 1-9, characterized in that, include: The PLC control module receives the proximity signal of the steel plate set at the front end of the inspection station and controls the light source, industrial camera and acquisition unit to enter the pre-acquisition state. The image acquisition and caching module allows the industrial camera to continuously acquire images of the weld seam and steel plate surface area in the pre-acquisition state, and write the acquired images into the circular buffer in the acquisition order, while generating a corresponding position mark for each frame of image. After receiving the signal that the steel plate is in place, the PLC control module sends a buffer lock command to the acquisition unit. The cache backtracking extraction module, the acquisition unit extracts continuous images before and after the position signal is generated from the annular cache area according to the cache locking instruction and the position mark, forming a detection image sequence covering the process of the weld passing through the optimal imaging area; The image processing and defect recognition module performs effective frame filtering and multi-frame defect recognition on the detected image sequence to obtain defect detection results. The PLC executes the control module, and the PLC controls alarms, marking, sorting or shutdown based on the defect detection results.