Method for detecting surface cracks of holding-up hammer of cubic press based on image processing
By arranging and configuring multi-angle light sources and acquisition parameters, combined with pose calibration and geometric calibration, an original image index structure is generated. This solves the problem of unstable preprocessing in multi-angle synchronous acquisition of cracks on the surface of the top hammer of a six-sided top press, and realizes reliable calculation of crack feature vector set and traceable linkage update of classification results.
Patent Information
- Application Number
- CN202511526299.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-10-24
- Publication Date
- 2026-02-13
AI Technical Summary
Existing methods for detecting surface cracks on the top hammer of a six-sided top press suffer from several drawbacks under multi-angle synchronous acquisition and tooling coordinate constraints. These include unstable quality of preprocessed image sets, inconsistent candidate region representations, difficulty in forming a continuous and stable output of crack feature vector sets and classification results, and a lack of multi-angle original image set index organization, cross-angle merging of candidate region index structures, and traceable mapping of equipment control commands.
By arranging and configuring multi-angle light sources and acquisition parameters, pose calibration and geometric calibration are introduced to generate the original image index structure. Based on this, grayscale conversion, filtering, threshold segmentation and connected component extraction are performed to generate the candidate region index structure. The crack feature vector set is calculated, and combined with texture, shape and orientation elements, the crack classification result structure is generated. Finally, configuration revision suggestions are output.
It achieves stable generation and preprocessing adaptability of multi-angle original image sets in crack detection of the top hammer of a six-sided top press, cross-angle expression of candidate region index structure and reliable calculation of texture and shape elements, supports traceable linkage update of crack classification results, and forms a continuous link of acquisition-judgment-linkage-return.
Smart Images

