Aluminum profile surface defect detection and classification method and system
Patent Information
- Application Number
- CN202611121559.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-07-27
- Publication Date
- 2026-10-30
AI Technical Summary
[0005]因此,本发明提供了一种铝型材表面缺陷检测与分类方法解决了铝型材表面图像区域与实体位置难以连续对应、缺陷分类结果与生产工艺记录关联不足的问题
[0016]本发明有益效果为:通过生成图像检测基础记录并将采集图像转换为铝型材表面展开坐标,使图像区域、表面区域编码和实体位置形成统一对应关系,用于缺陷候选区域提取和跨区域连续判断,达到了缺陷定位结果可追溯的有益效果;通过生成缺陷连续记录并结合生产工艺记录进行工艺来源核验,使表面缺陷分类结果能够与挤压、输送、切割、表面处理及喷涂过程对应,并依据人工复核结果形成铝型材表面缺陷分类结果回写记录,达到了分类依据可更新的效果。
Smart Images

Figure CN123015413A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of image detection technology, and in particular to a method and system for detecting and classifying surface defects in aluminum profiles. Background Technology
[0002] Aluminum profiles are widely used in building doors and windows, curtain walls, rail transit, automotive parts, and industrial frames. Their appearance quality is closely related to their cross-sectional structure, extrusion molding, surface treatment, spray coating, and conveying contact processes. Surface defect detection of aluminum profiles typically involves visual inspection, image acquisition using line scan or area scan cameras, and combining these methods with light source illumination, image preprocessing, region segmentation, feature extraction, and defect classification to identify and record surface defects such as scratches, abrasions, color differences, oxide spots, burrs, and coating particles.
[0003] However, existing methods still have two limitations: First, aluminum profiles have diverse cross-sectional shapes, and the correspondence between image areas and physical surface locations is not easily expressed continuously, affecting the merging and location of defects across surface areas; second, there is insufficient correlation between image defect features and production process records such as extrusion, conveying, cutting, surface treatment, and spraying, making it difficult to continuously update defect classification results with verification results and judgment criteria. Summary of the Invention
[0004] In view of the aforementioned existing problems, the present invention is proposed.
[0005] Therefore, the present invention provides a method for detecting and classifying surface defects of aluminum profiles, which solves the problems that it is difficult to continuously correspond the surface image area and the physical location of aluminum profiles, and that the defect classification results are not sufficiently correlated with the production process records.
[0006] To solve the above-mentioned technical problems, the present invention provides the following technical solution: In a first aspect, the present invention provides a method for detecting and classifying surface defects in aluminum profiles, comprising: acquiring production object information and image acquisition information of the aluminum profile; converting the acquired image into aluminum profile surface unfolding coordinates with surface area encoding, length coordinates, and width coordinates based on cross-sectional contour reference data, camera calibration records, and encoder pulse positions, thereby generating an image detection basic record; establishing a detection comparison benchmark based on the image detection basic record, correcting, stitching, and judging the acquisition quality of multi-source surface images, and generating a valid surface image record corresponding to the aluminum profile surface unfolding coordinates; extracting image deviation areas based on the valid surface image record and the detection comparison benchmark, and after verification by excluding structurally permissible areas and acquisition anomaly records, calculating regional characteristics and multi-source response differences, thereby generating a defect candidate area record; generating a defect continuous record based on the entity position, main direction of the area, area width change, and preliminary classification mark of anomaly source in the defect candidate area record, performing process source verification and surface quality judgment in conjunction with production process records, and updating the structurally permissible area, defect sample record, defect classification judgment benchmark record, invalid detection area rules, and acquisition parameter benchmark record based on the manual review results, thereby generating a write-back record of aluminum profile surface defect classification results.
[0007] As a preferred embodiment of the aluminum profile surface defect detection and classification method of the present invention, the generated image detection basic record includes: reading the cross-sectional contour reference data according to the cross-sectional model of the aluminum profile; dividing the outer surface of the aluminum profile into front area, back area, side area, corner area, slot area, end face area and connecting transition area according to the sequence of boundary points of the outer contour of the cross-section, the starting point of surface development and the surface development direction; setting surface area codes for each surface area; performing distortion correction on the acquired image according to the camera calibration record; determining the length coordinate according to the encoder pulse position and the image acquisition time; determining the width coordinate according to the cross-sectional contour reference data and the pixel size conversion relationship; thereby generating the aluminum profile surface development coordinates with surface area codes, length coordinates and width coordinates; when the cross-sectional model cannot match the cross-sectional contour reference data or there is an abnormality in the encoder pulse position, generating a cross-sectional reference mismatch record or a length positioning abnormality record.
[0008] As a preferred embodiment of the aluminum profile surface defect detection and classification method of the present invention, the step of establishing a detection comparison benchmark based on image detection basic records includes: reading images of aluminum profiles with the same cross-section model, surface treatment method, spraying color, and quality inspection standard number, which have been confirmed as qualified by manual quality inspection, according to the cross-section model, surface treatment method, spraying color, and quality inspection standard number; aligning the qualified images according to the surface unfolding coordinates of the aluminum profiles; statistically analyzing the benchmark brightness range, benchmark color range, benchmark texture direction range, benchmark contour boundary range, and benchmark reflection response range of each surface area to generate a qualified benchmark image record; generating a structural allowable area record based on the cross-section contour benchmark data, cutting process documents, tooling contact position records, protective film attachment position records, inspection station layout records, and historical qualified image statistical results; and generating a data acquisition parameter benchmark record and a valid data acquisition judgment benchmark record based on the camera calibration record, light source calibration record, and historical valid image statistical results.
[0009] As a preferred embodiment of the aluminum profile surface defect detection and classification method of the present invention, the generation of effective surface image records corresponding to the unfolded coordinates of the aluminum profile surface includes: acquiring forward light images, oblique light images, low-angle grazing light images, and color images according to the surface area code and acquisition angle; binding images from different light sources according to the aluminum profile number, surface area code, entity location range, and image acquisition time range; performing distortion correction, brightness normalization, color correction, boundary positioning, and image stitching on the bound images; judging the acquisition quality based on the overexposed pixel ratio, underexposed pixel ratio, motion blur judgment result, image frame missing judgment result, edge misalignment judgment result, and occlusion area; writing areas that do not meet the acquisition quality requirements into invalid detection area records; and generating effective surface image records for image areas that meet the acquisition quality requirements.
[0010] As a preferred embodiment of the aluminum profile surface defect detection and classification method of the present invention, the calculation of region features and multi-light source response difference to generate defect candidate region records includes: comparing the effective surface image record with the detection comparison benchmark, and extracting brightness deviation region, color deviation region, texture direction deviation region, contour boundary deviation region, and reflection response deviation region; matching the extracted image deviation regions with structural allowable region records, invalid detection region records, acquisition parameter inconsistency records, light source acquisition abnormality records, and splicing abnormality records, and excluding regions belonging to acquisition abnormality, structural allowable range, boundary exclusion range, or isolated noise range; calculating the region area, region length, region width, region main direction, boundary continuity, grayscale deviation value, color deviation value, texture direction deviation value, contour deviation value, and multi-light source response difference for the retained abnormal regions to generate defect candidate region records.
[0011] As a preferred embodiment of the aluminum profile surface defect detection and classification method of the present invention, the calculation of region features and multi-source response difference to generate defect candidate region records includes: generating preliminary classification markers for anomaly sources based on multi-source response difference, color deviation value, and structural allowable region records. These preliminary classification markers include geometric undulation candidate markers, color / material candidate markers, composite deviation candidate markers, and structural boundary deviation candidate markers. When the multi-source response difference reaches the geometric undulation judgment threshold and the color deviation value does not reach the color / material judgment threshold, the corresponding anomaly region is marked as a geometric undulation candidate marker. When the color deviation value reaches the color / material judgment threshold and the multi-source response difference does not reach the geometric undulation judgment threshold, the corresponding anomaly region is marked as a color / material candidate marker. When both the multi-source response difference and the color deviation value reach their respective judgment thresholds, the corresponding anomaly region is marked as a composite deviation candidate marker. When the anomaly region is located within the structural allowable region and at least one of the grayscale deviation, color deviation, or contour deviation exceeds the corresponding allowable range in the structural allowable region record, the corresponding anomaly region is marked as a structural boundary deviation candidate marker.
[0012] As a preferred embodiment of the aluminum profile surface defect detection and classification method of the present invention, the generation of defect candidate region records includes: sorting the defect candidate region records according to the aluminum profile number, surface region code, entity length coordinates, and entity width coordinates; excluding defect candidate regions written into the acquisition anomaly exclusion record, boundary attribution exclusion record, or isolated noise exclusion record from the generation of continuous defect records; merging adjacent defect candidate regions into the same continuous defect record when they meet the requirements of the same aluminum profile number, continuous entity position, consistent main direction of the region, continuous region width change, consistent anomaly source preliminary classification mark, or meet the composite record judgment condition; generating discontinuous pending confirmation records when there are invalid detection areas, splicing anomaly areas, or length positioning anomaly records between adjacent defect candidate regions; generating continuous distribution types based on the entity position distribution of the continuous defect records, and generating deviation item types based on the anomaly source preliminary classification mark. Continuous distribution types include continuous records, periodic records, and local boundary records, while deviation item types include geometric undulation, color material, composite deviation, and structural boundary deviation.
[0013] As a preferred embodiment of the aluminum profile surface defect detection and classification method of the present invention, the step of verifying the process source and judging the surface quality by combining the production process record includes: reading the production process record, which includes mold number, extrusion batch, conveying device number, cutting station number, surface treatment batch number, spraying station number, spraying color, spraying batch number, and inspection station number; when the production process record is missing, or when the key fields in the production process record cannot be correlated with the aluminum profile number, a process record missing record is generated, and the classification status of the corresponding continuous defect record is marked as pending review; based on the continuous distribution type and deviation item... The system records the type and production process, verifies the process source of continuous defect records, and generates verification records for extrusion molding, conveyor contact, cutting end face, surface treatment, or spray coating. When only one source verification result is valid, a surface defect classification result is generated based on the valid source verification result. When more than one source verification result is valid, a source conflict record is generated, and the classification status of the corresponding surface defect classification result is marked as pending review. Based on the surface defect classification result, continuous defect records, quality inspection standard number, and aluminum profile application requirements, a defect event quality conclusion and an aluminum profile surface quality conclusion are generated.
[0014] As a preferred embodiment of the aluminum profile surface defect detection and classification method of the present invention, the step of updating the structural allowable area, defect sample record, defect classification judgment benchmark record, invalid detection area rules and acquisition parameter benchmark record based on the manual review results to generate the aluminum profile surface defect classification result write-back record includes: reading the manual review results and binding and saving the manual review results with the surface defect classification results, defect continuity records, effective surface image records and production process records; when the manual review confirms that the current area is not a defect and the current area is within the structural allowable range, generating a structural allowable area update record; when the manual review confirms that the current area is a defect, but the automatic classification result is inconsistent with the manually confirmed defect category, generating... The system generates update records for defect sample records and defect classification judgment benchmark records. When manual review confirms that a misjudgment originates from image acquisition quality or image stitching quality, it generates update records for invalid detection area rules and review records for acquisition parameters. When the allowable area of the structure, the defect classification judgment benchmark record, the invalid detection area rule, or the acquisition parameter benchmark record is updated, it generates rule version update records. When the rule version update record meets the effective conditions, it updates the effective status to "effective". When the number of manual review rejections in the trial batch reaches the rollback threshold, it generates rule rollback records. Based on the surface quality conclusion, manual review results, rule version update records, and rule rollback records, it generates a write-back record for the surface defect classification results of aluminum profiles.
[0015] Secondly, the present invention provides an aluminum profile surface defect detection and classification system, comprising: a surface unfolding and positioning module for generating aluminum profile surface unfolding coordinates with surface region codes, length coordinates, and width coordinates, and generating a basic image detection record; an effective image generation module for establishing a detection comparison benchmark, correcting, stitching, and judging the acquisition quality of multi-source surface images, and generating an effective surface image record; a defect candidate region extraction module for extracting image deviation regions, and generating a defect candidate region record after verification by excluding structurally permissible regions and abnormal acquisition records; and a defect continuous classification and write-back module for generating a defect continuous record based on the defect candidate region record, verifying the process source and judging surface quality in conjunction with production process records, and generating a write-back record of aluminum profile surface defect classification results based on the manual review results.
[0016] The beneficial effects of this invention are as follows: By generating basic image detection records and converting the acquired images into the surface coordinates of aluminum profiles, a unified correspondence is formed between image regions, surface region codes, and entity positions. This is used for defect candidate region extraction and cross-regional continuous judgment, achieving the beneficial effect of traceable defect location results. By generating continuous defect records and combining them with production process records for process source verification, the surface defect classification results can correspond to the extrusion, conveying, cutting, surface treatment, and spraying processes. Furthermore, based on the results of manual review, a write-back record of the aluminum profile surface defect classification results is formed, achieving the effect of updatable classification criteria. Attached Figure Description
[0017] To more clearly illustrate the technical solutions of the embodiments of the present invention, the accompanying drawings used in the description of the embodiments will be briefly introduced below. Obviously, the accompanying drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0018] Figure 1 This is a flowchart of a method for detecting and classifying surface defects in aluminum profiles.
[0019] Figure 2 This is a schematic diagram of an aluminum profile surface defect detection and classification system.
[0020] Figure 3 A flowchart for generating surface positioning and effective surface image recording of aluminum profiles.
[0021] Figure 4 This is a flowchart for defect candidate region extraction and preliminary anomaly source classification.
[0022] Figure 5 This is a graph showing the comparison of the consistency rate of continuous defect record verification under different equivalent defect length ranges.
[0023] Figure 6 This chart compares the consistency rates of process source verification under different defect categories. Detailed Implementation
[0024] To make the above-mentioned objects, features and advantages of the present invention more apparent and understandable, the specific embodiments of the present invention will be described in detail below with reference to the accompanying drawings.
[0025] Many specific details are set forth in the following description in order to provide a full understanding of the invention. However, the invention may also be practiced in other ways different from those described herein, and those skilled in the art can make similar extensions without departing from the spirit of the invention. Therefore, the invention is not limited to the specific embodiments disclosed below.
[0026] Secondly, the term "one embodiment" or "embodiment" as used herein refers to a specific feature, structure, or characteristic that may be included in at least one implementation of the present invention. The phrase "in one embodiment" appearing in different places in this specification does not necessarily refer to the same embodiment, nor is it a single or selective embodiment that is mutually exclusive with other embodiments.
[0027] Reference Figures 1-6 This is one embodiment of the present invention, which provides a method for detecting and classifying surface defects in aluminum profiles, including the following steps: S1. Obtain the production object information and image acquisition information of aluminum profiles. Based on the cross-sectional contour reference data, camera calibration records and encoder pulse positions, convert the acquired images into aluminum profile surface unfolding coordinates with surface area codes, length coordinates and width coordinates, and generate image detection basic records.
[0028] The system acquires production object information and image acquisition information for the aluminum profile to be inspected, and binds these information to the inspection station. Production object information includes the aluminum profile number, batch number, alloy grade, cross-section type, mold number, extrusion batch, heat treatment state, surface treatment method, coating color, conveying direction, inspection station number, quality inspection standard number, and process route number. Image acquisition information includes camera number, camera mounting position, camera mounting angle, acquisition angle, lens focal length, pixel size, light source number, light source angle, exposure time, acquisition frame rate, encoder pulse position, image acquisition time, and camera calibration record. Camera calibration record includes camera intrinsic parameters, camera extrinsic parameters, distortion correction parameters, pixel size conversion relationship, and the transformation relationship between the camera coordinate system and the inspection station coordinate system. Camera intrinsic parameters include focal length, principal point coordinates, and pixel ratio parameters; camera extrinsic parameters include the camera's rotation and translation parameters relative to the inspection station coordinate system.
[0029] The cross-sectional profile reference data is read based on the cross-sectional model. This data is generated from aluminum profile design drawings, mold cross-section files, or cross-sectional scanning data during production line documentation. It includes the sequence of boundary points on the outer contour of the cross-section, the starting point of surface development, the direction of surface development, the width of each surface area, the groove boundary, corner positions, end face reference positions, connection transition area positions, and the range of detectable surfaces. If the cross-sectional model in the production object information cannot read the corresponding cross-sectional profile reference data, or if the deviation between the actual acquired boundary and the cross-sectional profile reference data exceeds the allowable range for cross-sectional matching, a cross-sectional reference mismatch record is generated. This record includes the aluminum profile number, cross-sectional model, actual boundary position, reference boundary position, deviation value, and processing status. Before processing the cross-sectional reference mismatch record, the corresponding aluminum profile will not be included in the defect candidate area for extraction.
[0030] Based on the cross-sectional profile reference data, the outer surface of the aluminum profile is divided into front, back, side, corner, slot, end, and transition areas, with each area assigned a surface area code. The surface area code includes a cross-sectional model code, area type code, and area sequence code. The area type code distinguishes between the front, back, side, corner, slot, end, and transition areas; the area sequence code distinguishes between multiple surface areas of the same cross-sectional model but with different locations and the same area type. Each surface area code is bound to the unfolding start point, unfolding direction, area width, available viewing angle, inspection station number, and quality inspection standard number. For closed cavities, deep slots, narrow slits, or cross-sectional locations that cannot be directly imaged by the camera, these are marked as non-image detection areas in the cross-sectional profile reference data. Non-image detection areas represent solid areas where the camera cannot form an effective image, and are recorded separately from invalid detection areas where images have been acquired but the acquisition quality does not meet the inspection requirements.
[0031] Based on camera calibration records, a transformation relationship is established between image coordinates, camera coordinates, inspection station coordinates, and aluminum profile surface unfolding coordinates. Image coordinates represent the row and column positions of image pixels in the original acquired image; camera coordinates represent the camera imaging positions of image pixels after intrinsic, extrinsic, and distortion correction; inspection station coordinates represent the spatial positions of camera coordinates after transformation to the inspection station reference; aluminum profile surface unfolding coordinates include surface area encoding, length coordinates, and width coordinates. The length coordinates are determined along the aluminum profile conveying direction, and the width coordinates are determined along the unfolding direction of the corresponding surface area.
[0032] The length coordinates of the aluminum profile are determined based on the encoder pulse position, encoder resolution, and image acquisition time. ; in, This represents the length coordinates of the aluminum profile corresponding to each pixel in the image; Indicates the starting position for length calculation when the aluminum profile enters the inspection station; This represents the encoder pulse value corresponding to the current image acquisition moment; This indicates the encoder pulse value corresponding to the starting position of the length calculation; This indicates the aluminum profile conveying length corresponding to a single encoder pulse; The aluminum profile conveying speed corresponding to the image acquisition moment is calculated from the pulse values of adjacent encoders and the sampling time interval; Indicates the current image acquisition time; This indicates the encoder pulse value reading time. When the encoder pulse value is read synchronously with the image acquisition time, Zeroing is used; when the encoder pulse value and the image acquisition time are not synchronized, the length coordinate of the aluminum profile is compensated based on the time difference between the image acquisition time and the encoder pulse value reading time.
[0033] When encoder pulses are lost, bounced back, or the interval between adjacent pulses exceeds the allowable range of the conveyor speed, a length positioning anomaly record is generated. The length positioning anomaly record includes the aluminum profile number, inspection station number, abnormal pulse location, anomaly type, corresponding image frame, and processing status. Before the length positioning anomaly record is processed, the corresponding entity location will not be included in the defect candidate area for extraction.
[0034] The width coordinates are determined based on the surface unfolding start point, unfolding direction, and pixel size conversion relationship in the cross-sectional profile reference data. For planar surface regions, after projecting image pixels onto the corresponding surface region plane, the width coordinates are determined according to the distance from the surface unfolding start point to the projection point. For rounded corners, curved surfaces, or connecting transition regions, image pixels are projected onto the corresponding boundary point sequence in the cross-sectional profile reference data, and the width coordinates are determined according to the cumulative arc length of the boundary point sequence. If the same image pixel can be projected onto multiple adjacent surface regions, the assigned surface region is determined based on the angle between the acquisition viewpoint and the surface region's normal direction, the projection distance, and the region boundary position. If a unique assigned surface region cannot be determined, the corresponding position is written into the boundary assignment pending confirmation region record. Boundary assignment pending confirmation region records are not directly used as defect regions during defect candidate region extraction; when an image anomaly exists in this region, confirmation is made by combining the structurally permissible regions of adjacent surface regions and the verification image.
[0035] When unfolding images acquired by multiple cameras, the intrinsic, extrinsic, and distortion correction parameters of the corresponding camera are first read according to the camera number to correct the distortion of the original image. Then, based on the correspondence between the acquisition viewpoint and the surface region code, the pixels of the corrected image are converted into aluminum profile surface unfolding coordinates. Subsequently, images from different acquisition viewpoints are stitched together according to length and width coordinates. When adjacent cameras have overlapping acquisition areas, the boundary point sequence in the cross-sectional profile reference data and the stable edge position within the overlapping area are used as the stitching reference to generate an overlapping area stitching record. A stable edge position refers to an edge position where edge points can be extracted in continuously acquired images, the positional offset of the edge points in the aluminum profile surface unfolding coordinates does not exceed the edge position fluctuation threshold, and the corresponding edge point matches the boundary point sequence in the cross-sectional profile reference data. The edge position fluctuation threshold is determined based on camera calibration error, pixel size conversion relationship, allowable vibration range of the detection station, and the statistical results of the offset of the same edge position in historical valid images. The overlapping area stitching record includes camera number, overlapping surface region code, overlapping entity position range, stitching offset, stitching direction, and stitching status.
[0036] When the same entity location is covered by multiple acquisition viewpoints, the viewpoint angle, image sharpness, overexposed pixel ratio, underexposed pixel ratio, and occluded area are calculated for each acquisition viewpoint. The viewpoint angle refers to the angle between the acquisition viewpoint direction and the normal direction of the corresponding surface area. If all multiple acquisition viewpoints meet the following conditions: image sharpness reaches the sharpness threshold, overexposed pixel ratio does not exceed the overexposure ratio threshold, underexposed pixel ratio does not exceed the underexposure ratio threshold, and occluded area does not exceed the occluded area threshold, then the image with the smallest viewpoint angle is selected as the main detection image, and the remaining images are saved as verification images. If the image with the smallest viewpoint angle does not meet the acquisition quality requirements, then the image with the smallest viewpoint angle among the images that meet the acquisition quality requirements is selected as the main detection image. Image sharpness is determined based on the image edge gradient value or Laplacian response value; exposure status is determined based on the overexposed pixel ratio and underexposed pixel ratio; occlusion status is determined based on the area and location of the continuous occluded area. The sharpness threshold is determined based on the resolution, lens focal length, detection distance, and historical valid image sharpness statistics in the camera calibration record; the overexposure ratio threshold and underexposure ratio threshold are determined based on the camera dynamic range, light source brightness calibration record, and historical valid image exposure statistics; the occlusion area threshold is determined based on the planned acquisition area of the surface region, the occlusion record of the detection station, and the occlusion area statistics in manually confirmed valid images.
[0037] If the main inspection image is overexposed, underexposed, occluded, or has misaligned edges, and the verification image meets the main inspection image selection criteria, the verification image is switched to the main inspection image, and a viewpoint switching record is generated. The viewpoint switching record includes the original inspection image number, the image number after switching, the reason for switching, the corresponding surface region code, and the entity location range.
[0038] For the end face area, the end face inspection range is established based on the cutting station number, cutting time, aluminum profile length coordinates, and end face reference position. The end face inspection range includes the end face contour area, end face edge area, and end face influence area. The length coordinates of the end face area start from the end face reference position formed by the cutting; the coordinate range of the end face contour area is determined by the inner and outer contour boundaries; and the end face influence area extends inward along the length of the aluminum profile. The end face inspection range is linked to the end face area code, cutting station number, and quality inspection standard number.
[0039] For the slot and corner areas, the development relationship of the slot and corners is established based on the slot boundary, corner radius, connecting transition boundary, and available viewing angle in the cross-sectional profile reference data. When the inner side of the slot cannot be completely captured by the camera, the uncovered part is marked as a non-image detection area; when the slot boundary and corner transition area are covered by the camera but are prone to fixed shadows, the fixed shadow position range is saved and written into the image detection basic record. The fixed shadow mark is only used to determine the detection area and is not directly used as a basis for defect exclusion.
[0040] Generate basic image inspection records. These records should include at least the aluminum profile number, batch number, cross-section model, mold number, surface treatment method, coating color, surface area code, area type, image coordinate range, entity location range, length coordinate range, width coordinate range, acquisition angle, camera number, light source number, inspection station number, quality inspection standard number, main inspection image marker, verification image marker, non-image inspection area marker, fixed shadow marker, boundary attribution pending confirmation area record number, cross-section datum mismatch record number, length positioning anomaly record number, and record generation time.
[0041] After the basic image inspection record is generated, an index relationship is established based on the aluminum profile number, surface area code, and entity location range. This index relationship is used to retrieve image data, acquisition angle, light source information, cross-sectional area information, and quality inspection standard information corresponding to the same entity location during defect candidate area extraction, continuous defect record generation, process source verification, and review write-back processing. When production object information, cross-sectional contour reference data, camera calibration records, or encoder pulse data are missing, a basic data missing record is generated. This record includes the missing field, source of the missing data, corresponding aluminum profile number, corresponding inspection station number, and processing status. Before the basic data missing record is processed, the corresponding entity location will not be included in the defect candidate area extraction.
[0042] S2. Based on the image detection basic record, establish a detection comparison benchmark, correct, stitch and judge the acquisition quality of multi-source surface images, and generate an effective surface image record corresponding to the unfolded coordinates of the aluminum profile surface.
[0043] The system reads the aluminum profile number, cross-section model, surface area code, entity location range, surface treatment method, coating color, inspection station number, quality inspection standard number, main inspection image marker, verification image marker, and non-image inspection area marker from the image inspection basic record. Based on the cross-section model, surface treatment method, coating color, and quality inspection standard number, it determines the inspection comparison benchmarks required for the current aluminum profile inspection. The inspection comparison benchmarks include qualified benchmark image records, structural allowable area records, acquisition parameter benchmark records, and valid acquisition judgment benchmark records.
[0044] Before inspecting aluminum profiles, a qualified benchmark image record corresponding to the cross-section type, surface treatment method, coating color, and quality inspection standard number is read or generated. The qualified benchmark image record is generated from images of aluminum profiles with the same cross-section type, surface treatment method, and coating color, and which have been manually confirmed as qualified. Before the qualified sample image enters the benchmark generation process, it is aligned according to the surface development coordinates of the aluminum profile and then split into front area images, back area images, side area images, corner area images, slot area images, end face area images, and connecting transition area images according to surface area codes.
[0045] For each surface region, brightness data, color data, texture direction data, contour boundary data, and reflection response data are statistically analyzed to form a qualified reference image record bound to the surface region code. Brightness data includes the grayscale mean range and grayscale fluctuation range; color data is stored using RGB color components or Lab color components, and qualified reference image records corresponding to the same spraying color and the same surface treatment method use the same color space; texture direction data is determined based on the local image gradient direction, edge direction, or texture filtering results; contour boundary data is determined based on the cross-sectional contour reference data and the statistical results of the boundary positions of qualified samples; reflection response data consists of the grayscale mean range, grayscale difference range, or grayscale variation range of the same surface region in forward light images, oblique light images, and low-angle grazing light images.
[0046] The qualified benchmark image record includes the benchmark image number, cross-sectional model, surface treatment method, spraying color, surface area code, entity location range, benchmark brightness range, benchmark color range, benchmark texture direction range, benchmark contour boundary range, benchmark reflection response range, number of qualified samples, sample collection time range, and benchmark version number. The lower limit of the benchmark sample quantity is determined based on the surface area type, quality inspection standards, and historical fluctuations in images of similar aluminum profiles; it is determined by the number of qualified samples confirmed by manual quality inspection during initial filing, and is supplemented and updated during production based on qualified samples that have passed manual review. When the number of qualified samples in a certain surface area is less than the lower limit of the benchmark sample quantity, or when the brightness, color, or texture direction fluctuations among qualified samples exceed the corresponding allowable ranges, the surface area is marked as a benchmark area to be supplemented. The benchmark area to be supplemented retains the collected qualified sample data, but is not used as a separate basis for defect category judgment.
[0047] Based on the cross-sectional profile reference data, cutting process documents, tooling contact position records, protective film attachment position records, inspection station layout records, and historical qualified image statistics, a structural allowable area record is established. The structural allowable area includes the groove boundary area, the end-face cutting allowable texture area, the tooling contact allowable trace area, the protective film edge area, the normal corner shadow area, and the connection transition allowable texture area. The normal corner shadow area must simultaneously meet the fixed shadow position range in the image inspection baseline record and the historical qualified image statistics; it cannot be directly excluded based solely on fixed shadow markings.
[0048] The structural allowable area record includes the area number, surface area code, entity location range, allowable grayscale deviation range, allowable color deviation range, allowable contour deviation range, corresponding process source, effective batch range, and record version number. The allowable grayscale deviation range, allowable color deviation range, and allowable contour deviation range are determined based on historical qualified image statistics, camera calibration error, processing equipment accuracy, and quality inspection standards. Non-image detection areas represent entity areas where the camera cannot form an effective image; structural allowable areas represent entity areas that can be captured by the camera, but whose fixed grayscale, color, or contour variations are caused by groove boundaries, end-face textures, tooling contacts, protective film edges, corner shadows, or textures at connection transitions. Structural allowable areas are only used as a basis for exclusion verification before extracting candidate defect areas.
[0049] Establish baseline records for acquisition parameters and baseline records for valid acquisition judgment. The baseline records for acquisition parameters include camera number, light source number, exposure time, gain parameter, acquisition frame rate, allowable transport speed range, light source operating sequence, camera triggering method, and image saving format, and are saved separately according to the inspection station number, surface area code, and light source number. The baseline records for valid acquisition judgment include overexposed pixel ratio thresholds, underexposed pixel ratio thresholds, motion blur judgment thresholds, missing frame judgment thresholds, edge misalignment thresholds, occlusion area thresholds, and valid acquisition ratio thresholds. The baseline records for acquisition parameters and the baseline records for valid acquisition judgment are determined by camera calibration records, light source calibration records, inspection station debugging records, historical valid image statistics, and inspection station acquisition requirements.
[0050] When aluminum profiles pass through the inspection station, images are acquired under normal light, oblique light, low-angle grazing light, and color, according to the surface area code, main inspection image marker, and acquisition angle in the image inspection basic record. The acquisition angle corresponding to the main inspection image is prioritized for forming a valid surface image record; if the main inspection image does not meet the acquisition quality requirements, but the verification image does, the verification image marker is read and used to replace the main inspection image. The normal light image records the overall grayscale and color distribution of the surface; the oblique light image records the light and dark changes corresponding to minor indentations, scratches, and edge undulations; the low-angle grazing light image records the local shadows corresponding to scratches, pits, bumps, and coating particles; and the color image records the color changes corresponding to color differences, black spots, oxide spots, missed spraying, and exposed substrate.
[0051] Images from different light sources are bound together using the same aluminum profile number, surface area code, entity location range, and image acquisition time range to form a multi-source surface image group. If the entity location range deviation between images with forward lighting, oblique lighting, low-angle grazing light, or color exceeds the allowable range for multi-source registration, a multi-source image registration anomaly record is generated. The multi-source image registration anomaly record includes the aluminum profile number, surface area code, entity location range, anomaly light source number, location deviation value, allowable deviation range, and processing status. Before the multi-source image registration anomaly record is processed, the corresponding entity location will not be included in the defect candidate area extraction.
[0052] During the acquisition process, the baseline record of acquisition parameters is read, and the current camera trigger time, exposure time, gain parameter, acquisition frame rate, transport speed, light source trigger time, light source brightness detection value, and light source working sequence are compared. If the current acquisition parameters are inconsistent with the baseline record, an acquisition parameter inconsistency record is generated; if the current light source trigger time, light source brightness detection value, or light source working sequence is inconsistent with the baseline record, a light source acquisition anomaly record is generated. Both acquisition parameter inconsistency records and light source acquisition anomaly records include the aluminum profile number, detection station number, camera number, light source number, anomaly field, current value, baseline value, and processing status.
[0053] After the multi-source surface image group is acquired, distortion correction is performed on the original images according to the camera calibration record, and the image brightness is normalized according to the acquisition parameter benchmark record. Brightness normalization is based on the background brightness range of the qualified benchmark image within the same surface area, and the average brightness of the background area in the current image after excluding surface area boundaries, slot boundaries, end face edges, structural allowable areas, and marked invalid detection areas. For color images, white balance correction and color space conversion are performed on the color components respectively, and the color component data is saved. The corrected images are rearranged according to the aluminum profile surface unfolding coordinates to form a surface unfolding image corresponding to the entity's position range.
[0054] Boundary localization and image stitching are performed on the unfolded surface image. Boundary localization is based on the boundary point sequence in the cross-sectional profile reference data, the surface region code in the image detection baseline record, and the stable edge position in the current image. When there is an overlapping area between adjacent acquired viewpoint images, the stitching offset and stitching direction in the overlapping area stitching record are read to align the adjacent images. If the image boundary deviation within the overlapping area exceeds the allowable stitching range, a stitching anomaly record is generated. The stitching anomaly record includes the aluminum profile number, surface region code, camera number, overlapping entity position range, boundary deviation value, stitching status, and processing status. Before the stitching anomaly record is processed, the corresponding overlapping entity position is not included in the defect candidate region extraction.
[0055] The quality of the surface unfolded image is assessed, including overexposure, underexposure, motion blur, missing frames, edge misalignment, and occlusion. Overexposure is determined by the proportion of overexposed pixels, underexposure by the proportion of underexposed pixels, motion blur by the magnitude of edge gradient descent or edge stretching length in consecutive image frames, missing frames by camera trigger records and image acquisition time series, edge misalignment by the deviation between the current boundary position and the cross-sectional contour reference data, and occlusion by the area and location of consecutive occluded regions. Thresholds for overexposure pixel ratio, underexposure pixel ratio, motion blur, missing frames, edge misalignment, and occlusion area are read from the valid acquisition assessment reference records.
[0056] When overexposed, underexposed, motion blurring, missing frames, misaligned edges, or occluded areas exist in the surface unfolded image, the corresponding entity location range is written into the invalid detection area record. The invalid detection area record includes the invalid area number, aluminum profile number, surface area code, entity location range, image frame number, reason for invalidity, corresponding camera number, corresponding light source number, acquisition parameters, and processing status. Invalid detection areas represent regions where images have been acquired but the acquisition quality does not meet the detection requirements and are not included in defect candidate area extraction.
[0057] For each surface region, the effective acquisition area ratio is calculated as follows: ; in, Indicates the proportion of the effective collection area; This represents the area of the image within the current surface region that has been acquired, unfolded, and is not marked as an invalid detection area or a stitching anomaly area; This indicates the planned acquisition area for image detection in the current surface region; Excluding non-image detection regions; when When the value is zero, only non-image detection area association records are generated for the corresponding surface area, and the effective acquisition area ratio is not calculated.
[0058] When the effective acquisition area ratio is less than the effective acquisition ratio threshold, a re-acquisition record is generated. The re-acquisition record includes the aluminum profile number, surface area code, entity location range, current effective acquisition area ratio, effective acquisition ratio threshold, reason for failure, suggested adjustments to acquisition parameters, and processing status. The effective acquisition ratio threshold is read from the effective acquisition judgment benchmark record. Before the re-acquisition record is processed, the corresponding surface area is not included in the defect candidate area extraction; if re-acquisition is not possible due to process cycle time limitations, an acquisition review record is generated, and the corresponding surface area is marked as a manual review area.
[0059] After completing the quality assessment, valid surface image records are generated. Valid surface image records include the aluminum profile number, batch number, cross-section model, surface treatment method, coating color, surface area code, entity location range, image number under normal light, image number under oblique light, image number under low-angle grazing light, color image number, brightness normalization parameter, color correction parameter, image stitching status, invalid detection area record number, re-acquisition record number, acquisition verification record number, multi-source image registration anomaly record number, light source acquisition anomaly record number, acquisition parameter inconsistency record number, and record generation time.
[0060] Valid surface image records are bound to qualified reference image records, structural allowable area records, acquisition parameter reference records, and valid acquisition judgment reference records according to the aluminum profile number, surface area code, and entity location range. This binding relationship is used to read the current image data, reference image data, structural allowable area data, acquisition parameter data, overexposed pixel ratio, underexposed pixel ratio, motion blur judgment result, missing frame judgment result, edge misalignment judgment result, and occlusion area of the same entity location when extracting defect candidate areas. When qualified reference image records, structural allowable area records, acquisition parameter reference records, valid acquisition judgment reference records, or valid surface image records are missing, a detection comparison reference missing record is generated. The detection comparison reference missing record includes the missing object type, corresponding aluminum profile number, surface area code, entity location range, missing source, and processing status; before the detection comparison reference missing record is processed, the corresponding entity location will not be included in the defect candidate area extraction.
[0061] S3. Based on the effective surface image record and detection comparison benchmark, extract the image deviation area. After verification by excluding the structurally permissible area and abnormal acquisition records, calculate the regional features and the multi-source response difference to generate defect candidate area records.
[0062] The system reads valid surface image records, qualified reference image records, structural allowable area records, invalid detection area records, splicing anomaly records, acquisition parameter inconsistency records, light source acquisition anomaly records, multi-light source image registration anomaly records, valid acquisition judgment reference records, and missing detection comparison reference records, and matches them according to the aluminum profile number, surface area code, and entity location range. When a valid surface image record, qualified reference image record, valid acquisition judgment reference record, or defect candidate extraction judgment reference record is missing, a candidate region extraction termination record is generated. This record includes the aluminum profile number, surface area code, entity location range, missing object type, missing fields, and processing status. Before the candidate region extraction termination record is processed, the corresponding entity location does not participate in defect candidate region extraction.
[0063] Establish a defect candidate extraction and judgment benchmark record. This record includes thresholds for abnormal region merging distance, geometric undulation judgment, color and material judgment, texture direction judgment, contour deviation judgment, minimum candidate area threshold, and boundary attribution confirmation distance. These thresholds are stored according to cross-section type, surface treatment method, coating color, surface area code, and quality inspection standard number. The abnormal region merging distance threshold is determined based on image resolution, camera calibration error, and statistical results of historical spacing between similar defect areas; the minimum candidate area threshold is determined based on image resolution, the minimum defect size allowed by the quality inspection standard, and statistical results of historical noise area area.
[0064] Image denoising and region alignment are performed on the forward-lit images, oblique-lit images, low-angle grazing-lit images, and color images from the effective surface image records, respectively. Image denoising employs one or more of median filtering, mean filtering, or Gaussian filtering to remove isolated noise points. Region alignment uses the aluminum profile surface unfolding coordinates, surface region encoding, and entity location range as a reference, ensuring that the same entity location in images from different light sources corresponds to the same image region. Before processing multi-light source image registration anomaly records, the corresponding entity locations are not included in the multi-light source response difference calculation; before processing splicing anomaly records, the corresponding overlapping entity locations are not included in the defect candidate region extraction.
[0065] The valid surface image is compared with a qualified reference image to extract an initial set of anomalous regions. The comparison includes brightness deviation, color deviation, texture direction deviation, contour boundary deviation, and reflection response deviation. Brightness deviation is determined by comparing the grayscale value of the current forward-lit image with the reference brightness range; color deviation is determined by comparing the RGB or Lab color components in the color image with the reference color range; texture direction deviation is determined by comparing the local gradient direction, edge direction, or texture filtering result of the current image with the reference texture direction range; contour boundary deviation is determined by comparing the current boundary position with the reference contour boundary range; and reflection response deviation is determined by comparing the grayscale response of the same entity location in the forward-lit image, oblique-lit image, and low-angle grazing-lit image with the reference reflection response range.
[0066] When a qualified reference image record corresponding to the current entity location is marked as a reference area to be supplemented, the initial abnormal area is not extracted solely based on this qualified reference image record. Instead, the reference data of adjacent surface areas, structural allowable area records, and manual review records are read and compared simultaneously. If the comparison cannot be completed, a reference supplement verification record is generated. The reference supplement verification record includes the aluminum profile number, surface area code, entity location range, reference area number to be supplemented number, missing data type, and processing status.
[0067] Region markers are generated for brightness deviation areas, color deviation areas, texture direction deviation areas, contour boundary deviation areas, and reflection response deviation areas. Adjacent or overlapping region markers are merged according to the entity location range to obtain the initial abnormal region. Region merging conditions include consistent surface region codes, continuous entity locations, image region connectivity, or region spacing less than the abnormal region merging distance threshold. If an abnormal region crosses adjacent surface regions, and the crossing location is within the boundary belonging to the region to be confirmed, candidate region sub-records for the corresponding surface regions are generated, and the same cross-region candidate number is saved for merging judgment when generating continuous defect records.
[0068] Initial abnormal areas are excluded and verified. If an initial abnormal area falls within the corresponding entity location range of an invalid detection area record, an inconsistent acquisition parameter record, a light source acquisition abnormality record, or a splicing abnormality record, the initial abnormal area is written into the acquisition abnormality exclusion record. The acquisition abnormality exclusion record includes the aluminum profile number, surface area code, entity location range, abnormality source record number, exclusion reason, and processing status. Acquisition abnormality exclusion records are not considered as defect candidate areas.
[0069] When the initial anomaly region coincides with the structural allowable region record in terms of entity location, the allowable grayscale deviation range, allowable color deviation range, and allowable contour deviation range in the structural allowable region record are read. If the grayscale deviation, color deviation, and contour deviation of the initial anomaly region do not exceed the corresponding allowable range, then the initial anomaly region is written into the structural allowable exclusion record. If the initial anomaly region is located within the structural allowable region, but at least one of the grayscale deviation, color deviation, or contour deviation exceeds the corresponding allowable range, then the initial anomaly region is retained and marked as a candidate for structural boundary deviation. Fixed shading is not used as an exclusion condition alone.
[0070] When the initial abnormal region is located within the boundary attribution confirmation area record, the valid surface image record, structurally permissible area record, and verification image of the adjacent surface regions are read. If the same deviation item exists at the same entity location in adjacent surface regions, including brightness deviation, color deviation, texture direction deviation, contour boundary deviation, or reflection response deviation, and the distance between the deviation region and the boundary point sequence is less than the boundary attribution confirmation distance threshold, it is retained as a defect candidate region. If the deviation only occurs from a single acquisition viewpoint, and the verification image does not meet the same deviation item condition, the region is written into the boundary attribution exclusion record.
[0071] After completing the exclusion verification, the region features are calculated for the remaining initial abnormal regions. Region features include region area, region length, region width, region bounding rectangle, region principal direction, boundary continuity, grayscale deviation value, color deviation value, texture direction deviation value, contour deviation value, and multi-light source response difference. The region area is calculated according to the conversion relationship between image pixel area and pixel size; the region length and width are calculated according to the solid length and width directions in the unfolded coordinates of the aluminum profile surface; the region principal direction is determined based on the major axis direction obtained from the distribution covariance of pixels within the region along the length and width directions of the aluminum profile, or based on the long side direction of the region's minimum bounding rectangle; boundary continuity is recorded as the total number of boundary points, the number of breakpoints, the length of the longest continuous boundary, and the boundary closure marker.
[0072] Color deviation values are determined based on the difference between the mean color component value of the abnormal area in the current color image and the reference color range in the qualified reference image record; when using Lab color components, the L component, a component, and b component are compared separately; when using RGB color components, the red component, green component, and blue component are compared separately. Grayscale deviation values, texture direction deviation values, and contour deviation values are determined based on the difference between the current abnormal area data and the corresponding reference range.
[0073] For each remaining initial anomaly region, the multi-source response difference is calculated as follows: ; in, This indicates the difference in response among multiple light sources; This represents the average gray value of the current abnormal region in a low-angle grazing light image after brightness normalization. This represents the average gray value of the same abnormal region in a positively lit image after brightness normalization. This represents a correction value to prevent the denominator from being zero. It is determined based on the smallest non-zero gray value after gray-level normalization. and The coordinate range is expanded for the same entity location, the same anomaly region, and the same surface. Brightness normalization is performed based on the brightness normalization parameters in the effective surface image record; It is used to determine the degree of grayscale change of abnormal areas in low-angle grazing light images relative to normal light images, and is not directly output as a defect category.
[0074] An initial classification of anomalies is formed based on the differences in multi-source response, color deviation, texture direction deviation, and contour deviation. When the difference in multi-source response reaches the geometric undulation judgment threshold, but the color deviation does not reach the color material judgment threshold, the anomaly area is marked as a candidate marker for geometric undulation. Candidate markers for geometric undulation correspond to areas to be classified such as scratches, abrasions, dents, indentations, bumps, or coating particles. When the color deviation reaches the color material judgment threshold, but the difference in multi-source response does not reach the geometric undulation judgment threshold, the anomaly area is marked as a candidate marker for color material. Candidate markers for color material correspond to areas to be classified such as color difference, black spots, oxidation spots, oil stains, missed spraying, or exposed substrate. When both the difference in multi-source response and the color deviation reach their respective judgment thresholds, the anomaly area is marked as a candidate marker for composite deviation. When the anomaly area is within the allowable structural area and at least one deviation exceeds the corresponding allowable range, the anomaly area is marked as a candidate marker for structural boundary deviation.
[0075] The defect candidate extraction and judgment benchmark record includes a geometric undulation judgment threshold and a color and material judgment threshold. The geometric undulation judgment threshold is determined based on historical qualified samples with the same cross-section model, surface treatment method, and surface area code. The processor calculates the multi-source response difference between the low-angle grazing light image and the forward light image of the corresponding entity region in the historical qualified samples. After excluding samples with abnormal acquisition records, the geometric undulation judgment threshold is generated based on the statistical upper limit of the multi-source response difference of the historical qualified samples, combined with camera calibration error. The color and material judgment threshold is determined based on historical qualified samples with the same spray color or surface treatment method. The processor calculates the color deviation value of the corresponding entity region of the color image in the historical qualified samples. After excluding samples with abnormal light source acquisition records, the color and material judgment threshold is generated based on the statistical upper limit of the color deviation value of the historical qualified samples, combined with light source brightness calibration records and quality inspection standards. Texture direction deviation value and contour deviation value are written into the defect candidate area record for defect continuity record generation, process source verification, and defect sub-class judgment. They are not used as threshold conditions for preliminary classification of abnormal sources.
[0076] When the difference in response from multiple light sources reaches the geometric fluctuation judgment threshold, and the color deviation value does not reach the color material judgment threshold, a candidate label for geometric fluctuation is generated; when the color deviation value reaches the color material judgment threshold, and the difference in response from multiple light sources does not reach the geometric fluctuation judgment threshold, a candidate label for color material is generated; when both the difference in response from multiple light sources and the color deviation value reach the corresponding judgment threshold, a candidate label for composite deviation is generated; when the abnormal area is located within the allowable area of the structure, and the grayscale deviation, color deviation, or contour deviation exceeds the allowable range recorded in the allowable area of the structure, a candidate label for structural boundary deviation is generated.
[0077] If the area of the remaining initial abnormal region is less than the minimum candidate area threshold, and the region is not connected to adjacent abnormal regions, the region is written into the isolated noise exclusion record. If multiple small-area abnormal regions appear consecutively within the same entity location range, and the distance between the regions is less than the abnormal region merging distance threshold, then isolated noise exclusion is not performed, and the multiple small-area abnormal regions are merged into a single defect candidate region.
[0078] Generate a defect candidate region record. This record includes the candidate region number, aluminum profile number, batch number, cross-section type, surface treatment method, coating color, surface area code, image coordinate range, entity location range, region area, region length, region width, main direction of the region, total number of boundary points, number of breakpoints, longest continuous boundary length, boundary closure marker, grayscale deviation value, color deviation value, texture direction deviation value, contour deviation value, multi-light source response difference, preliminary anomaly source classification marker, structurally permissible region number, acquisition anomaly verification result, structurally permissible verification result, isolated noise verification result, cross-region candidate number, and record generation time. Excluded regions are stored in the acquisition anomaly exclusion record, structurally permissible exclusion record, boundary attribution exclusion record, and isolated noise exclusion record, respectively, and are not included in the defect candidate region record.
[0079] After the defect candidate area records are generated, they are sorted according to the aluminum profile number, surface area code, and entity length coordinates, and bound to the valid surface image records, qualified reference image records, structural allowable area records, valid acquisition judgment reference records, and defect candidate extraction judgment reference records. This binding relationship is used to read the candidate area size, location, main direction, multi-light source response difference, color deviation value, structural allowable verification results, acquisition anomaly verification results, and cross-area candidate numbers for the same entity location when generating continuous defect records.
[0080] S4. Based on the entity location, main direction of the region, changes in region width, and preliminary classification markers of anomaly sources in the defect candidate region record, generate a continuous defect record. Combine the production process record to verify the process source and judge the surface quality. Update the allowable area of structure, defect sample record, defect classification judgment benchmark record, invalid detection area rules, and acquisition parameter benchmark record according to the manual review results, and generate a write-back record of aluminum profile surface defect classification results.
[0081] The system reads records of candidate defect areas, valid surface images, basic image detection records, permissible structural areas, anomaly removal records, boundary attribution removal records, isolated noise removal records, defect candidate extraction and judgment benchmark records, production process records, historical continuous defect records, manual review records, production quality records, quality inspection standard numbers, and aluminum profile application requirements. These records are then sorted by aluminum profile number, batch number, cross-section type, surface treatment method, coating color, surface area code, entity length coordinates, and entity width coordinates. Candidate areas written into the anomaly removal records, boundary attribution removal records, or isolated noise removal records do not participate in the generation of continuous defect records; they are only saved as review prompt data. When there are unprocessed anomaly verification results, boundary attribution pending confirmation areas, intermittent pending confirmation records, or missing process records, the corresponding continuous defect record and subsequent surface quality judgment results are marked as pending review, and no conclusions of "qualified," "rework," "downgraded," or "scrapped" are directly generated.
[0082] The production process record includes mold number, extrusion batch, conveyor device number, conveyor roller circumference, clamping device spacing, periodic contact component running spacing, cutting station number, cutting time, surface treatment batch number, cleaning station number, anodizing station number, spraying station number, spraying color, spraying batch number, and inspection station number. If a production process record is missing, or if a key field cannot be correlated with the aluminum profile number, a missing process record is generated. Before the missing process record is processed, the corresponding continuous defect records can only generate candidate defect categories and review prompts; a unique defect category cannot be output.
[0083] Establish continuous defect record judgment benchmark records and surface quality judgment benchmark records. The continuous defect record judgment benchmark records include continuous interval thresholds, direction difference thresholds, width variation thresholds, response difference variation thresholds, color deviation variation thresholds, allowable error for periodic intervals, continuous length judgment thresholds, minimum number of periodic records thresholds, local boundary judgment ranges, event merging distance thresholds, and composite record judgment conditions. Each judgment benchmark is determined based on image acquisition frame rate, aluminum profile conveying speed, camera calibration error, image resolution, historical records of similar defects, light source stability, production equipment assembly error, encoder positioning error, quality inspection standards, and production quality records. The surface quality judgment benchmark records include quality inspection standard number, aluminum profile application type, defect category, prohibited defect conditions, allowable defect range, rework judgment range, downgrade judgment range, scrap judgment range, and manual review trigger conditions, and are stored separately according to cross-section model, surface treatment method, coating color, and quality inspection standard number.
[0084] Continuity verification is performed on defect candidate area records. Adjacent defect candidate areas that simultaneously meet the following criteria are merged into a single continuous defect record: belonging to the same aluminum profile number, having the same surface area code or the same candidate number across areas, having an entity length coordinate interval less than a continuous interval threshold, having a main direction difference less than a direction difference threshold, having an area width change ratio less than a width change threshold, having consistent preliminary anomaly source classification markers, or meeting the composite record judgment conditions, and where there are no unprocessed collected anomaly records at the corresponding entity location. Composite record judgment conditions include continuous entity location, at least one adjacent candidate area having a composite deviation candidate marker, and a multi-light source response difference change less than a response difference change threshold or a color deviation value change less than a color deviation change threshold. If the composite record judgment conditions are not met, defect candidate areas with different preliminary anomaly source classification markers are generated as independent continuous defect records.
[0085] The width variation ratio is calculated based on the width of adjacent defect candidate regions and expressed as follows: ; in, Indicates the percentage change in width; This indicates the width of the current defect candidate region in the coordinate system of the aluminum profile surface. This represents the width of the preceding adjacent defect candidate region in the coordinate system of the aluminum profile surface. This represents a correction value to prevent the denominator from being zero. The width is determined based on the minimum non-zero width after pixel size conversion. The width variation ratio is used to determine whether adjacent defect candidate regions belong to the same continuous defect record, and is not directly output as the defect category. and When all values are less than the minimum candidate area threshold, the width change ratio is no longer used as the sole criterion for merging. Instead, the judgment is made by combining the entity length coordinate interval, the difference in the main direction of the region, and the preliminary classification mark of the anomaly source.
[0086] When a single defect candidate region has no adjacent defect candidate regions that can be merged, a single-region defect continuity record is generated. If there are invalid detection regions, splicing anomaly regions, or length positioning anomaly records between adjacent defect candidate regions, they are not directly merged. If the main direction, region width, and preliminary anomaly source classification markers of the candidate regions on both sides of the interval are consistent, a discontinuous pending confirmation record is generated. When adjacent candidate regions have different surface region codes but the same cross-region candidate number and continuous entity length coordinates, the candidate region sub-records of each surface region are retained, and a cross-region continuity marker is written into the defect continuity record. When a cross-region candidate region is written into the boundary attribution exclusion record, it does not participate in cross-region merging.
[0087] Generate a continuous defect record. The continuous defect record includes the continuous record number, aluminum profile number, batch number, cross-section type, surface treatment method, paint color, surface area code, starting entity position, ending entity position, number of candidate areas, continuous length, maximum width, average width, main extension direction, average multi-light source response difference, average color deviation value, average texture direction deviation value, average contour deviation value, preliminary anomaly source classification mark, cross-region continuous mark, discontinuous pending confirmation record number, continuous status, and record generation time. The continuous length is determined based on the difference in entity length between the starting and ending entity positions; the main extension direction is determined based on the statistical results of the main directions of the candidate defect areas participating in the merging; and each average value is calculated based on the records of the candidate defect areas participating in the merging.
[0088] Based on the physical location distribution of continuous defect records, a continuous distribution type is generated, and a deviation item type is generated based on the preliminary classification and labeling of the anomaly source. Continuous distribution types include continuous records, periodic records, and local boundary records; deviation item types include geometric undulations, color and material deviations, composite deviations, and structural boundary deviations. When a continuous defect record extends along the length of the aluminum profile and the continuous length reaches the continuous length judgment threshold, it is marked as a continuous record; when it repeatedly appears in the same surface area or on the same conveying contact surface, the number of repetitions reaches the minimum number threshold for periodic records, and the distance between adjacent centers meets the periodic interval matching condition, it is marked as a periodic record; when it is located in the end face area, corner area, slot boundary area, or cutting influence area, and the physical location falls within the local boundary judgment range, it is marked as a local boundary record.
[0089] The conveying contact surface is determined based on the conveying device number, roller contact position, clamping device contact position, aluminum profile conveying posture, and surface area coding. The periodic interval matching condition is determined by comparing the center-to-center distance of consecutive adjacent defect records with the periodic contact distance of the equipment. ; in, Indicates the difference in period intervals; This represents the distance between the center points of adjacent defect consecutive records along the length of the entity. The center point is determined by the midpoint between the starting and ending entity positions of the defect consecutive record. This represents the reference spacing in the production process record. The reference spacing includes the circumference of the conveyor rollers, the spacing of the clamping devices, or the running spacing of periodically contacting components. When multiple reference spacings exist, the period interval difference is calculated separately, and the reference spacing with the smallest value that is less than or equal to the allowable error of the period interval is selected as the matching result, and the corresponding reference spacing type is saved.
[0090] Read historical defect continuity records, manual review records, and production quality records, and verify the process source of the defect continuity records. A continuous defect record is generated when the directional difference between the main extension direction and the aluminum profile extrusion direction is less than the directional difference threshold, the continuous length reaches the extrusion molding category, and there are continuous texture deviation records of the same surface area in the historical records of the same mold number, extrusion batch, or cross-section model. If the verification is successful, it is classified as an extrusion molding defect, and further classified as longitudinal scratch, mold pattern, or surface ripple based on the scratch width range, die pattern spacing range, and ripple grayscale variation range.
[0091] When the continuous defect record is a periodic record and the surface area is a conveyor contact surface, the conveyor device number, conveyor roller circumference, clamping device spacing, and periodic contact component running spacing are read. When the period interval difference is less than or equal to the period interval allowable error and the deviation item type is geometric fluctuation or compound deviation, a conveyor contact source verification record is generated. When the verification is successful, it is classified as a conveyor contact defect and classified as scratch, abrasion, roller mark, or indentation according to the scratch width range, scratch width range, roller mark spacing range, indentation closure area range, and multi-light source response difference. When a continuous defect record is a local boundary type record, and the entity location is in the end face area, corner area, groove boundary area, or cutting influence area, the cutting station number, cutting time, end face reference position, end face allowable deviation, and corner allowable deviation are read. When the contour deviation value of the continuous defect record exceeds the end face allowable deviation or corner allowable deviation, and there is a corresponding relationship with the cutting station number, cutting time, or end face reference position, a cutting end face source verification record is generated. When the verification is successful, it is classified as a cutting end face defect, and classified as end face burr, end face chipping, or corner bumping according to the burr protrusion height range, burr width range, chipped edge contour missing area range, and corner entity position deviation range. If the deviation item type is color material, the average color deviation value reaches the color material judgment threshold, the average multi-light source response difference does not reach the geometric fluctuation judgment threshold, and the continuous defect records have a corresponding relationship with the surface treatment batch number, cleaning station number, or oxidation treatment station number, a surface treatment source verification record is generated. When the verification is successful, it is classified as a surface treatment defect, and classified as oxidation spot, black spot, watermark, color difference, or oil stain according to the spot area range, spot number range, watermark width range, watermark length direction range, color difference area ratio range, and low reflectance grayscale range. When consecutive defect records appear at the post-coating inspection station, and the average color deviation value reaches the color material judgment threshold, or when there are candidate markers for geometric undulations corresponding to coating particles, the spraying station number, spraying color, spraying batch number, and post-coating inspection station number are read. If the post-coating inspection station number matches the inspection station number, the spraying batch number has a batch binding relationship with the aluminum profile number, and the spraying color or spraying station number is consistent, a coating film source verification record is generated. If only one of the spraying color, spraying station number, or spraying batch number is consistent, a coating film source pending verification record is generated. When the verification is successful, it is classified as a coating film defect, and further classified into spraying particles, exposed substrate, missed coating, uneven coating color fluctuation range, and orange peel texture undulation spacing range according to the particle area range, particle height response range, substrate color distance range, missed coating coverage range, uneven coating color fluctuation range, and orange peel texture undulation spacing range.
[0092] When consecutive records of the same defect meet multiple source verification conditions, a source conflict record is generated. If there are unprocessed abnormal collection verification results, unconfirmed boundary attribution areas, unconfirmed intermittent records, or unconfirmed cross-regional candidate numbers, the classification status is marked as pending review, and no unique defect category is output. If only one source verification result is valid, the surface defect classification result is output according to the valid source verification result. The surface defect classification result includes aluminum profile number, batch number, cross-section model, surface treatment method, spray color, surface area code, consecutive defect record number, consecutive distribution type, deviation item type, defect category, source verification record number, entity location range, continuous length, maximum width, average multi-light source response difference, average color deviation value, classification status, and review prompt.
[0093] Surface quality assessment data records are generated based on the surface defect classification results. These records include the defect continuation record number, defect category, continuous length, maximum width, average width, entity location range, surface region code, continuous distribution type, deviation item type, defect area, defect quantity, and defect location. The defect area is calculated based on the union area of candidate defect regions participating in the same continuation record on the aluminum profile surface in the unfolded coordinate system; overlapping areas are calculated only once. The defect quantity is determined based on the number of continuation records for the same aluminum profile, the same surface region, and the same defect category. The defect location is determined based on the length coordinate range, width coordinate range, and surface region code in the image detection baseline record. The surface quality assessment data records are compared with the surface quality assessment benchmark record. First, a defect event quality conclusion is generated, and then, based on the quality conclusions of all defect events for the same aluminum profile, a final aluminum profile surface quality conclusion is generated. When the defect type, location, length, width, area, and number of defects are all within the allowable range, it is recorded as qualified; when it enters the reworkable range but does not exceed the rework judgment range, it is recorded as rework; when it does not meet the target application requirements but meets the downgrade judgment range, it is recorded as downgraded use; when it reaches the scrap judgment range, it is recorded as scrap; when the classification status is pending review, source verification result conflict, image acquisition abnormality not processed, or process record missing, it is recorded as manual review. When the same aluminum profile meets multiple surface quality conclusion conditions at the same time, the current output conclusion is determined in the order of manual review, scrap, rework, downgraded use, and qualified; after the reason for manual review is resolved, the surface quality conclusion of the aluminum profile is regenerated in the order of scrap, rework, downgraded use, and qualified.
[0094] When multiple consecutive defect records of the same defect category exist on the same aluminum profile, defect events are merged based on the continuity of entity location, surface area coding, and consistency of defect category. If the entity length interval between adjacent consecutive defect records is less than the event merging distance threshold, and the defect categories and deviations from the project type are consistent, they are merged into the same defect event. If adjacent consecutive defect records have different categories but overlapping entity locations or an interval less than the event merging distance threshold, a composite defect event record is generated. Before processing the composite defect event record, the defect event quality conclusion for the corresponding surface area is recorded as requiring manual review.
[0095] Batch statistics are performed on the surface defect classification results of the same batch of aluminum profiles. When the number of aluminum profiles that have completed testing in the same batch is less than the lower limit of the batch statistics, a batch statistics supplementary record is generated. After the lower limit of the batch statistics is reached, if the same defect category appears repeatedly in the same surface area of aluminum profiles of the same batch, with the same cross-section, the same surface treatment method, or the same spraying color, and the number of repetitions reaches the batch warning quantity threshold, a batch anomaly warning record is generated. A surface quality output record is generated, recording the aluminum profile number, batch number, quality inspection standard number, defect event number, entity location range, defect statistics, source verification record number, defect event quality conclusion, aluminum profile surface quality conclusion, and image storage address.
[0096] After manual review, the results are read and bound to the surface defect classification results, continuous defect records, effective surface image records, and production process records. If manual review confirms that the current area is not a defect, and the area is consistent with the cross-sectional structure, tooling contact position, protective film edge, end face allowable texture, or connection transition allowable texture, a structural allowable area update record is generated and limited to use within the same cross-sectional model, same surface treatment method, same inspection station, same surface area code, same acquisition angle, and same light source configuration. If manual review confirms that the current area is a defect, but the automatic classification result is inconsistent with the manually confirmed defect category, a defect sample update record and a defect classification judgment benchmark update record are generated. The updated range is determined based on the minimum, maximum, mean, and standard deviation of the corresponding judgment field in the manually confirmed sample. If it exceeds the allowable range of the quality inspection standard, it will not take effect directly, and a range update pending confirmation record will be generated.
[0097] If the manual review confirms that the misjudgment is due to overexposure, underexposure, motion blur, missing image frames, edge misalignment, occlusion, abnormal registration of multi-source images, or abnormal splicing, then an invalid detection area rule update record and a collection parameter review record will be generated. If the manual review confirms that the automatic classification result is correct, then a review confirmation sample record will be generated to supplement the manual confirmation samples under the same cross-section model, same surface treatment method, same spraying color, and same quality inspection standard number.
[0098] When the structural allowable area, defect candidate extraction judgment benchmark record, defect continuous record judgment benchmark record, surface quality judgment benchmark record, invalid detection area rule, or acquisition parameter benchmark record is updated, a rule version update record is generated. The rule version update record includes the updated object type, previous version number, updated version number, updated fields, update reason, associated manual review result number, applicable cross-section model, applicable surface treatment method, applicable spraying color, applicable detection station, and effective status. When the number of manually reviewed samples reaches the lower limit for the number of effective samples, and the number of manually reviewed rejections in the trial batch does not reach the rollback threshold, the effective status is updated to "effective"; otherwise, it remains "pending confirmation." When the number of manually reviewed rejections in the trial batch reaches the rollback threshold, a rule rollback record is generated.
[0099] After completing classification, quality assessment, manual review, and rule version processing, the aluminum profile surface defect classification result write-back record is output. This record includes the aluminum profile number, batch number, surface quality output record number, manual review result number, structural allowable area update record number, defect sample update record number, defect classification judgment benchmark record update record number, invalid detection area rule update record number, acquisition parameter review record number, rule version update record number, and rule rollback record number. The aluminum profile surface defect classification result write-back record is stored according to the aluminum profile number, batch number, surface area code, and record generation time, and is used for subsequent image detection, defect classification, quality assessment, and manual review traceability of similar aluminum profiles.
[0100] In this embodiment, aluminum profile surface defect samples collected from the same inspection station in the industrial site are selected as test objects. All samples include images under normal light, oblique light, low-angle grazing light, and color images, and corresponding production process records are retained. The manual review benchmark is confirmed by quality inspectors based on the defect area cutout diagram, surface unfolded image, entity location range, and production quality records. If the review opinions are inconsistent, a second review is conducted to form the final manual review result. The conventional single-light source image interpretation method compares the normal light image with the qualified benchmark image and outputs the defect area and defect category based on brightness, color, area, and shape characteristics, without performing continuity verification under the aluminum profile surface unfolded coordinates or matching with production process records. The conventional image feature classification method generates defect categories based on the grayscale, color, texture, and contour features of the image deviation area, without reading production process records for source verification. In this embodiment, if... Figure 5 The figure shows the comparison results of the consistency rate of defect continuous record verification for different equivalent defect length intervals under the condition of grouped samples in industrial field. Figure 5The samples used were divided into five intervals based on equivalent defect length: no more than 1 mm, 1 mm to 3 mm, 3 mm to 8 mm, 8 mm to 15 mm, and greater than 15 mm. The sample sizes for each interval were 65, 78, 85, 62, and 55 pieces, respectively. Equivalent defect length refers to the length difference between the starting and ending entity positions in a continuous defect record. The consistency rate of continuous defect records refers to the proportion of samples whose entity position range, continuous length interval, and defect category are all consistent after manual verification within the corresponding length interval, relative to the total number of samples included in the statistics for that length interval. Figure 5 It is evident that as the equivalent defect length increases, the consistency rate of defect continuity record verification increases for both the method of this invention and the conventional single-light source image interpretation method. However, the method of this invention maintains higher results across all length ranges, particularly in shorter defect length ranges. This indicates that by converting the acquired image into aluminum profile surface unfolding coordinates with surface region coding, length coordinates, and width coordinates, and generating defect continuity records based on preliminary classification markers of entity location, region main direction, region width variation, and anomaly source, the image region can continuously correspond to the entity location of the aluminum profile, thereby improving the consistency of defect continuity record verification. In this embodiment, as... Figure 6 The results show a comparison of the consistency rate of process source verification under different defect categories in industrial sites. Figure 6 The samples used were categorized into five types based on the defect categories confirmed by manual review: longitudinal scratches, roller marks, end face burrs, oxide spots / color differences, and sprayed particles. The sample quantities for each category were 68, 59, 52, 74, and 62 pieces, respectively. The consistency rate of process source verification refers to the proportion of samples whose source verification records in the surface defect classification results match the manually confirmed source type within the corresponding defect category, out of the total number of samples participating in the source verification statistics for that defect category. Figure 6 As can be seen, under defect categories such as longitudinal scratches, roller marks, end face burrs, oxide spot color differences, and sprayed particles, the consistency rate of process source verification of the method of the present invention is higher than that of conventional image feature classification methods. This indicates that by matching the continuous distribution type and deviation item type of the continuous defect records with the production process records, and generating source verification records for extrusion molding, conveyor contact, cutting end face, surface treatment, and spray coating respectively, a correspondence can be established between the defect classification results and the production process records, thereby improving the consistency of source verification of surface defect classification results.
[0101] This embodiment also provides an aluminum profile surface defect detection and classification system, including: a surface unfolding and positioning module, used to generate aluminum profile surface unfolding coordinates with surface area codes, length coordinates, and width coordinates, and generate basic image detection records; an effective image generation module, used to establish a detection comparison benchmark, correct, stitch, and judge the acquisition quality of multi-source surface images, and generate effective surface image records; a defect candidate region extraction module, used to extract image deviation areas, and after verification by excluding structurally permissible areas and abnormal acquisition records, generate defect candidate region records; and a defect continuous classification and write-back module, used to generate continuous defect records based on defect candidate region records, combine with production process records to verify the process source and judge surface quality, and generate aluminum profile surface defect classification result write-back records based on manual review results.
[0102] In summary, this invention generates basic image detection records and converts the acquired images into surface coordinates of aluminum profiles, establishing a unified correspondence between image regions, surface region codes, and entity positions. This is used for defect candidate region extraction and cross-regional continuous judgment, achieving the beneficial effect of traceable defect location results. By generating continuous defect records and combining them with production process records for process source verification, the surface defect classification results can correspond to the extrusion, conveying, cutting, surface treatment, and spraying processes. Furthermore, based on the results of manual review, a write-back record of aluminum profile surface defect classification results is generated, achieving the effect of updatable classification criteria.
[0103] It should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention and are not intended to limit it. Although the present invention has been described in detail with reference to preferred embodiments, those skilled in the art should understand that modifications or equivalent substitutions can be made to the technical solutions of the present invention without departing from the spirit and scope of the technical solutions of the present invention, and all such modifications or substitutions should be covered within the scope of the claims of the present invention.
Claims
1. A method for detecting and classifying surface defects in aluminum profiles, characterized in that, include: The production object information and image acquisition information of aluminum profiles are obtained. Based on the cross-sectional contour reference data, camera calibration records and encoder pulse positions, the acquired images are converted into aluminum profile surface unfolding coordinates with surface area codes, length coordinates and width coordinates to generate basic records for image detection. Based on the image detection basic record, a detection comparison benchmark is established, and the surface images of multiple light sources are corrected, stitched and acquired to judge the quality, and an effective surface image record corresponding to the unfolded coordinates of the aluminum profile surface is generated. Based on the effective surface image recording and detection comparison benchmark, the image deviation area is extracted. After verification by excluding structurally permissible areas and abnormal acquisition records, the regional characteristics and multi-light source response difference are calculated to generate defect candidate area records. Based on the entity location, main direction of the region, changes in region width, and preliminary classification markers of anomaly sources in the defect candidate region record, a continuous defect record is generated. Combined with the production process record, the process source is verified and the surface quality is judged. Based on the manual review results, the allowable area of structure, defect sample record, defect classification judgment benchmark record, invalid detection area rules, and acquisition parameter benchmark record are updated to generate a write-back record of aluminum profile surface defect classification results.
2. The method for detecting and classifying surface defects in aluminum profiles as described in claim 1, characterized in that, The generated image detection baseline record includes: Read the cross-sectional profile reference data according to the cross-sectional model of the aluminum profile, and divide the outer surface of the aluminum profile into front area, back area, side area, corner area, slot area, end face area and connecting transition area according to the sequence of boundary points of the outer contour of the cross-section, the starting point of surface development and the direction of surface development. Set surface area code for each surface area. Distortion correction is performed on the acquired images based on camera calibration records. The length coordinates are determined based on encoder pulse position and image acquisition time. The width coordinates are determined based on cross-sectional profile reference data and pixel size conversion relationship, thereby generating aluminum profile surface unfolding coordinates with surface area encoding, length coordinates and width coordinates. When the cross-section model cannot match the cross-section profile reference data or there is an abnormal encoder pulse position, a cross-section reference mismatch record or a length positioning abnormal record is generated.
3. The method for detecting and classifying surface defects in aluminum profiles as described in claim 2, characterized in that, The establishment of a detection comparison benchmark based on image detection basic records includes: Based on the cross-section model, surface treatment method, spray color and quality inspection standard number, read the images of aluminum profiles with the same cross-section model, surface treatment method and spray color that have been confirmed as qualified by manual quality inspection, align the qualified images according to the surface development coordinates of the aluminum profiles, and respectively calculate the reference brightness range, reference color range, reference texture direction range, reference contour boundary range and reference reflection response range of each surface area to generate a qualified reference image record. Based on the cross-sectional profile reference data, cutting process documents, tooling contact position records, protective film attachment position records, inspection station layout records, and historical qualified image statistics, a record of the allowable area of the structure is generated. Based on camera calibration records, light source calibration records, and statistical results of historical valid images, a baseline record of acquisition parameters and a baseline record of valid acquisition judgment are generated.
4. The method for detecting and classifying surface defects in aluminum profiles as described in claim 3, characterized in that, The generation of an effective surface image record corresponding to the unfolded coordinates of the aluminum profile surface includes: Images of the frontal light, oblique light, low-angle grazing light, and color are acquired according to the surface area code and acquisition angle. Images from different light sources are bound according to the aluminum profile number, surface area code, entity location range, and image acquisition time range. The bound image is subjected to distortion correction, brightness normalization, color correction, boundary localization, and image stitching. The acquisition quality is determined based on the proportion of overexposed pixels, the proportion of underexposed pixels, the results of motion blur judgment, the results of image frame missing judgment, the results of edge misalignment judgment, and the occlusion area. Areas that do not meet the acquisition quality requirements are written into the invalid detection area record, while image areas that meet the acquisition quality requirements are generated into valid surface image records.
5. The method for detecting and classifying surface defects in aluminum profiles as described in claim 4, characterized in that, The calculation of region features and multi-source response differences generates a record of candidate defect regions, including: The effective surface image is recorded and compared with the detection benchmark to extract areas of brightness deviation, color deviation, texture direction deviation, contour boundary deviation, and reflection response deviation. The extracted image deviation areas are matched with records of structurally permissible areas, invalid detection areas, inconsistent acquisition parameters, abnormal light source acquisition, and abnormal stitching. Areas belonging to acquisition anomalies, structurally permissible ranges, boundary attribution exclusion ranges, or isolated noise ranges are excluded. For the retained abnormal regions, calculate the region area, region length, region width, region main direction, boundary continuity, grayscale deviation value, color deviation value, texture direction deviation value, contour deviation value, and multi-light source response difference to generate a record of defect candidate regions.
6. The method for detecting and classifying surface defects in aluminum profiles as described in claim 4 or 5, characterized in that, The calculation of region features and multi-source response differences generates a record of candidate defect regions, including: Based on the difference in response of multiple light sources, color deviation value, and records of the allowable area of the structure, preliminary classification markers for anomaly sources are generated. The preliminary classification markers for anomaly sources include candidate markers for geometric undulations, candidate markers for color and material, candidate markers for composite deviations, and candidate markers for structural boundary deviations. When the difference in response of multiple light sources reaches the geometric fluctuation judgment threshold and the color deviation value does not reach the color material judgment threshold, the corresponding abnormal area is marked as a candidate marker for geometric fluctuation. When the color deviation value reaches the color material judgment threshold and the multi-light source response difference does not reach the geometric fluctuation judgment threshold, the corresponding abnormal area is marked as a candidate label for color material. When the difference in response of multiple light sources and the color deviation value both reach the corresponding judgment threshold, the corresponding abnormal area is marked as a candidate label for composite deviation. When an abnormal region is located within the allowable area of the structure and at least one of the grayscale deviation, color deviation, or contour deviation exceeds the corresponding allowable range in the record of the allowable area of the structure, the corresponding abnormal region will be marked as a candidate marker for structural boundary deviation.
7. The method for detecting and classifying surface defects in aluminum profiles as described in claim 6, characterized in that, The generated defect candidate region record includes: The defect candidate areas are sorted according to the aluminum profile number, surface area code, solid length coordinates, and solid width coordinates; Defect candidate regions that are written into the acquisition anomaly exclusion record, boundary attribution exclusion record, or isolated noise exclusion record will be excluded from the generation of continuous defect records. When adjacent defect candidate areas meet the requirements of having the same aluminum profile number, continuous entity position, consistent main direction of the area, continuous change of area width, consistent preliminary classification of anomaly source, or meet the judgment conditions of composite record, adjacent defect candidate areas will be merged into the same continuous defect record. When there are invalid detection areas, splicing abnormal areas, or length positioning abnormal records between adjacent defect candidate areas, a discontinuous pending confirmation record is generated. A continuous distribution type is generated based on the physical location distribution of the continuous defect records. A deviation item type is generated based on the preliminary classification and marking of the anomaly source. The continuous distribution type includes continuous records, periodic records, and local boundary records. The deviation item type includes geometric undulation type, color and material type, composite deviation type, and structural boundary deviation type.
8. The method for detecting and classifying surface defects in aluminum profiles as described in claim 6 or 7, characterized in that, The process source verification and surface quality assessment based on production process records include: Read the production process records, which include mold number, extrusion batch, conveying device number, cutting station number, surface treatment batch number, spraying station number, spraying color, spraying batch number, and inspection station number; When production process records are missing, or when key fields in the production process records cannot be correlated with aluminum profile numbers, a missing process record is generated, and the classification status of the corresponding continuous defect records is marked as pending review. Based on the continuous distribution type, deviation project type, and production process records, the process source verification is performed on the continuous defect records to generate extrusion molding source verification records, conveyor contact source verification records, cutting end face source verification records, surface treatment source verification records, or spray coating film formation source verification records. When only one source verification result is valid, a surface defect classification result is generated based on the valid source verification result; When more than one source verification result is valid, a source conflict record is generated, and the classification status of the corresponding surface defect classification result is marked as pending review. Based on the surface defect classification results, continuous defect records, quality inspection standard numbers, and application requirements of aluminum profiles, quality conclusions for defect events and surface quality conclusions for aluminum profiles are generated.
9. The method for detecting and classifying surface defects in aluminum profiles as described in claim 8, characterized in that, The process of updating the permissible area of the structure, defect sample record, defect classification judgment benchmark record, invalid detection area rules, and acquisition parameter benchmark record based on the results of manual review, and generating a write-back record of the surface defect classification results of aluminum profiles includes: Read the manual review results and bind and save them together with the surface defect classification results, continuous defect records, effective surface image records and production process records; When manual review confirms that the current area is not a defect and that the current area is within the structural allowable range, a structural allowable area update record is generated. When manual review confirms that the current area is a defect, but the automatic classification result is inconsistent with the manually confirmed defect category, a defect sample update record and a defect classification judgment benchmark update record are generated. When manual review confirms that the misjudgment is due to the image acquisition quality or image stitching quality, an invalid detection area rule update record and an acquisition parameter review record are generated. When the allowed area of structure, the defect classification judgment benchmark record, the invalid detection area rule, or the acquisition parameter benchmark record is updated, a rule version update record is generated; When the rule version update record meets the conditions for taking effect, the effective status will be updated to "effective". When the number of manually reviewed rejections in a trial batch reaches the rollback threshold, a rule rollback record is generated. Based on the surface quality conclusions, manual review results, rule version update records, and rule rollback records, a write-back record of the surface defect classification results for aluminum profiles is generated.
10. A surface defect detection and classification system for aluminum profiles, based on the surface defect detection and classification method for aluminum profiles according to any one of claims 1 to 9, characterized in that, include: The surface unfolding and positioning module is used to generate the surface unfolding coordinates of the aluminum profile with surface area coding, length coordinates and width coordinates, and to generate the basic record for image detection. The effective image generation module is used to establish a detection comparison benchmark, correct, stitch and judge the acquisition quality of multi-source surface images, and generate effective surface image records. The defect candidate region extraction module is used to extract the image deviation region, and after verification by excluding the structurally permissible region and abnormal acquisition records, it generates a defect candidate region record; The continuous defect classification and write-back module is used to generate continuous defect records based on defect candidate area records, combine production process records to verify the process source and judge surface quality, and generate write-back records of aluminum profile surface defect classification results based on manual review results.