Figure CN121526979A_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the field of optical detection and image processing, and in particular to a six-surface press ram surface crack detection method based on image processing. BACKGROUND
[0002] In the field of optical detection and image processing, the existing scheme of six-surface press ram surface crack detection usually carries out collection and processing around the fixed configuration of light source angle and camera exposure, adopts single-view collection and simple grayscale and filtering, and then performs threshold segmentation and connected component extraction based on empirical threshold, lacks the organization and alignment of multi-angle original image set, and does not form an original image index structure and batch processing log, so there are limitations such as that the collection and processing link is easily affected by light changes, the candidate region expression is not uniform, and the classification judgment and production line action are disconnected. The existing method performs preprocessing and segmentation under limited viewing angles, and relies on fixed rules to complete candidate generation and review, so in the scene of multi-angle synchronous collection and tooling coordinate constraint, the quality of the preprocessed image set is unstable and the redundancy of the candidate region label set is high, which makes it difficult to meet the continuity of the construction of the crack feature vector set and the stable output of the crack classification result structure. In view of the joint processing of how to realize the device control instruction based on the original image index structure, through the crack feature vector set and the crack classification result structure in the production line linkage processing, the existing technology generally has common shortcomings such as synchronization deficiency, judgment link fragmentation and linkage strategy deficiency in aspects such as index organization of multi-angle original image set, cross-angle merging of candidate region index structure, closed-loop recording of model input batch and crack classification result structure, and traceable mapping of device control instruction, so it is difficult to form a continuous link of collection-preprocessing-candidate-feature-classification-linkage-archiving in the application scene of six-surface press ram surface crack detection, which leads to the difficulty in establishing a stable and consistent process between the collection configuration data, the preprocessed image set and the configuration revision suggestion structure. SUMMARY
[0003] In order to solve the above technical problems, the present application provides a six-surface press ram surface crack detection method based on image processing, comprising: From the light source arrangement parameters and the collection configuration parameters, the light source angle, the light source distance, the light source intensity, the camera exposure, the focal length and the trigger strategy are obtained, the tooling coordinate system is established on the ram clamping base surface, the calibration plate and the reference target are arranged, the multi-angle collection processing of pose calibration, geometric calibration and external trigger pulse synchronization is carried out, and the original image index structure is generated; Based on the original image index structure, the mapping relationship from image to space is established according to the tooling coordinate registration information, the grayscale, filtering, contrast enhancement, threshold segmentation and connected component extraction processing based on light source angle bias compensation are performed, and the candidate region index structure is generated; read pixel masks, region geometric elements and gray scale statistical elements from the candidate region index structure, load the corresponding pre-processing frame based on the tool coordinate projection center and cut the region subgraph, perform direction-independent texture statistics, direction-dependent filter response and texture, shape and orientation element calculation of skeleton line extraction, calculate the orientation consistency, shape stability and cross-angle dispersion index, and combine the texture missing, shape abnormal and orientation conflict label to perform normalization and field importance screening, and generate a crack classification result structure; obtain the crack classification result structure, trigger the alarm rule set based on the confidence threshold and the conflict state, perform alarm rule arrangement, pseudo-label screening and edge deployment write-back processing under health check sequence, and generate a configuration revision suggestion structure.
[0004] Further, the light source arrangement parameters and acquisition configuration parameters include: The light source arrangement parameters are composed of light source type, light source angle, light source distance and light source intensity, wherein the light source type includes the physical form of linear light, ring light or area array light, the light source angle includes the included angle range between the optical axis and the top hammer measured surface, the light source distance includes the spatial distance between the light source emitting surface and the measured surface, and the light source intensity indicates the light source driving current or brightness level; The acquisition configuration parameters are composed of camera exposure, camera focal length and trigger strategy, wherein the camera exposure includes the combination of exposure time and gain level, the camera focal length includes the nominal focal length of the zoom lens or fixed focus lens, and the trigger strategy includes the combination of external trigger source, trigger polarity and frame synchronization beat.
[0005] Further, the process of generating the crack classification result structure further includes: read pixel masks, region geometric elements, gray scale statistical elements and tool coordinate projection center from the candidate region index structure, locate the corresponding region subgraph in the pre-processing image buffer according to the index, perform direction-independent texture statistics, direction-dependent filter response and texture, shape and orientation element calculation of skeleton line endpoint and bifurcation feature extraction, and calculate the orientation consistency, shape stability and light source angle dispersion index in the cross-angle merged region, and generate a crack feature vector set; extract the agreed field according to the region-level fixed-length feature item from the crack feature vector set, perform batch-scale normalization processing with abnormal compensation and field quantile replacement according to the texture missing, shape abnormal and orientation conflict label, and perform feature weight adjustment and screening according to the field importance table, conflict suppression rule and orientation uncertainty additional field, and generate a model input batch; The model input batch performs double-channel collaborative reasoning of the main classification model and the auxiliary discrimination model, and based on category consistency, enhanced view disturbance result and intermediate layer response fusion, multi-source clue weighted confidence calculation processing, after the conflict entry triggers secondary reasoning and enhanced view integration, outputs the final crack category and confidence field, and generates a crack classification result structure.
[0006] Further, the process of reading the pixel mask, the region geometric element, the gray scale statistical element, and the tool coordinate projection center from the candidate region index structure further includes: The pixel mask, the region geometric element, the gray scale statistical element, the main direction, the tool coordinate projection center, the light source angle set participating in the merging, and the camera exposure aperture set, and the source frame and the timestamp in the candidate region index structure for each region have been registered, and the feature calculation thread traverses the index entries in the hierarchical order of frame number-region sequence-cross-angle merging sequence.
[0007] Further, the process of locating the corresponding region subgraph in the preprocessed image buffer according to the index, performing direction-independent texture statistics, direction-dependent filter response, and texture, shape, and orientation element calculation processing of skeleton line endpoint and bifurcation feature extraction includes: Based on the region subgraph and the pixel mask, direction-independent and direction-dependent texture descriptions are generated, where the direction-independent texture description is composed of gray level distribution and local neighborhood statistics, and the direction-dependent texture description is composed of direction-selective filtering and direction response statistics.
[0008] Further, the process of locating the corresponding region subgraph in the preprocessed image buffer according to the index, performing direction-independent texture statistics, direction-dependent filter response, and texture, shape, and orientation element calculation processing of skeleton line endpoint and bifurcation feature extraction includes: For regions containing obvious highlight residues, the system first performs brightness clipping according to the highlight mark registered in the candidate region index structure before entering the texture channel calculation, and the clipping threshold is given by the frame-level metadata in the preprocessing stage.
[0009] Further, the process of generating the crack feature vector set further includes: Boundary tracking is performed on the mask boundary to obtain a boundary sequence, and the perimeter, area, and elongation ratio are calculated on the boundary sequence, and a skeleton line is constructed based on the region subgraph, and the number of endpoints, the number of bifurcations, and the length of the skeleton line are part of the shape elements.
[0010] Further, the process of generating the crack feature vector set further includes: The main direction registered in the candidate region index structure is used as the initial value, consistency checking is performed on the gray scale gradient field and the skeleton line set of the region subgraph, and the main direction of each angle is projected and wrapped under the tool coordinates, and the trend and dispersion of the orientation set are calculated.
[0011] Further, the process of generating the model input batch further comprises: In the normalization process, interval mapping is adopted for the geometric quantity class field, and piecewise mapping is adopted for the texture energy class field, and the mapping parameters are given by the combination of historical training statistics and current batch quantile points, and the out-of-range samples are replaced with batch quantile point values.
[0012] Further, the process of generating the crack classification result structure further comprises: A dual-channel collaborative inference of the main classification model and the auxiliary discrimination model is adopted, and when a conflict entry triggers secondary inference, enhanced view inference is performed, a plurality of views are generated by disturbing the direction related field, and the outputs are integrated for consistency to update the category distribution and the confidence.
[0013] The key innovations of the present application include: (1) Around the multi-angle light source arrangement and the acquisition parameter configuration, the link of pose calibration and geometric calibration is introduced, the acquisition configuration data is generated, and the batch acquisition of the multi-angle original image set is driven, and the stable organization of the original image index structure is faced.
[0014] (2) For the candidate region annotation set, a data organization mode of cross-angle redundancy merging and indexing is constructed, a candidate region index structure is formed, and consistent mapping of texture elements, shape elements and strike elements is completed at the region level, and a crack feature vector set is output.
[0015] (3) Based on the line linkage processing of the crack classification result structure, a closed loop is established from the device control instruction to the pseudo-annotation screening and small batch parameter updating, to the edge deployment write-back and data archiving processing, and a model update package and a configuration revision suggestion structure are output, and feedback to the acquisition side parameter link.
[0016] The main beneficial effects are as follows: (1) Acting on the running link of acquisition and preprocessing, through the acquisition configuration data, the light source angle, the light source distance, the light source intensity, the camera exposure, the camera focal length and the trigger strategy are unified, after the multi-angle original image set is generated and merged into the original image index structure, the generation of the preprocessed image set is more adaptive to the change of imaging conditions, and can stably support the continuous processing of grayscale, filtering and contrast enhancement in the six-surface press ram surface crack detection scene.
[0017] (2) Acting on the running link from candidate generation to feature calculation, through the candidate region index structure, cross-angle expression is unified and same-frame and cross-frame redundancy is reduced, and in the transition process to the crack feature vector set, the consistent mapping of region-level metadata and imaging conditions is maintained, and the reliable calculation and alignment of texture elements, shape elements and strike elements are supported in the six-surface press ram surface crack detection scene.
[0018] (3) Acting on the operation link of determination and linkage update, the crack classification result structure triggers the alarm rule arrangement and the production line linkage processing, generates the device control instruction and records the linkage event, and then forms the model update package through pseudo-label screening and small batch parameter update, and finally outputs the configuration revision suggestion structure in the edge deployment write-back and data archiving processing, so that the collection-determination-linkage-update-backflow maintains a traceable consistent process in the six-side top press top hammer surface crack detection scene. BRIEF DESCRIPTION OF DRAWINGS
[0019] Figure 1 A flowchart of a six-side top press top hammer surface crack detection method based on image processing is provided. DETAILED DESCRIPTION
[0020] Embodiment one: refer to Figure 1 , a flowchart of a six-side top press top hammer surface crack detection method based on image processing provided by the embodiment of the application, which can at least include steps S100-S400: S100, obtain the light source angle, light source distance, light source intensity, camera exposure, focal length and trigger strategy from the light source arrangement parameters and collection configuration parameters, establish a tool coordinate system on the top hammer clamping base surface and arrange a calibration plate and a reference target, perform pose calibration, geometric calibration and external trigger pulse synchronization multi-angle collection processing, and generate an original image index structure; S200, based on the original image index structure, establish a mapping relationship from image to space according to the tool coordinate registration information, perform grayscale, filtering, contrast enhancement, threshold segmentation and connected domain extraction processing based on light source angle bias compensation, and generate a candidate region index structure; S300, read the pixel mask, region geometric elements and gray scale statistical elements from the candidate region index structure, load the corresponding pre-processing frame based on the tool coordinate projection center and cut the region subgraph, perform texture, shape and direction element calculation processing of direction-independent texture statistics, direction-dependent filtering response and skeleton line extraction, calculate the consistency of the direction, the stability of the shape and the cross-angle dispersion index, and perform normalization and field importance screening combined with texture missing, shape abnormality and direction conflict label, and generate a crack classification result structure; S400, obtain the crack classification result structure, trigger the alarm rule set based on the confidence threshold and the conflict state, perform alarm rule arrangement, pseudo-label screening and edge deployment write-back processing under the health check sequence, and generate a configuration revision suggestion structure.
[0021] Step S100 at least includes steps S110-S130: In S110, the light source arrangement parameters and the acquisition configuration parameters are acquired, pose calibration and geometric calibration are performed, and acquisition configuration data is obtained. In the implementation process, first, the light source arrangement parameters given by the pre-system initialization stage and the acquisition configuration parameters are taken as inputs. The light source arrangement parameters are composed of light source type, light source angle, light source distance and light source intensity. The light source type includes the physical form of linear light, ring light or area array light. The light source angle includes the angle range between the optical axis and the measured surface of the top hammer. The light source distance includes the spatial distance between the light emitting surface of the light source and the measured surface. The light source intensity includes the driving current or brightness level of the light source. The acquisition configuration parameters are composed of camera exposure, camera focal length and trigger strategy. The camera exposure includes the combination of exposure time and gain level. The camera focal length includes the nominal focal length of the zoom lens or fixed focus lens. The trigger strategy includes the combination of external trigger source, trigger polarity and frame synchronization beat. Specifically, the light source arrangement parameters and the acquisition configuration parameters are loaded into the human-computer interaction interface of the edge controller, the tool coordinate system initialization function is called, the tool coordinate system with the top hammer clamping base surface as the reference is established, and the calibration board and the reference target are arranged in the measured working cavity. The calibration board adopts high-contrast chessboard or circular dot array pattern, and the reference target is used to locate the tool coordinate origin and normal direction. Further, the pose calibration process is performed. The pose calibration is defined in the present application as the process of solving and registering the spatial position and attitude of the camera and the light source relative to the tool coordinate. It is completed through three steps in the running: first, multi-angle images of the calibration board are collected and calibration element corners or circle centers are recognized, and the camera imaging geometry is solved preliminarily; second, each light source combination is turned on in turn, the light spot distribution and shadow boundary of the measured surface under different light source angles and different light source distances are recorded, the angle between the light spot main axis direction and the tool coordinate normal direction is taken as the measured value of the light source angle, and the spatial distance from the light emitting surface to the reference target is taken as the measured value of the light source distance; third, according to the overlapping relationship between the camera field of view and the light source irradiation area, the relative attitude of the light source and the camera is revised, and the pose alignment table is formed. Understandably, after the pose calibration is completed, the geometric calibration processing stage is entered. The geometric calibration is defined in the present application as the process of uniformly correcting the distortion of the imaging link, the reference geometry of the measured surface and the measurement working distance. It is realized through three types of processing in the running: in the distortion correction processing, the camera factory calibration file and the calibration board sample collected on site are called, and the radial and tangential distortion of the image edge is corrected in pixel coordinates by interpolation table lookup method; in the reference geometry fitting processing, for the top hammer measured surface, the approximate normal and local flat area of the measured surface are determined by using the reflection distribution under multi-angle lighting, the flat area is fitted as the detection reference surface, and the tool coordinate parameters of the reference surface are registered; in the working distance correction processing, the actual distance between the camera imaging surface and the reference surface is obtained through the electric displacement table or the reading micrometer, and the camera focal length and focus position in the acquisition configuration parameters are revised. In abnormal cases, if the calibration board corner recognition confidence is low or the light spot detection appears shielding, the system records the corresponding time stamp, light source number and camera number, triggers a supplementary sampling and places it in the pending review queue, while maintaining the current parameter version that has passed the verification to participate in subsequent solving.Via the above pose calibration and geometric calibration processing, acquisition configuration data is generated, which is defined in the present application as a parameter set that can directly drive the acquisition process, including the field-revised executable values of light source type, light source angle, light source distance, light source intensity, camera exposure, camera focal length and trigger strategy, and is accompanied by tool coordinate registration information and reference surface parameters; the output field name in this section is acquisition configuration data, which is directly called by the subsequent S120 multi-angle original image set generation action in the process, and in the cross-main-step connection, provides the prerequisite for image geometric consistency for the preprocessing link in S200.
[0022] S120, extract light source angle, distance, intensity, camera exposure, focal length, trigger strategy from the acquisition configuration data, perform multi-angle synchronous acquisition, and generate a multi-angle original image set; In the implementation process, first, the acquisition configuration data output by S110 is taken as the only parameter source, and the acquisition control thread reads the field revision values of the light source angle, light source distance, light source intensity, camera exposure, camera focal length, and trigger strategy from the data structure, and expands according to the established acquisition sequence queue. Specifically, the acquisition sequence queue is defined in the present application as a batch execution list for multi-angle lighting, which internally contains Cartesian combination entries of light source angle groups, light source distance groups, and exposure level groups. The system performs a five-step sub-process for each entry, including light source lighting, camera positioning, external trigger, image caching, and state review. Further, to achieve multi-angle synchronous acquisition, the controller generates a synchronization pulse according to the external trigger source, trigger polarity, and frame synchronization beat in the trigger strategy. The external trigger source can be an encoder channel of the production line master control or an independent time sequence generator. The trigger polarity is the selection of rising edge or falling edge. The frame synchronization beat is the time reference for each camera to respond at the same time. The system broadcasts acquisition instructions to multiple cameras at the same beat, and sends the lighting combination corresponding to the light source angle group to the light source driving module, so that the time window of camera exposure overlaps with the light source lighting. For the camera focal length and focusing position, the controller drives the motorized lens holder or lens servo motor to complete the adjustment before the specified acquisition entry starts according to the executable values registered in the acquisition configuration data. After completion, the success flag and adjustment time are recorded. If the feedback fails, it will back up to the last available focal length and mark the entry for re-sampling. For adjustable light source supports, the system drives the linear slide to move to the target position before entering the corresponding entry, and returns the actual distance from the displacement encoding device. If the deviation exceeds the limit, repeat the fine adjustment, and keep the trigger thread waiting during this period. For fixed light source distance, the system only performs a position review and skips the movement action. After each entry is completed, the acquisition thread reads single or multiple frames of raw images from the image acquisition buffer, binds them with the light source angle, light source distance, light source intensity, camera exposure, and camera focal length of the entry, and writes the tool coordinate registration information and reference surface parameters at the same time, so that the subsequent processing link can perform corresponding lookup of lighting conditions and geometric conditions. In abnormal cases, if the external trigger pulse is missing or the frame synchronization beat jitter exceeds the allowed range, the system performs a re-sampling on the entry. If the state review still fails after two consecutive re-samplings, the entry is marked as unavailable, and an unavailable entry list is generated at the end of the acquisition completion statistics, which is used as a reference for the quality selection logic of S130. To improve the efficiency of subsequent processing, the controller packs the image and parameters of each entry according to the execution order of the acquisition sequence queue, and writes them into the temporary image warehouse. The temporary image warehouse is defined in the present application as a high-speed access cache for batch processing, which supports reading by entry number and timestamp double key index.Via the above multi-angle synchronous acquisition process, a multi-angle original image set is formed, which is defined in the present application as a raw unprocessed image collection archived by entries, containing image content, light source angle, light source distance, light source intensity, camera exposure, camera focal length, trigger strategy mapping and tool coordinate registration information; the output field name of this section is multi-angle original image set, which is directly consumed by the quality screening, duplicate removal and numbering index processing of subsequent S130, and serves as the only source of the preprocessed image set generated by S200 in the cross-main step connection.
[0023] S130, quality screening, duplicate removal and numbering index processing of the multi-angle original image set, generating an original image index structure; In the implementation process, first, the multi-angle original image set output by the foregoing S120 is loaded to the quality evaluation thread. The quality screening, defined in the present application as a process of determining the availability of the sample according to the imaging state and imaging condition of the image, includes three aspects of clarity determination, overexposure or underexposure determination, and motion blur determination. Specifically, the clarity determination uses local edge strength and detail texture ratio as observation quantities. The system calculates edge count and detail coverage in the image grid area and compares them with the statistical baseline of the same batch. The overexposure or underexposure determination samples and statistically analyzes the accumulation of the brightness histogram at the high-light end and the low-light end, and cross- verifies with the exposure of the camera and the intensity of the light source. The motion blur determination measures the consistency of the edge direction and the stability of the strip width. If the texture energy in the same direction expands significantly, it is determined that there is blur. The quality screening marks the samples that do not meet the availability threshold as unqualified, records the corresponding light source angle, light source distance, camera exposure, and camera focal length, and writes them into the re-sampling recommendation queue. Further, the repeated removal processing is entered. The repeated removal is defined in the present application as a process of merging and retaining images with similar content under the same angle, same distance, and same exposure condition. During operation, the three-dimensional buckets are constructed according to the light source angle, light source distance, and camera exposure. The perceptual fingerprint of the image is calculated in each bucket. The perceptual fingerprint is generated in the way of perceptual hashing (PH) or local sensitive feature abstraction. The system clusters the fingerprints in the bucket, and the samples within the distance threshold are classified into the same cluster. Only the frame with the latest timestamp or the highest clarity is retained as the representative sample. The remaining samples are marked for redundant deletion, and the redundant reasons and fingerprint distance statistics are recorded in the log. For near-duplicates across buckets, the system performs global checking during the end-of-day batch recovery, without occupying online processing time. Subsequently, the numbering index processing is entered. The numbering index is defined in the present application as a process of constructing a sample coding and retrieval structure for subsequent calculation and traceability. The system generates a globally unique number according to the hierarchical rule of tool number-batch number-item serial number-representative frame serial number, and establishes an index entry for each representative sample. The index entry includes the image storage path, light source angle, light source distance, light source intensity, camera exposure, camera focal length, trigger strategy mapping, tool coordinate registration information, and reference surface parameters. It also includes the acquisition order and timestamp of the source item. In abnormal cases, if all samples in a bucket are excluded due to unqualified quality, the system establishes a placeholder entry in the index and marks it for re-sampling, and pushes it to the acquisition control thread, which triggers the re-sampling at the next production beat.After the number index processing is completed, the system aggregates all index entries representing the samples into a raw image index structure, which is defined in the present application as an index set that can be directly traversed and distributed by the computing link, supports fast retrieval under the joint conditions of light source angle, light source distance, and camera exposure, and provides a consistent geometric and lighting metadata view for each entry, facilitating the reading of the same field name by subsequent processing modules to perform consistent operations. At this point, the output field name of this section is the raw image index structure, which is directly consumed by the subsequent S210 pre-processing image set generation action and used as the input entry of S200 in the cross-main step connection; at the same time, the sample number and metadata of the raw image index structure are also read by the crack feature vector set construction process of S300, which is used for grouping and statistical sampling by angle and distance in the classification model inference stage. The technical effect of this step is summarized as follows: through continuous quality screening, repeated removal, and number index processing, a stable and consistent raw image index structure is formed, providing a unified and traceable sample entry for subsequent preprocessing and candidate generation, and completing the dual constraints and records of the image and acquisition conditions during the running process.
[0024] Step S200 includes at least steps S210-S230: S210, obtain the raw image index structure, and perform grayscale, filtering, and contrast enhancement processing to obtain a pre-processed image set; In the implementation process, first, the raw image index structure generated in the foregoing S130 is taken as the only input source, and the raw image index structure records the image storage path, light source angle, light source distance, light source intensity, camera exposure, camera focal length, trigger strategy mapping, tool coordinate registration information, and reference surface parameters of each representative sample. Specifically, the pre-processing scheduling thread constructs a batch queue according to the joint conditions of the light source angle and the camera exposure, and sequentially loads the image data and the corresponding geometric and lighting metadata in each batch. The tool coordinate registration information and the reference surface parameters are read at the same time in the loading stage to establish a pixel-to-space mapping relationship of the image to the tool coordinate system, which is used for subsequent interpretation and consistency constraint of strong boundary and dark crack lines. The system writes a processing log at the start of the batch, records the batch number, timestamp, and execution operator version number, and if the image path is lost or fails to be read, the scheduling thread marks the entry as an access exception, triggers a retry at the end of the batch, and collects the entries that still fail after the retry to a review queue, which are temporarily not entered into the operator link of this step.
[0025] In the greying processing link, the system synthesizes the color channels into a single-channel grayscale image. Specifically, according to the spectral response of the camera and the spectral distribution of the light source, the gain set of the batch is selected from the light source intensity and the camera exposure field, and the channel fusion is performed using fixed weights or lookup table weights; if the image is captured by a narrow-band light source, the system uses a single main channel as the grayscale output to avoid cross-channel noise transmission. After greying, the image enters the filtering processing link, which is defined in the present application as a process of suppressing high-frequency noise and texture artifacts through a spatial and temporal neighborhood operator. When running, each frame of image is divided into several sub-regions according to the tool coordinates, and medium-strength smoothing is preferentially used in areas away from the edge, and edge-preserving smoothing is used in areas close to strong reflection and highlight areas; specifically, first, neighborhood statistics-based smoothing is performed, then edge-directed smoothing is performed, and for sub-regions with highlight overflow, a highlight suppression-type smoothing is added. A noise estimation map is maintained during the filtering stage, which is derived from spatial local variance and row and column difference statistics, and is used as a gain upper limit control in subsequent contrast enhancement. If pixel value overflow or invalid gray level occurs during the filtering process, the system will mark the frame as a filtering exception, and then back to low-intensity smoothing, and continue the subsequent process after calculating the noise estimation map again.
[0026] In the contrast enhancement processing link, the system performs brightness interval stretching and local contrast enhancement in batches. Specifically, first, the image is mapped to the reference system of the reference surface according to the tool coordinate registration information, the global brightness distribution is calculated, the segmented stretching mapping is constructed, the gain of the dark and bright parts is given, and then the local contrast enhancement is performed according to the sub-region. The local contrast enhancement adopts an adaptive histogram equalization method, and sets a gain threshold in combination with the aforementioned noise estimation map to prevent dark noise from being amplified excessively. For regions containing strong reflection stripes, the system first performs brightness clipping before stretching, and the clipping threshold is given by joint statistics of the camera exposure and the light source intensity. After clipping, the equalization processing is performed. After the entire enhancement link, the greying and enhancement results corresponding to the original image index structure are generated, and the processing parameters are written into the frame-level metadata. In order to maintain the traceability of the processing, the system summarizes the processing log at the end of the batch, records the filtering intensity file and the equalization window size of each frame. If there is still a large saturated area after enhancement, the system adds a cautious judgment label for it, so that the threshold domain segmentation and connected domain extraction in S220 can choose a more conservative threshold strategy. Through the three links of greying, filtering and contrast enhancement, the preprocessed image set is output, which is defined in the present application as a single-channel high-quality image set that can be directly used for crack candidate generation, including frame-level image data and batch and frame-level processing metadata. The output field is named preprocessed image set, and is directly consumed by the subsequent S220 candidate region label set generation action in the process, and in the cross-main step connection, the preprocessed image set provides stable grayscale and local contrast conditions for the crack feature vector set construction of S300.
[0027] S220, extracting strong boundary and dark crack line from the preprocessed image set, threshold segmentation and connected component extraction are performed to generate a candidate region annotation set; In the implementation process, first, the preprocessed image set output by the foregoing S210 is taken as input, the system reads in the image and the corresponding processing metadata in batches, generates a direction bias parameter according to the light source angle and the tooling coordinate registration information, which is used for angle compensation of the response of the strong boundary and the dark crack line. The strong boundary is defined in the present application as an edge structure with a sudden change in brightness gradient and continuous distribution on the measured surface, and the dark crack line is defined in the present application as a low-brightness line or strip extending along a certain main direction. Specifically, the response calculation thread constructs a multi-scale gradient map and a multi-scale dark channel map on each frame of image, and the scale set of the multi-scale is determined according to the camera focal length and the light source distance field. The smaller scale layer is used to depict small textures, and the larger scale layer is used to depict continuous strips. In order to adapt to the projection form difference caused by different light source angles, the system loads the direction bias parameter in batches, and introduces angle weighting in the gradient direction statistics and dark channel line detection, so that the response in the same direction with the light reflection strip is weakened, and the response consistent with the suspected crack direction is reserved.
[0028] In the threshold segmentation link, the system constructs a candidate response map according to the multi-scale gradient map and the multi-scale dark channel map, and performs a double-threshold strategy on the response map, and the high and low thresholds of the double threshold are given by the brightness distribution of the batch and the noise estimation map at the frame level. For strong boundary response, the system adopts a high threshold to lock obvious edges, and then expands to the neighborhood; for dark crack line response, the system adopts a low threshold to aggregate first, and then screens out isolated noise points through direction consistency and length constraint. After threshold segmentation, a preliminary binary mask is obtained, and there are strong boundary fragments and dark line fragments in the mask. Then, it enters the connected component extraction link, which is defined in the present application as a process of aggregating adjacent pixels in the binary mask into regions and outputting region-level descriptions. In runtime, the system adopts a mixed strategy of four-neighbor connection and eight-neighbor connection, first aggregates quickly according to the four-neighbor connection, then refines the boundary with the eight-neighbor connection, and additionally performs a direction connectivity repair for the cross-scale elongated region to connect the line segments that are broken due to noise. After each connected component is generated, the region geometric elements and gray scale statistical elements are calculated immediately, the geometric elements include perimeter, area, elongation ratio and main direction, and the gray scale statistical elements include region mean, region contrast and boundary gradient mean; for the region containing strong reflection residues, according to the brightness clipping record in the frame-level processing metadata, an additional dark part check is performed, if the region mean is too high and does not meet the definition of dark crack line, it is marked as high-brightness interference, and is preferentially processed in the subsequent morphological shaping stage.
[0029] In the aspect of abnormality processing, if a large area of connected region covers more than half of the image after threshold segmentation, the system judges that the threshold is out of range and re-computes using a more conservative threshold set; if the number of regions is abnormally large after connected region extraction, the system increases the threshold according to the noise estimation map to suppress noise aggregation. After the above process, the system outputs a candidate region list for each frame and writes the pixel mask, geometric elements and gray scale statistics of each region into the frame-level candidate description. In order to maintain consistency with the tool coordinate registration information and the reference surface parameters, the system attaches the projection main direction and position center of the region in the tool coordinate system in the region description, which facilitates subsequent cross-frame and cross-angle alignment. Through the three processes of strong boundary and dark crack line extraction, threshold segmentation and connected region extraction, a candidate region annotation set is generated, which is defined in the present application as a region-level annotation data set for subsequent morphological shaping and redundancy merging, including a frame-level candidate list and a region-level description. The output field is named candidate region annotation set and is directly consumed by the subsequent morphological shaping and redundancy merging process of S230, and in the cross-main step connection, the region main direction information of the candidate region annotation set will be reused by the trend element calculation of S300.
[0030] S230, performing morphological shaping and redundancy merging on the candidate region annotation set to generate a candidate region index structure; In the implementation process, first, the candidate region annotation set output by the aforementioned S220 is taken as input, the system sequentially reads each frame of the candidate list, and selects a shaping strategy according to the geometric elements and gray scale statistics in the region-level description. Morphological shaping is defined in the present application as a process of using local structure operators to repair and regularize the region boundaries and internal holes. Specifically, the system first performs an erosion followed by an opening operation on regions marked with high-light interference to weaken isolated high-light residues; performs a closing operation on dark crack line regions that are elongated and discontinuous to fill small gaps; and performs a hole filling operation on regions containing holes to ensure internal continuity. The size and shape of the structure operator are adaptively generated according to the region main direction and the elongation ratio, using an elongated linear operator along the region main direction and a shorter linear operator along the perpendicular direction. After shaping, the region geometric elements are recalculated, and if the region area is below the minimum judgment threshold or the elongation ratio and dark crack line definition are inconsistent, the region is marked as a low-confidence candidate and is processed uniformly after redundancy merging.
[0031] In the redundancy merging link, the system processes two types of redundancies: intra-frame adjacent redundancies and cross-frame cross-angle redundancies. Intra-frame adjacent redundancies are defined in the present disclosure as a situation where multiple candidate region boundaries in the same frame overlap or are too close and consistent in direction. At runtime, an inter-region adjacency graph is first constructed, the weight of an adjacency edge is given by the joint of boundary distance and direction consistency, and then aggregation is performed on the adjacency graph to obtain several candidate clusters, each of which outputs a merged region, and the mask of the merged region is obtained by performing a union operation on the masks in the cluster and then performing a thinning operation. Cross-frame cross-angle redundancies are defined in the present disclosure as a situation where candidate regions obtained by shooting at different light source angles under the same tool coordinate are highly overlapped. To this end, the system projects the pixel centers of regions in each frame to the reference surface by means of the tool coordinate registration information and the reference surface parameters, calculates the cross-angle position difference and the main direction difference; performs cross-frame alignment on regions whose position difference and direction difference are within a set range, and outputs a cross-angle merged region on the cross-frame set. The set of light source angles and the set of camera exposure levels involved in the merging are recorded in the cross-frame processing stage, which are called by the texture elements and the strike elements in the subsequent S310 when statistics is performed. If mutually contradictory geometric descriptions appear in the cross-frame set, for example, one record is a long high ratio, and the other record is an approximately equal length axis, the system marks the set as a morphology conflict and splits it into two sub-sets for output.
[0032] To support subsequent rapid retrieval and batch delivery, the system enters the index construction link after the completion of redundancy merging. The candidate region index structure is defined in this invention as a region-level retrieval and metadata container oriented to feature calculation and model input construction. During index construction, the system generates a global region number according to the hierarchical relationship of frame number-region sequence-cross-angle merging sequence, registers pixel mask, region geometric elements, gray scale statistical elements, main direction, tool coordinate projection center, participating merging light source angle set and camera exposure aperture set for each region, and records the source frame and timestamp. For regions marked as low-confidence candidates, their records are retained in the index but a lower level is set in the priority field for S310 to sample as needed when calculating texture and shape elements. In terms of exception handling, if the number of regions after morphological shaping is zero, the system writes an empty list entry in the index and records the candidate emptying in the batch log for operation and maintenance to check whether there is a mismatch between the light source angle and exposure. After the above process is completed, the candidate region index structure is output as the final product of this main step. The output field is named candidate region index structure and is directly consumed by the subsequent S310 crack feature vector set calculation action in the process; at the same time, in the cross-main step connection, the main direction, participating merging light source angle set and camera exposure aperture set in the candidate region index structure will be read by the S300 going element and texture element statistics module to construct a stable feature field set. The technical effect of this step is summarized as follows: through morphological shaping and redundancy merging, the candidate regions are uniformly expressed in terms of geometric coherence and cross-angle consistency, the index organization reduces the retrieval overhead of subsequent feature calculation, and the region-level metadata and imaging conditions are kept in correspondence in the same container.
[0033] Step S300 includes at least steps S310-S330: S310, obtain the candidate region index structure, perform texture element, shape element and going element calculation processing, and obtain a crack feature vector set; In the implementation process, first, the candidate region index structure generated by the foregoing S230 is taken as input, and the pixel mask, region geometric elements, gray scale statistical elements, main direction, tool coordinate projection center, light source angle set and camera exposure level set participating in merging, and source frame and timestamp are registered in the candidate region index structure for each region. Specifically, the feature calculation thread traverses the index entries in the order of frame number-region sequence-cross-angle merging sequence, locates the corresponding preprocessed frame from the image cache according to the index for each region, and cuts out the region subgraph according to the pixel mask. The boundary and hole of the region subgraph are directly defined by the pixel mask; at the same time, the main direction and tool coordinate projection center are read from the index entry for the calculation of the trend element and the subsequent cross-angle statistical consistency constraint. The system records the operator version, window scale group and direction discrete group used in this feature calculation at the batch level, and if image path loss or pixel mask is found to be empty during the region subgraph cutting stage, the system will mark the region as a feature input exception, and write it to the review queue at the end of the current batch, and temporarily not enter the subsequent operator chain of this step. For the regions obtained by cross-angle merging, the system synchronously retrieves the light source angle set and camera exposure level set participating in merging during the loading stage, and adopts a grouping weighting strategy in the statistical step of feature calculation to reflect the response difference under different imaging conditions.
[0034] For the calculation of texture elements, the system generates two types of texture descriptions based on the region subgraph and the pixel mask, namely direction-independent and direction-dependent texture descriptions. The direction-independent texture description is composed of gray level distribution and local neighborhood statistics. The system calculates multi-scale local statistics graph within the mask and aggregates it into a fixed-length description within the region. The direction-dependent texture description is composed of direction-selective filtering and direction response statistics. The system arranges several direction response channels within the main direction neighborhood and calculates response intensity, response uniformity and relative difference within the channel. For regions containing obvious highlight residues, the system performs brightness clipping before entering the texture channel calculation according to the highlight marker registered in the candidate region index structure. The clipping threshold is given by the frame-level metadata in the preprocessing stage. If pixel out-of-bound, mask fragmentation or insufficient valid pixels occur during texture calculation, the system sets the texture elements of the region to default description and adds a texture missing label in the region-level metadata for default compensation in the agreement field extraction stage of S320.
[0035] For the calculation of shape elements, the system outputs stable geometric structure descriptions according to the region pixel mask and geometric elements. Specifically, the system performs boundary tracking on the mask boundary to obtain a boundary sequence, and calculates the perimeter, area and elongation ratio on the boundary sequence; at the same time, based on the region subgraph, the skeleton line is constructed by sub-block, and the number of end points, the number of bifurcations and the length of the skeleton line are taken as part of the shape elements; for the merging region across the angle, the system aligns the boundary centers under the tool coordinate system at multiple angles, calculates the average elongation ratio and the consistency index after merging, and records the number of light source angles participating in the merging and the statistical dispersion, to reflect the stability of the shape description under different imaging conditions. If the boundary tracking fails due to mask holes or noise, the system first performs mask thinning and hole filling, and then recalculates the shape elements; if it still does not meet the minimum connectivity condition, the region is added to the shape anomaly list, and only the basic description of the skeleton and the area is output for subsequent process degradation.
[0036] For the calculation of the direction element, the system takes the main direction registered in the candidate region index structure as the initial value, and performs consistency checking on the gray gradient field and the skeleton line set of the region subgraph. Specifically, the system generates a direction candidate set according to the main direction, and searches for a direction consistent with the gradient main direction in the set; at the same time, the main axis direction and the local direction change rate are calculated on the skeleton line set and compared with the main direction; for the merging region across the angle, the system projects and wraps the main direction of each angle under the tool coordinate, calculates the trend and dispersion of the direction in the wrapping interval, and takes the trend as the final value of the direction element and the dispersion as the stability identifier of the direction. If the main direction and the gradient main direction differ significantly, the system records the region as a direction conflict, and retains both in the final description to support the feature selection strategy of S320 to select the more discriminative field. After the calculation of the direction element is completed, the system aligns and combines the texture element, shape element and direction element at the region level to generate a region-level fixed-length feature item; for the merging region across the angle, the system also outputs the local feature overview grouped by angle, for subsequent selection stage to extract as needed. Finally, the system aggregates all regions in the current batch to obtain a crack feature vector set, which is defined in the present application as a region-level fixed-length vector set for the input of the classification model, including the combined description of the texture element, shape element and direction element, and the necessary default label and quality label. The output field is named crack feature vector set, and is directly consumed by the model input batch generation action of S320 in the subsequent process; at the same time, in the cross-main step, the crack feature vector set will be read by the classification model of S330 in batches and linked with the confidence calculation.
[0037] S320, extract the agreed field from the crack feature vector set, perform normalization and feature selection processing, and generate a model input batch; In the implementation process, first, the crack feature vector set output by the foregoing S310 is taken as input, the crack feature vector set contains texture elements, shape elements and strike elements at the regional level, and is accompanied by quality labels such as texture missing, shape abnormality and strike conflict. Specifically, the input adaptation thread reads the regional level feature entries in batches, and loads the agreed field list according to the standard input template of the classification model. The agreed field is defined in the present application as a field set agreed in advance to match the given classification model training interface, including field name, field type, default strategy and value range. The system maps and clips each regional feature entry according to the above: for the entries with texture missing label, the default strategy is used to compensate the texture elements; for the entries with shape abnormality label, only the stable subset of area, skeleton length and slenderness ratio is retained; for the entries with strike conflict, the strike element consistent with the skeleton main axis is preferentially retained, and the difference is taken as the strike uncertainty additional field, which is used for inhibition in the subsequent feature selection stage. After the mapping is completed, the system performs consistency check on the feature entries. If the missing field cannot be compensated by the default strategy or the field type does not match the template, the system marks the entry as unqualified input and excludes it from the batch, and writes it into the batch log for subsequent review.
[0038] In the normalization processing stage, the system performs scale alignment and distribution alignment on the agreed fields in batches. In the scale alignment link, the system uses interval mapping for geometric quantity fields and segmented mapping for texture energy fields. The specific mapping parameters are given by historical training statistics and current batch quantile points; in the distribution alignment link, the system centralizes the direction-related fields with large fluctuations according to the batch statistics, and the centralization parameters are registered in the batch metadata for traceable reproduction on the inference side. If an abnormal outlier is found in a single field during the normalization process, the system replaces the outlier sample of the field with the batch quantile point value, and writes the replacement event into the frame-level metadata for subsequent tracing. In the feature selection processing stage, the system filters the agreed fields according to the established field importance table and conflict suppression rule. The field importance table is derived from the statistical records in the training stage; the conflict suppression rule gives suppression strategies for additional fields such as strike uncertainty and highlight residual probability. When the additional fields exceed the threshold domain, the system reduces the weight of the corresponding direction-related field or directly removes the field to avoid unstable features entering the inference. To support the needs of multi-model collaboration, the system generates two sets of field views at the same time: one set is used for the standard input of the main classification model, and the other set is used for the supplementary input of the auxiliary discrimination model; the two sets of views share the same basic identifier and timestamp of an entry, which facilitates the result comparison in the subsequent inference stage.
[0039] After normalization and feature selection, the system packs the field view of all qualified items in the current batch as a model input batch, which is defined in the present application as a set of input data grouped according to the model interface, containing the main classification model input tensor view and the auxiliary discriminant model input tensor view, and registering the normalization parameters, field selection mask and abnormal replacement record used this time in the batch metadata. If there are unqualified input items in the current batch, the system records their item numbers and rejection reasons in the accompanying list of the model input batch, which does not enter the inference interface but is used for running log retention. After the model input batch is generated, the system releases a signal in the memory shared area, which is subscribed and read by the classification model inference and confidence calculation process of S330 in batches; the output field name is model input batch, and it is directly consumed by the subsequent S330 crack classification result structure generation action in the process, while in the cross-main step connection, the field selection mask and normalization parameters of the model input batch are written into the result accompanying information, supporting the field-level backtracking in the alarm rule arrangement stage of S400.
[0040] S330, classification model inference and confidence calculation processing on the model input batch, generating a crack classification result structure; In the implementation process, first, the model input batch output by the aforementioned S320 is taken as input, from which the system reads the main classification model input tensor view and the auxiliary discriminant model input tensor view, and synchronously loads the normalization parameters, field selection mask and abnormal replacement record in the batch metadata. The inference scheduling thread starts the model inference task on the edge computing device accordingly, and the main classification model uses a convolutional neural network (CNN) or a lightweight variant as the basic structure, which is used for end-to-end category determination on the input field view; the auxiliary discriminant model uses a gradient boosting decision tree (GBDT) or a support vector machine (SVM) as a supplementary structure, which is used for secondary discrimination and checking of boundary samples. Specifically, the system sends the main classification model input tensor view into the CNN inference engine in batches, obtains the category distribution and internal intermediate layer response of each item; at the same time, the auxiliary discriminant model input tensor view is sent into the GBDT or SVM inference engine to obtain the corresponding category suggestion and confidence clue. In order to maintain timing consistency, the inference scheduling thread aligns the two-way results according to the item order of the model input batch, and fuses and encodes the intermediate layer response of CNN and the confidence clue of the auxiliary model to form a feature summary for confidence calculation.
[0041] In the confidence calculation processing stage, the system adopts the strategy of multi-source clue weighting combined with consistency checking. In multi-source clue weighting, the system fuses the class distribution of the main classification model, the class suggestion of the auxiliary discrimination model, the trend uncertainty and the highlight residual probability and other additional fields according to the given weight. The weight table is derived from the offline calibration file and is registered in the batch metadata; in consistency checking, the system interprets the consistency of the class of the main classification model and the auxiliary discrimination model. When the two are consistent and the intermediate layer response is stable, the confidence is improved; when the two are inconsistent or there is trend uncertainty exceeding the threshold, the confidence is reduced, and the secondary reasoning is triggered when necessary. The trigger condition of the secondary reasoning is given by the batch strategy. When triggered, the system starts the enhanced view reasoning on the main classification model for the conflict item. The enhanced view reasoning is defined in the present application as a process of generating a number of views by perturbing part of the direction-related fields without changing the basic input, and integrating the outputs of the views. After integration, the class distribution and confidence of the item are updated. If model instance loading fails, reasoning time exceeds the threshold or input tensor verification fails during the reasoning process, the system will add the corresponding item to the reasoning exception list, and the classification result will be output in the pending review state, and the exception type and timestamp will be recorded in the log for operation and maintenance troubleshooting.
[0042] In the result organization stage, the system generates a crack classification result structure for each item. The crack classification result structure is defined in the present application as a result record for downstream alarm and production line linkage, including item identification, predicted class, confidence, auxiliary class suggestion, conflict state, enhanced view number, field selection mask, normalization parameter summary and timestamp. For the cross-angle merging area, the system converges multiple results with the same cross-angle merging number in the tool coordinate system, outputs the merged class and confidence, and records the set of light source angles participating in the merging, facilitating the S410 alarm rule arrangement to implement differentiated linkage according to the angle coverage. After the crack classification result structures of all items are aggregated, a batch result is formed and delivered to the memory sharing area and the message channel at the same time: the memory sharing area is used for upper computer panel synchronization, and the message channel is used for real-time control link consumption. At this point, the output field name of this section is the crack classification result structure, which is directly consumed by the device control instruction generation action of the subsequent S410 in the flow; at the same time, in the cross-main step connection, the conflict state and the number of enhanced views in the crack classification result structure are read by the pseudo-label screening of S420 in priority, which is used to construct the data subset for small-batch parameter update. The technical effects of this step are summarized as follows: through the collaborative reasoning of the main classification model and the auxiliary discrimination model and the confidence calculation of multi-source clues, the structured and traceable crack classification result structure is output; under the hierarchical processing of abnormal and conflict samples, the reasoning link maintains a stable output rhythm and provides available basis for subsequent linkage and update links.
[0043] Step S400 includes at least steps S410-S430: S410, obtaining a crack classification result structure, performing alarm rule arrangement and production line linkage processing, and obtaining a device control instruction; In the implementation process, first, the crack classification result structure generated in the foregoing S330 is taken as input, and the crack classification result structure includes item identification, predicted category, confidence, auxiliary category suggestion, conflict state, enhanced view number, field selection mask, normalization parameter digest, and timestamp. Specifically, a linkage arrangement thread is started in an edge controller, crack classification result structures are read in by item in batches, tooling coordinate registration information, machine state register, and beat timing table are loaded at the same time, the machine state register is used to reflect the operation mode of the top hammer, the opening and closing state of the valve group, and the emergency stop state, and the beat timing table is used to indicate the start and end time of the current batch and the adjacent batch. Further, the thread maps the predicted category and the confidence to an alarm rule set, which is defined in the present application as a set composed of rule identification, trigger condition, linkage action, and allowed window, and the trigger condition can refer to the confidence threshold, the conflict state, and the enhanced view number. When the item meets the trigger condition, the system arranges the corresponding linkage action within the allowed window, and the linkage action includes operation combinations such as upper prompt, buzzer trigger, work station speed reduction, work station shutdown, and release bypass. The allowed window is given by the beat timing table and the machine state register. In order to unify the production line communication, the linkage instruction is translated into a message that can be recognized by a programmable logic controller (PLC) and a supervisory control and data acquisition system (SCADA) before being sent down, and if necessary, it is forwarded through open platform communication unified architecture (OPC UA) or message queuing telemetry transport (MQTT). If the work station is a hydraulic valve group under independent closed-loop control, the instruction also includes the valve group address and the action holding time. In abnormal cases, when the linkage arrangement thread finds that there are conflicting actions of shutdown and release bypass for the same work station at the same time window, the system retains the action with higher priority according to the rule priority table, and writes a conflict resolution identifier in the item operation log; when the PLC or SCADA feedback message is timed out, the system adds the corresponding item to the downlink pending review queue, and supplements a degraded instruction with only an upper prompt to keep the information flow uninterrupted.
[0044] After the line linkage processing is completed, the system generates a control load for each scheduled item for the execution end, which is defined in the present application as a structured load that can be directly consumed by the execution end, including workstation identification, linkage action sequence, action duration, allowed window, and necessary interlocking conditions. The control load is immediately issued and waits for execution feedback, which records feedback code, execution start time, and execution completion time; if the execution feedback shows that the action is intercepted by the interlocking condition, the system will transfer the item to the linkage exception processing, and record an interlocking hit count in the rule set for subsequent strategy revision reference. After the issuance and feedback collection are completed, the system aggregates all the control loads and feedback records of the current batch into device control instructions, which are defined in the present application as aggregated downstream business instruction sets, with item-by-item execution feedback and time stamp, so that the downstream system and audit thread can restore the scheduling and execution state at that time. At this point, the output field name of this section is device control instruction, which is consumed by the line control subsystem and PLC / SCADA in real time to drive the machine action; at the same time in the same transaction, the system synchronously generates linkage event records and binds them to the item identification of the crack classification result structure, which are read by the sample segment and label source selection link of S420 for subsequent small batch parameter update, for identifying the data subset that needs to enter the pseudo-label screening and small batch parameter update.
[0045] S420, extract sample segments and label sources from the crack classification result structure, perform pseudo-label screening and small batch parameter update processing, and generate a model update package; In the implementation process, first, the crack classification result structure reserved in the memory sharing area after the foregoing S410 is run is taken as input together with the linkage event record, the system reads entries in batches, and according to the entry identification, it is traced back to the region subgraph and region-level fixed-length feature entry saved in the cache in the S300 stage, and the region subgraph and the fixed-length feature entry are added to the candidate set as part of the sample segment. Specifically, the sample management thread scores each entry according to the pseudo-labeling strategy table, which is defined in the present application as a rule set for automatically constructing labels, including three elements of label source, trigger condition and confidence interval: the label source can be the consistency of the predicted category of the main classification model, the category suggestion of the auxiliary discrimination model or both; the trigger condition can refer to the confidence, the conflict state and the number of enhanced views; the confidence interval gives the upper and lower bounds allowed to enter the pseudo-labeling. The entries that meet the trigger condition and are within the confidence interval are assigned pseudo-labels, and their label sources and assignment processes are written to the entry-level metadata; for entries in the border zone, the system refers to the action type and execution feedback in the linkage event record, and the entries corresponding to shutdown and speed reduction are preferentially entered into the manual review portal, which is defined in the present application as a channel for providing a quick confirmation interface for operators, and the confirmation result replaces the original pseudo-label in the form of review label, and its source is marked as manual review. If the entry has a reasoning exception or an unqualified historical label, the system directly excludes the entry, and records the exclusion reason in the batch log.
[0046] After the pseudo-label screening is completed, the system resamples the candidate set according to the category balance and the angle balance. The category balance is used to suppress the small batch bias caused by the high proportion of a single category, and the angle balance is used to introduce the sample diversity of different light source angles and camera exposure levels. Then, the small batch parameter update process is entered. The small batch parameter update is defined in the present application as the process of incrementally fine-tuning the model parameters using small-scale data without changing the structure of the main model. To perform this process, the system first constructs a training batch. The training batch is composed of regional subgraphs of sample segments, corresponding fixed-length feature items, and pseudo-labels or review labels. The training batch is accompanied by the current model version number and the field selection mask. According to this, the training scheduling thread loads the fine-tuning subgraph of the main classification model and the auxiliary discriminant model on the edge computing device; for the convolutional neural network (CNN) of the main classification model, the system only opens a few layers of parameters near the output end for updating; for the gradient boosting decision tree (GBDT) or support vector machine (SVM) of the auxiliary discriminant model, the system updates it in the form of incremental training or small-step refitting. To suppress overfitting, the training scheduling thread inserts the reserved validation samples according to the strategy table and dynamically adjusts the sampling weight according to the angle balance state inside the training batch; when the validation performance fluctuates beyond the threshold or the training loss cannot be reduced, the system immediately reverts to the last stable snapshot and marks the current batch as not adopted for updating. Abnormalities during training include insufficient memory, unavailable computing cores, or model instance conflicts. When such abnormalities occur, the system interrupts the current batch training and generates a failure receipt. The failure receipt is accompanied by the type of abnormality, the timestamp, and the snapshot number, which can be used for subsequent troubleshooting.
[0047] When the small-batch parameter update is completed and passes the hold-out validation, the system enters the packaging process of the model update package, which is defined in the present application as a model incremental load that can be transmitted between the edge device and the host computer, containing the updated model weights, training batch composition summary, label source statistics, field selection mask, and version number. The packaging thread calculates the content check code and generates the signature for the model update package; if the deployment environment uses Message Queuing Telemetry Transport (MQTT) as the transmission channel, the model update package will be split into several segments and reassembled at the receiving end; if the deployment environment is issued through Open Platform Communications Unified Architecture (OPC UA), the node address of the model update package is registered on the server and the subscription interface is exposed. At this point, the output field name in this section is the model update package, which is directly consumed by the subsequent S430 edge deployment write-back and data archiving process in the process; at the same time, in the cross-main step, the label source statistics carried by the model update package will be used as a reference field in the S110 collection configuration review stage, driving the fine-tuning of the next batch of collection strategies.
[0048] S430, edge deployment write-back and data archiving processing of the model update package to generate a configuration revision suggestion structure; In the implementation process, first, the model update package output by the aforementioned S420 is taken as input, and the deployment write-back thread loads the model update package on the edge controller, reads its model weights, training batch composition summary, label source statistics, field selection mask, and version number, and compares them with the current in-use model version. Specifically, the thread creates a temporary instance locally, loads the updated weights into the specified subgraphs of the main classification model and the auxiliary discrimination model, and then calls a health check sequence to quickly infer the temporary instance. The health check sequence is defined in the present application as a verification set composed of a small number of representative samples, covering different light source angles, camera exposure settings, and class boundaries. The verification indicators and threshold domains come from the offline calibration file. If the temporary instance passes the health check, the system enters the hot switching process, which is defined in the present application as the process of switching the in-use model pointer from the old version to the new version without stopping the collection and inference threads. Before switching, a complete snapshot of the old version is written to the local version repository and the host computer's archiving directory, and the in-use version pointer is updated. After switching, the inference load and timestamp of the first complete batch are monitored, and potential load jitter is alarmed. If the temporary instance fails the health check or there are consecutive batch abnormalities after switching, the system immediately rolls back to the old version and writes a switching rollback record in the deployment log. The deployment write-back thread terminates the update after the rollback is complete.
[0049] In the data archiving process, the system writes the key facts involved in this deployment into the archive warehouse, which is defined in this invention as a multi-partition storage for long-term traceability and audit, including model version area, training batch summary area, linkage event area and alarm reply area. The model version area saves the weight summary, field selection mask and health check report of new and old versions; the training batch summary area saves the sample segment hash involved in the update, label source statistics, angle balance state and rejection reason statistics; the linkage event area saves the control load and execution feedback generated during the S410 production line linkage, forming the corresponding relationship between model update and production line behavior; the alarm reply area saves the upper prompt and manual review results after S410 execution, which is convenient for revising the pseudo-labeling strategy in the future. After the data archiving is completed, the system triggers the configuration evaluator to generate revision proposals for the collection side and the rule side based on the label source statistics and linkage event distribution in the archive. The configuration evaluator is defined in this invention as an evaluation unit that maps model update effects to collection and linkage strategies. Its output is divided into two categories: light source arrangement parameter revision suggestion and collection configuration parameter revision suggestion. The light source arrangement parameter revision suggestion proposes suggestions for adding, deleting and gear migration for light source angle, light source distance and light source intensity. The collection configuration parameter revision suggestion proposes suggestions for batch adjustment for camera exposure, camera focal length and trigger strategy. The system summarizes the two types of suggestions into a configuration revision suggestion structure, which is defined in this invention as a configuration suggestion set that can be directly read by the upstream collection link, including suggestion items, suggestion reasons and suggestion effective range, and is bound with model version number and archive fingerprint, which is convenient for checking the source.
[0050] After the configuration revision suggestion structure is generated, the system pushes it to the configuration listening channel of the acquisition control thread and mounts it in the host computer interface in a state to be reviewed; the operator or process engineer accepts or rejects the suggestion on the interface, the accepted item is automatically incorporated into the light source arrangement parameters of S110 and the acquisition configuration parameters in the next production beat, and the rejected item is recorded in the rejection reason library to avoid repeated suggestions in subsequent strategy generation. To prevent version drift, the system locks the current model version in use and the model update package fingerprint corresponding to the suggestion when the suggestion is accepted, forming a configuration-model alignment relationship; when subsequent batches trigger model updates again, if the alignment relationship changes, the system adds a cross-check in the configuration evaluator to avoid inconsistencies between historical suggestions and new model versions. At this point, the output field name of this section is the configuration revision suggestion structure, which is directly consumed by the light source arrangement parameter acquisition and acquisition configuration parameter input link of S110 in the process, thereby completing the parameter recognition-linkage-learning-deployment-configuration revision closed loop. At the same time, in the cross-main step connection, the effective record and version binding information of the configuration revision suggestion structure are referenced by the preprocessing log of S200 to locate whether the image quality fluctuation is caused by acquisition side configuration changes. The technical effect of this step is summarized as follows: through the edge deployment write-back and multi-partition archiving of model incremental loads, the running model version and production line linkage facts are synchronized and deposited; the configuration revision suggestion structure driven by archiving statistics is fed back to the acquisition side, enabling the recognition, linkage, and acquisition strategies to form a stable closed-loop evolution relationship.
Claims
1. A method for detecting surface cracks in the top hammer of a six-sided top press based on image processing, characterized in that, include: The light source angle, light source distance, light source intensity, camera exposure, focal length, and triggering strategy are obtained from the light source arrangement parameters and acquisition configuration input parameters. A tooling coordinate system is established on the top hammer clamping base surface, and a calibration plate and reference target are set up. Multi-angle acquisition processing is performed for pose calibration, geometric calibration, and external trigger pulse synchronization to generate the original image index structure. Based on the original image index structure, an image-to-space mapping relationship is established according to the tooling coordinate registration information. Grayscale conversion, filtering, contrast enhancement, and threshold segmentation and connected component extraction based on light source angle offset compensation are performed to generate a candidate region index structure. Pixel masks, regional geometric features, and grayscale statistical features are read from the candidate region index structure. The corresponding preprocessed frame is loaded based on the tooling coordinate projection center and the region sub-image is cropped. The texture, shape, and orientation features of orientation-independent texture statistics, orientation-related filtering response, and skeleton line extraction are calculated and processed. At the same time, orientation consistency, shape stability, and cross-angle dispersion index are calculated. Normalization and field importance filtering are performed in combination with texture missing, shape abnormal, and orientation conflict labels to generate crack classification result structure. Obtain the crack classification result structure, trigger alarm rule set based on confidence threshold and conflict state, perform alarm rule arrangement, pseudo-label filtering and edge deployment write-back processing under health check sequence, and generate configuration revision suggestion structure.
2. The method according to claim 1, characterized in that, The light source arrangement parameters and acquisition configuration input parameters include: The light source arrangement parameters consist of light source type, light source angle, light source distance, and light source intensity. The light source type includes the physical form of bar light, ring light, or area array light. The light source angle includes the angle range between the optical axis and the measured surface of the top hammer. The light source distance includes the spatial distance between the light-emitting surface of the light source and the measured surface. The light source intensity indicates the light source driving current or brightness level. The acquisition configuration input parameters consist of camera exposure, camera focal length, and trigger strategy. Camera exposure includes a combination of exposure time and gain level, camera focal length includes the nominal focal length of the lens zoom ring or fixed focal length lens, and trigger strategy includes a combination of external trigger source, trigger polarity, and frame synchronization beat.
3. The method according to claim 1, characterized in that, The process of generating the crack classification result structure also includes: The pixel mask, regional geometric elements, grayscale statistical elements and tooling coordinate projection center are read from the candidate region index structure. The corresponding regional sub-image is located in the preprocessed image cache according to the index. The texture, shape and orientation elements are calculated and processed by direction-independent texture statistics, direction-related filtering response and skeleton line endpoint and bifurcation feature extraction. In the cross-angle merging region, the orientation consistency, shape stability and light source angle dispersion index are calculated to generate crack feature vector set. From the crack feature vector set, conventional fields are extracted according to region-level fixed-length feature entries. Based on the labels of texture missing, shape abnormality and orientation conflict, batch scale normalization processing with anomaly compensation and field quantile replacement is performed. Then, feature weight adjustment and screening are performed according to the field importance table, conflict suppression rules and orientation uncertainty additional fields to generate model input batch. The model input batch performs dual-channel collaborative inference of the main classification model and the auxiliary discriminant model, and calculates and processes the multi-source clue weighted confidence based on category consistency, enhanced view perturbation results and intermediate layer response fusion. After the conflict item triggers secondary inference and the enhanced view is integrated, the final crack category and confidence field are output, generating the crack classification result structure.
4. The method according to claim 3, characterized in that, The process of reading pixel masks, region geometric features, grayscale statistical features, and tooling coordinate projection centers from the candidate region index structure also includes: In the candidate region index structure, for each region, the registered pixel mask, region geometric features, grayscale statistical features, main direction, tooling coordinate projection center, set of light source angles and camera exposure settings involved in merging, as well as source frame and timestamp are used. The feature calculation thread traverses the index entries in the hierarchical order of frame number - region number - cross-angle merging sequence number.
5. The method according to claim 3, characterized in that, The process of locating the corresponding region sub-image by index in the preprocessed image cache and performing orientation-independent texture statistics, orientation-correlated filtering response, and extraction of skeleton line endpoints and bifurcation features to calculate texture, shape, and orientation elements includes: Based on region sub-images and pixel masks, two types of texture descriptions are generated: orientation-independent and orientation-dependent. The orientation-independent texture description consists of gray-level distribution and local neighborhood statistics, while the orientation-dependent texture description consists of orientation-selective filtering and orientation response statistics.
6. The method according to claim 5, characterized in that, The process of locating the corresponding region sub-image by index in the preprocessed image cache and performing orientation-independent texture statistics, orientation-correlated filtering response, and extraction of skeleton line endpoints and bifurcation features, as well as calculating and processing texture, shape, and orientation elements, also includes: For regions containing obvious highlight residues, the system performs a brightness clipping operation based on the highlight markers registered in the candidate region index structure before proceeding to the texture channel calculation. The clipping threshold is provided by the frame-level metadata in the preprocessing stage.
7. The method according to claim 3, characterized in that, The process of generating a crack feature vector set also includes: Boundary tracing is performed on the mask boundary to obtain a boundary sequence, and the perimeter, area and slenderness ratio are calculated on the boundary sequence. At the same time, a skeleton line is constructed based on the region subgraph, and the number of endpoints, the number of branches and the skeleton length are used as part of the shape elements.
8. The method according to claim 3, characterized in that, The process of generating a crack feature vector set also includes: Using the main direction registered in the candidate region index structure as the initial value, consistency is checked on the gray-level gradient field and skeleton line set of the region sub-map, and the main direction of each angle is projected and wrapped in the tooling coordinate to obtain the trend of convergence and dispersion.
9. The method according to claim 3, characterized in that, The process of generating model input batches also includes: During the normalization process, interval mapping is used for geometric quantity fields and segmented mapping is used for texture energy fields. The mapping parameters are given by the combination of historical training statistics and the current batch quantile, and outlier samples are replaced with batch quantile values.
10. The method according to claim 3, characterized in that, The process of generating the crack classification result structure also includes: A dual-channel collaborative reasoning approach using a primary classification model and an auxiliary discriminant model is adopted. When a conflicting entry triggers secondary reasoning, enhanced view reasoning is performed. The orientation-related fields are perturbed to generate several views, and the output is integrated in a consistent manner to update the category distribution and confidence.
Citation Information
Cited By
Irregular crack self-adaption and multi-target synchronization width calculation method based on DIC
CN121904131A