Printing and dyeing defect detection method and system
By acquiring and registering data using a multi-angle imaging device to generate a three-dimensional point cloud model, color difference areas on the surface of printed and dyed materials are identified. This solves the problem of color information projection distortion caused by geometric undulations on the surface of printed and dyed materials, and improves the accuracy of color difference area identification.
Patent Information
- Application Number
- CN202511545521.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-10-28
- Publication Date
- 2025-11-28
- Estimated Expiration
- 2045-10-28
AI Technical Summary
In existing technologies, due to factors such as tension changes and equipment extrusion, the surface of printed and dyed materials may develop geometric undulations such as wrinkles and local protrusions on the production line. 2D image detection cannot accurately identify color difference areas, and color information is distorted due to perspective projection.
Images of the printed and dyed material surface are acquired by a multi-angle imaging device, generating a set of original images from multiple perspectives. After registration processing, a three-dimensional point cloud model is generated. Combined with color information projection, the boundary features of color difference areas are identified and the spatial location of defects is determined.
It effectively avoids color information projection distortion caused by geometric fluctuations and improves the recognition accuracy of color difference areas.
Smart Images

Figure CN121033020A_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the field of machine vision, and in particular to a printing and dyeing defect detection method and system. BACKGROUND
[0002] In the production process of the printing and dyeing industry, dyeing color difference is an important reason affecting the quality of printing and dyeing products. In order to ensure product consistency, online detection technology is needed to identify the dyeing color difference on the surface of the printing and dyeing object in real time, so as to timely adjust the production process parameters and reduce the generation of unqualified products.
[0003] At present, a single-view or double-view imaging device arranged on the production line is mainly used to collect the 2D image of the surface of the printing and dyeing object, and the color space conversion and color difference value calculation are performed on the image, and then the color difference area is located and its coordinates in the 2D image are determined.
[0004] However, during the transmission process of the printing and dyeing object on the production line, the surface of the printing and dyeing object is prone to geometric undulations such as wrinkles and local protrusions due to factors such as tension changes and equipment extrusion; the 2D image can only reflect the planar projection information of the surface of the printing and dyeing object, and cannot obtain the three-dimensional geometric shape thereof, and the color information of the geometric undulation area may be distorted due to the perspective projection, which affects the accurate identification of the color difference area.
[0005] How to solve this technical problem is a technical problem that needs to be overcome by those skilled in the art. SUMMARY
[0006] The embodiment of the present application provides a printing and dyeing defect detection method to at least partially solve the above technical problems.
[0007] In order to achieve the above purpose, according to the first aspect of the present application, a printing and dyeing defect detection method is provided, comprising:
[0008] An image collection of the surface of the printing and dyeing object is performed by a multi-angle imaging device arranged on the production line to obtain a raw image set containing multiple views;
[0009] An alignment processing is performed on the raw image set to obtain a registration image set in a unified coordinate system;
[0010] A three-dimensional point cloud model is generated according to the registration image set and the geometric structure feature of the surface of the printing and dyeing object is obtained;
[0011] The color information in the registration image set is projected to the three-dimensional point cloud model to obtain a three-dimensional color distribution model;
[0012] The pixel points in the three-dimensional color distribution model are grouped to obtain the boundary feature of the color difference area;
[0013] According to the boundary feature of the color difference region, a coordinate range of the color difference region in the three-dimensional color distribution model is analyzed, and a spatial position coordinate of a defect is determined.
[0014] Specifically, the original image set is aligned to obtain a registered image set in a unified coordinate system, including:
[0015] Key feature points are extracted from the original image set, and feature descriptors corresponding to the key feature points are generated by using a scale-invariant feature transform algorithm;
[0016] An initial matching point pair is obtained by matching the feature descriptors, and if the number of the initial matching point pair exceeds a preset matching number threshold, an abnormal matching point in the initial matching point pair is removed by using a random sample consensus algorithm to obtain a reliable matching point pair.
[0017] An affine transformation matrix is calculated according to the reliable matching point pair, and a coordinate transformation parameter is extracted therefrom;
[0018] The original image set is geometrically corrected based on the coordinate transformation parameter to obtain a corrected image set;
[0019] A scale difference of the corrected image set is detected, and if the scale difference exceeds a preset scale threshold, a scale adjustment operation is performed on the corrected image set to obtain a scale consistent image set;
[0020] A rotation angle deviation of the scale consistent image set is detected, and if the rotation angle deviation is greater than a preset angle threshold, a rotation matrix is applied to the scale consistent image set for rotation correction to obtain a rotation corrected image set;
[0021] A translation vector of the rotation corrected image set and a preset reference coordinate system is calculated to obtain a translation deviation, and if the translation deviation is greater than a preset translation threshold, the rotation corrected image set is translated by fusing the translation vector to obtain a registered image set in a unified coordinate system.
[0022] Specifically, a three-dimensional point cloud model is generated according to the registered image set, and a geometric structure feature of the printing surface is obtained, including:
[0023] The registered image set is obtained, corresponding pixel point matching is performed on images of different viewing angles in the registered image set, and an initial three-dimensional point cloud model containing spatial coordinate information of the printing surface is generated;
[0024] The initial three-dimensional point cloud model is subjected to point cloud registration by using an iterative closest point algorithm to obtain an aligned three-dimensional point cloud model;
[0025] Calculate a local curvature value of each point cloud point based on the aligned three-dimensional point cloud model, and generate a curvature distribution map of the printing and dyeing surface;
[0026] If the local curvature value of a point cloud point in the curvature distribution map exceeds a preset curvature threshold, mark a region composed of the point and its adjacent points as a convex region, and obtain a convex region set;
[0027] Extract a boundary point of each convex region from the convex region set, and perform quadratic curve fitting on the boundary point to obtain boundary curve parameters;
[0028] Calculate the shortest distance between two adjacent convex regions according to the boundary curve parameters, and generate a distance matrix; if the shortest distance between any two adjacent convex regions in the distance matrix is less than a preset distance threshold, determine that the two convex regions are the same geometric structure, and merge the two convex regions to obtain merged convex region information;
[0029] Obtain the geometric structure features of the printing and dyeing surface based on the merged convex region information, the spatial coordinate data of the aligned three-dimensional point cloud model, and the local curvature information of the curvature distribution map.
[0030] Specifically, obtain the registered image set, perform corresponding pixel point matching on images with different viewing angles in the registered image set, and generate an initial three-dimensional point cloud model containing printing and dyeing surface spatial coordinate information, including:
[0031] Obtain the registered image set; select one image from the registered image set as a reference image, and select the remaining images in the registered image set as matching images;
[0032] Perform dense feature point recognition on the reference image to generate a dense feature point coordinate set containing the spatial coordinates of all dense feature points;
[0033] Generate a corresponding feature vector for each dense feature point in the dense feature point coordinate set; integrate all feature vectors to establish a reference image feature library;
[0034] Perform sliding window matching between each matching image and the reference image: based on the feature vectors of the pixel points in the matching image and the feature vectors of the dense feature points in the reference image feature library, calculate the Euclidean distance between the two to determine the similarity; filter out the point pairs with a similarity higher than a preset matching threshold as candidate matching point pairs;
[0035] According to the candidate matching point pairs between each matching image and the reference image, calculate the corresponding disparity map between the two;
[0036] Based on the pre-calibrated intrinsic and extrinsic matrix of the multi-angle imaging device and the disparity map, the coordinates of each candidate matching point pair in three-dimensional space are calculated respectively.
[0037] Integrate the three-dimensional spatial coordinates of all candidate matching point pairs to form an initial point cloud dataset containing preliminary spatial coordinate information of the surface of the printed material.
[0038] Specifically, projecting the color information from the registered image set onto the 3D point cloud model to obtain a 3D color distribution model includes:
[0039] Extract the RGB color data of each image from the registered image set to construct an initial color dataset containing the correspondence between pixel coordinates and RGB color values;
[0040] The initial color dataset is matched one by one with the point cloud points of the 3D point cloud model, and the empty point cloud points that do not match the color data are identified.
[0041] The point cloud empty space bits are labeled with empty value identifiers;
[0042] Assign corresponding RGB color values to color points that are not labeled with null value identifiers to obtain point cloud color assignment results containing real color information;
[0043] The point cloud color assignment results are fused with the geometric structural features of the 3D point cloud model to generate a 3D color distribution model.
[0044] Specifically, the pixels in the three-dimensional color distribution model are grouped to obtain the boundary features of the color difference regions, including:
[0045] Obtain the spatial coordinate data and RGB color data of all pixels in the three-dimensional color distribution model, filter out the valid color points without null values based on the null value identifier, and remove the point cloud null points with null value identifiers.
[0046] For the filtered valid color points, a two-dimensional point set matrix is constructed based on spatial coordinates and RGB color values: each valid color point contains spatial coordinate parameters and RGB color parameters. The spatial coordinate parameters and RGB color parameters of each valid color point are used as a row vector. All row vectors are arranged in order to form a two-dimensional point set matrix. All row vectors contained in the two-dimensional point set matrix together constitute the set of valid pixels.
[0047] The effective pixel set is grouped to obtain a grouped cluster set; wherein, the spatial Euclidean distance and RGB color difference between two points are calculated, and the spatial Euclidean distance and RGB color difference are weighted and summed according to a preset weight as a clustering metric. Pixels with a clustering metric value less than a preset initial threshold are divided into the same cluster to obtain the grouped cluster set.
[0048] Calculate the average inter-cluster color difference value among the grouped clusters; if the average inter-cluster color difference value exceeds a preset color difference threshold, mark the corresponding cluster as a color difference region and obtain a color difference region set;
[0049] Extract adjacent pixel pairs from the edge of each color difference region from the set of color difference regions, perform edge recognition on the adjacent pixel pairs, and obtain a continuous sequence of boundary points;
[0050] The curvature change value of each point in the boundary point sequence is calculated to determine the boundary type and obtain a boundary type set. If the curvature change value exceeds the preset curvature change range, the boundary is determined to be a sharp boundary; if the curvature change value does not exceed the preset curvature change range, the boundary is determined to be a smooth boundary.
[0051] The spatial distribution information of the boundary type set and the grouped cluster set is fused, and the dimensionality reduction of the fused data is performed by the principal component analysis algorithm to obtain N sets of dimensionality-reduced feature vectors.
[0052] The N sets of feature vectors after dimensionality reduction are matched with the preset boundary template by cosine similarity to obtain the shape of the color difference region corresponding to the boundary and the boundary features of the color difference region.
[0053] Specifically, based on the boundary characteristics of the color difference region, the coordinate range of the color difference region in the three-dimensional color distribution model is analyzed to determine the spatial location coordinates of the defect, including:
[0054] Obtain the boundary features of the color difference region and extract the boundary point sequence and boundary type set;
[0055] By statistically analyzing the maximum and minimum coordinates of the boundary point sequence on the X, Y, and Z axes, the preliminary coordinate range of the color difference region can be obtained.
[0056] The spatial coordinates of the defect are obtained by taking the center point coordinates of the preliminary coordinate range as the defect center coordinates and combining them with the preliminary coordinate range.
[0057] Specifically, the method further includes:
[0058] Obtain the three-dimensional point cloud coordinates corresponding to each boundary point in the color difference region boundary point sequence;
[0059] Query the local curvature values and convex region information of the corresponding coordinates in the geometric structure features;
[0060] If a boundary point is located in a convex region and its local curvature value is greater than a preset structural sensitivity threshold, then the boundary point is marked as a structurally sensitive boundary point.
[0061] The proportion of structurally sensitive boundary points within the color difference region is statistically analyzed. If the proportion exceeds a preset threshold, geometric deformation compensation is performed on the spatial coordinates of the color difference region: based on the boundary curve parameters of the raised region, the initial coordinate range of the original color difference region is projected onto the undeformed reference plane through a mapping function to obtain the compensated coordinate range of the color difference region; wherein, the mapping function is constructed based on the boundary curve parameters of the raised region.
[0062] The center point of the compensated color difference area coordinate range is used as the corrected defect center coordinate, and the final spatial position coordinate of the defect is obtained by combining the compensated coordinate range.
[0063] Specifically, before marking clusters as color difference regions, the method further includes:
[0064] Obtain the design template image corresponding to the current printed material, and extract the theoretical color distribution map and texture structure map of the design template image;
[0065] The three-dimensional color distribution model is projected onto a two-dimensional plane and spatially aligned with the design template image;
[0066] For each candidate color difference cluster, query the expected color value and allowed color difference range of the corresponding region in the design template image;
[0067] If the color difference between the actual color value and the expected color value of the cluster is less than the allowable color difference range, then the cluster is determined to be a color change allowed by the design and is not marked as a color difference area.
[0068] According to a second aspect of this application, a dyeing and printing defect detection system is provided, comprising:
[0069] The first processing module is used to: acquire images of the surface of the printed and dyed material through a multi-angle imaging device arranged on the production line, and obtain a set of original images containing multiple perspectives;
[0070] The second processing module is used to: perform alignment processing on the original image set to obtain a registered image set under a unified coordinate system;
[0071] The third processing module is used to: generate a three-dimensional point cloud model based on the registered image set and obtain the geometric structural features of the surface of the printed material;
[0072] The fourth processing module is used to: project the color information in the registered image set onto the three-dimensional point cloud model to obtain a three-dimensional color distribution model;
[0073] The fifth processing module is used to: group the pixels in the three-dimensional color distribution model to obtain the boundary features of the color difference region;
[0074] The sixth processing module is used to: analyze the coordinate range of the color difference region in the three-dimensional color distribution model based on the boundary characteristics of the color difference region, and determine the spatial location coordinates of the defect.
[0075] In summary, the embodiments of this application, through the above technical solutions, avoid color information projection distortion caused by geometric undulations and improve the recognition accuracy of color difference areas.
[0076] Other features and advantages of this application will be described in detail in the following detailed description section. Attached Figure Description
[0077] To more clearly illustrate the technical solutions in the embodiments of this application, the accompanying drawings used in the description of the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0078] Figure 1 This is a flowchart of the steps of a dyeing and printing defect detection method provided in an exemplary embodiment of this application;
[0079] Figure 2 This is a schematic diagram of a dyeing and printing defect detection system provided in an exemplary embodiment of this application;
[0080] Explanation of reference numerals in the attached drawings: 201, First processing module; 202, Second processing module; 203, Third processing module; 204, Fourth processing module; 205, Fifth processing module; 206, Sixth processing module. Detailed Implementation
[0081] The technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only a part of the embodiments of this application, and not all of them. All other embodiments obtained by those skilled in the art based on the embodiments of this application without creative effort are within the protection scope of this application.
[0082] This application provides a method for detecting defects in printing and dyeing processes. Please refer to [link / reference]. Figure 1 The dyeing defect detection method provided in this application includes the following steps:
[0083] Step 101: The surface of the printed and dyed material is captured by a multi-angle imaging device arranged on the production line to obtain a set of original images containing multiple perspectives.
[0084] Step 102: Align the original image set to obtain a registered image set in a unified coordinate system.
[0085] Step 103: Generate a three-dimensional point cloud model based on the registered image set and obtain the geometric structural features of the printed material surface.
[0086] Step 104: Project the color information in the registered image set onto the three-dimensional point cloud model to obtain a three-dimensional color distribution model.
[0087] Step 105: Group the pixels in the three-dimensional color distribution model to obtain the boundary features of the color difference region.
[0088] Step 106: Based on the boundary characteristics of the color difference region, analyze the coordinate range of the color difference region in the three-dimensional color distribution model to determine the spatial location coordinates of the defect.
[0089] The above scheme acquires original images of the surface of the printed and dyed material from all angles through multi-view imaging, making up for the lack of information from a single viewpoint; the original images are aligned to eliminate viewpoint offset and scale differences; a three-dimensional point cloud model is generated based on the registered images and geometric structural features are extracted; color information is fused with the three-dimensional point cloud model to form a three-dimensional color distribution model; color difference regions and their boundary features are identified through pixel grouping and boundary extraction, improving the accuracy of color difference region identification; and the three-dimensional spatial coordinates of defects are determined based on boundary features, overcoming the limitation of two-dimensional detection that can only output planar coordinates, effectively improving the accuracy of color difference identification.
[0090] In some embodiments, the original image set is aligned to obtain a registered image set in a unified coordinate system, including:
[0091] Key feature points are extracted from the original image set; feature descriptors corresponding to the key feature points are generated using a scale-invariant feature transformation algorithm.
[0092] Initial matching point pairs are obtained by matching the feature descriptors; if the number of initial matching point pairs exceeds a preset matching number threshold, an abnormal matching point in the initial matching point pairs is removed by a random sampling consensus algorithm to obtain reliable matching point pairs.
[0093] Calculate the affine transformation matrix based on the reliable matching point pairs and extract the coordinate transformation parameters from it;
[0094] Based on the coordinate transformation parameters, the original image set is geometrically corrected to obtain a corrected image set;
[0095] The scale difference of the corrected image set is detected. If the scale difference exceeds a preset scale threshold, a scale adjustment operation is performed on the corrected image set to obtain a scale-consistent image set.
[0096] The rotation angle deviation of the scale-consistent image set is detected. If the rotation angle deviation is greater than a preset angle threshold, a rotation matrix is applied to the scale-consistent image set to perform rotation correction, thereby obtaining a rotation-corrected image set.
[0097] The translation vector between the rotation-corrected image set and the preset reference coordinate system is calculated to obtain the translation deviation; if the translation deviation is greater than the preset translation threshold, the translation vector is fused to perform translation correction on the rotation-corrected image set to obtain a registered image set under a unified coordinate system.
[0098] Specifically, key feature points that can stably represent the image structure are extracted from the original image set one by one. Key feature points refer to pixels in the image with drastic gray-level changes, such as the intersection of textures on the surface of printed materials and edge endpoints, which reflect the local structural information of the image. The scale-invariant feature transform (SIFT) algorithm is used to generate feature descriptors corresponding to each key feature point. The scale-invariant feature transform algorithm is an algorithm that can maintain feature stability under image scaling, rotation, and illumination changes. By constructing a scale space, detecting extreme points, and calculating directional gradients, a 128-dimensional high-dimensional feature vector can be generated. This high-dimensional feature vector can uniquely represent the structural properties of the key feature points.
[0099] By calculating the Euclidean distance between key feature point descriptors in images from different perspectives, the smaller the Euclidean distance, the higher the structural similarity between the two feature points. Feature point pairs with a distance less than a preset similarity threshold are selected as initial matching point pairs. If the number of initial matching point pairs exceeds a preset matching number threshold, an abnormal matching point, i.e. a mismatched point that deviates from the overall image transformation pattern, is removed from the initial matching point pairs using a random sampling consensus algorithm.
[0100] Based on the reliable matching point pairs, the least squares method is used to solve for the affine transformation matrix that describes the linear transformation relationship between images. The affine transformation matrix is a 2×3 matrix containing three transformation parameters: translation, rotation, and scaling, which can completely characterize the geometric transformation law of mapping one image to another. From the solved affine transformation matrix, the translation amount, rotation angle, and scaling coefficient are extracted as subsequent coordinate transformation parameters. Based on the coordinate transformation parameters, geometric correction is performed on each image in the original image set. Geometric correction is achieved by adjusting the spatial coordinates of image pixels to eliminate image distortion caused by lens distortion and viewpoint shift. The scale difference of each image in the corrected image set is detected. If the scale difference exceeds a preset scale threshold, a bilinear interpolation algorithm can be used to perform a scale adjustment operation on the corrected image set to achieve smooth scaling of image size, avoid image blurring caused by scale adjustment, and finally obtain a scale-consistent image set. The angle of the printed material edge in the scale-consistent image set is detected to determine the rotation angle deviation of each image from the preset reference direction. If the rotation angle deviation is greater than the preset angle threshold, a rotation matrix is applied to the scale-consistent image set for rotation correction. The rotation matrix is a 2×2 trigonometric function matrix. By multiplying the pixel coordinates by the sine and cosine values of the rotation angle, the new coordinates of the pixels after rotation are calculated, which can rotate the image around the preset reference point to be parallel to the reference direction, thus obtaining the rotation-corrected image set.
[0101] Using one of the images as a reference, the image acquired from the front is preferred, as its viewpoint is closest to the orthographic projection of the printed material surface and has the smallest geometric deviation. A preset reference coordinate system is established. The X-axis of the preset reference coordinate system is parallel to the production line transmission direction, the Y-axis is perpendicular to the transmission direction, and the origin is set to the lower left corner of the image. The translation vector of each image in the rotation correction image set relative to the preset reference coordinate system is calculated to obtain the translation deviation. If the translation deviation is greater than a preset translation threshold, the translation vector is fused to perform translation correction on the rotation correction image set, and finally a registered image set under a unified coordinate system is obtained.
[0102] To eliminate problems such as viewing angle shift, scale inconsistency, and rotation tilt caused by differences in acquisition angle and equipment installation deviation in multi-view original images, the original image set is aligned to unify all images under the same preset reference coordinate system, and finally a registered image set is obtained.
[0103] In some embodiments, generating a three-dimensional point cloud model based on the registered image set and obtaining the geometric structural features of the printed material surface includes:
[0104] The registered image set is obtained, and the corresponding pixel points of the images from different perspectives in the registered image set are matched to generate an initial three-dimensional point cloud model containing the spatial coordinate information of the surface of the dyed material.
[0105] The initial 3D point cloud model is registered using the iterative nearest point algorithm to obtain the aligned 3D point cloud model.
[0106] Based on the aligned 3D point cloud model, the local curvature value of each point cloud location is calculated to generate a curvature distribution map of the printed material surface.
[0107] If the local curvature value of a point cloud location in the curvature distribution map exceeds a preset curvature threshold, then the area formed by that point and its adjacent points is marked as a convex region, thus obtaining a set of convex regions.
[0108] Extract the boundary points of each protruding region from the set of protruding regions, and perform quadratic curve fitting on the boundary points to obtain the boundary curve parameters;
[0109] The shortest distance between two adjacent raised regions is calculated based on the boundary curve parameters to generate a distance matrix. If the shortest distance between any two adjacent raised regions in the distance matrix is less than a preset distance threshold, the two raised regions are determined to be of the same geometric structure, and the two raised regions are merged to obtain information on the merged raised region.
[0110] Based on the merged raised area information, the spatial coordinate data of the aligned three-dimensional point cloud model, and the local curvature information of the curvature distribution map, the geometric structural features of the printed and dyed material surface are obtained.
[0111] Specifically, the registered image set is acquired, and a multi-view stereo matching algorithm is used to match corresponding pixels in images from different perspectives in the registered image set. The multi-view stereo matching algorithm is an algorithm that finds the corresponding pixels of the same physical point in different images by calculating the similarity between pixels in images from different perspectives, and then recovers the three-dimensional coordinates by combining camera parameters. Combining the intrinsic parameters such as focal length, principal point coordinates, and distortion coefficients pre-calibrated by the multi-angle imaging device with the extrinsic parameters such as camera spatial position and attitude angle, the three-dimensional spatial coordinates of each matching pixel are calculated by the triangulation principle. The three-dimensional coordinates of all pixels are integrated to generate an initial three-dimensional point cloud model containing the spatial coordinate information of the surface of the printed material.
[0112] The initial 3D point cloud model is registered using the iterative nearest point algorithm. The iterative nearest point algorithm is a registration algorithm that finds the optimal transformation matrix between two sets of point clouds through iteration to minimize the distance between the point clouds. It is often used to eliminate positional deviations of point clouds from multiple perspectives. By iteratively calculating the optimal transformation matrix between point clouds from different perspectives multiple times, the positional offset caused by the difference in perspective in the initial point cloud is eliminated, and the aligned 3D point cloud model is obtained.
[0113] Based on the aligned 3D point cloud model, a local curvature value is calculated for each point cloud location. The local curvature value is a physical quantity characterizing the degree of curvature in the area where the point cloud location is located; a larger curvature value indicates a more pronounced surface curvature in that area. The local curvature values of all point cloud locations are associated with their spatial coordinates (X, Y), and a color gradient is generated according to the curvature value to produce a curvature distribution map of the printed material surface. The curvature distribution map is a two-dimensional image that displays the local curvature values of the point cloud using a color mapping method. If the local curvature value of a point cloud location in the curvature distribution map exceeds a preset curvature threshold, the area formed by that location and its adjacent locations is marked as a convex region. This marking operation is repeated for all point cloud locations to obtain a set of convex regions containing multiple convex regions.
[0114] The boundary points of each convex region are extracted from the set of convex regions. The boundary point refers to the point cloud position of the edge of the convex region. The criterion for determining the boundary point is that the neighborhood of the point contains both convex region positions and non-convex region positions. The extracted boundary points are fitted with a quadratic curve using the least squares method to obtain the boundary curve parameters.
[0115] Based on the boundary curve parameters, the shortest distance between two adjacent convex regions is calculated. Specifically, all points on the boundary curves of the two convex regions are extracted, the Euclidean distance between any two points is calculated, and the minimum value is taken as the shortest distance between the two regions. The shortest distances of all adjacent convex regions are then organized to generate a distance matrix. This distance matrix is a two-dimensional matrix, where rows and columns correspond to convex region numbers, and matrix elements represent the shortest distances between corresponding two regions. If the shortest distance between any two adjacent convex regions in the distance matrix is less than a preset distance threshold, the two convex regions are determined to be of the same geometric structure. For example, if the same convex region splits due to differences in point cloud density, the point clouds and boundary curve parameters of the two convex regions are integrated to obtain merged convex region information. The merged convex region information includes the spatial coordinate range, boundary curve parameters, and average curvature value of the merged region.
[0116] Based on the merged information of the raised areas, the spatial coordinate data of the aligned three-dimensional point cloud model, and the local curvature information of the curvature distribution map, the geometric structural features of the surface of the printed and dyed material are integrated; the geometric structural features specifically include: the spatial position of the raised areas, the size of the raised areas, the edge morphology, and the wrinkles formed by the continuous distribution of local low curvature areas.
[0117] This step employs an iterative nearest-point algorithm to register the initial point cloud. By iteratively optimizing the transformation matrix, it eliminates positional deviations in the point cloud from multiple perspectives, thus resolving the issue of 3D shape distortion caused by inaccurate point cloud alignment. By calculating the distance matrix and merging with nearby regions, it eliminates the problem of splitting of the same protrusion due to differences in point cloud density. By clearly defining the position and shape of protrusions and wrinkles, it avoids color distortion in these areas during color projection, thereby improving the accuracy of detection.
[0118] In some embodiments, the registration image set is obtained, and corresponding pixel points are matched between images from different perspectives in the registration image set to generate an initial three-dimensional point cloud model containing spatial coordinate information of the printed material surface, including:
[0119] Obtain the registration image set; select one image from the registration image set as the reference image, and use the remaining images in the registration image set as images to be matched;
[0120] Dense feature point identification is performed on the reference image to generate a dense feature point coordinate set containing the spatial coordinates of all dense feature points;
[0121] For each dense feature point in the set of dense feature point coordinates, generate a corresponding feature vector; integrate all feature vectors to establish a benchmark image feature library;
[0122] Each image to be matched is matched with a reference image using a sliding window: based on the feature vectors of pixels in the image to be matched and the feature vectors of dense feature points in the feature library of the reference image, the Euclidean distance between the two is calculated to determine the similarity; point pairs with similarity higher than a preset matching threshold are selected as candidate matching point pairs.
[0123] Calculate the disparity map between each candidate matching point pair between the image to be matched and the reference image.
[0124] Based on the pre-calibrated intrinsic and extrinsic matrix of the multi-angle imaging device and the disparity map, the coordinates of each candidate matching point pair in three-dimensional space are calculated respectively.
[0125] Integrate the three-dimensional spatial coordinates of all candidate matching point pairs to form an initial point cloud dataset containing preliminary spatial coordinate information of the surface of the printed material.
[0126] Specifically, the registration image set is obtained, and an image whose viewing angle is closest to the orthographic projection of the printed material surface is selected from the set as the reference image. All other images in the registration image set except the reference image are used as images to be matched. Dense feature point identification is performed on the reference image. A sub-pixel corner detection algorithm can be used to extract dense feature points in the image. The aforementioned dense feature points refer to feature points that are highly distributed in the image and can cover the surface of the printed material, such as texture and edge details. The algorithm identifies all dense feature points in the reference image that meet the conditions, records the (u, v) coordinates of each feature point in the image coordinate system, and generates a dense feature point coordinate set containing the spatial coordinates of all dense feature points (here, spatial coordinates refer to two-dimensional coordinates in the image coordinate system, which will be converted to three-dimensional coordinates later).
[0127] For each dense feature point in the set of dense feature point coordinates, a corresponding feature vector is generated, which can be implemented using the BRIEF descriptor. The BRIEF descriptor is a lightweight binary feature descriptor that generates a fixed-length binary vector by randomly selecting multiple pairs of pixels in the neighborhood of the feature point and comparing their gray values. For each dense feature point, a 16×16 neighborhood window is constructed with it as the center, 256 pairs of non-repeating pixels are randomly selected, and the gray values of each pair of pixels are compared to generate a 256-bit binary feature vector. The spatial coordinates of all dense feature points and the correspondence between their feature vectors are integrated to establish a baseline image feature library.
[0128] Each image to be matched is matched with a reference image using a sliding window. Sliding window matching refers to a matching method that uses a window of a preset size in the image to be matched as a unit, traversing the image window by window, and comparing the feature vector of the pixel in the window with the feature vector in the feature library of the reference image. The specific process can be as follows: for each image to be matched, slide the window in a 5×5 window size with a step size of 1 pixel, and extract the feature vector of the center pixel of each window; based on the feature vector of the pixel in the image to be matched and the feature vector of the dense feature points in the feature library of the reference image, calculate the Euclidean distance between the two, and select point pairs with an Euclidean distance less than a preset matching threshold as candidate matching point pairs.
[0129] Based on the candidate matching point pairs between each image to be matched and the reference image, the disparity map corresponding to the two is calculated; the disparity map mentioned above is an image that reflects the difference in the projected position of the same physical point in images from different viewpoints.
[0130] Based on the pre-calibrated intrinsic and extrinsic parameter matrices of the multi-angle imaging device and the disparity map, the coordinates of each candidate matching point pair in three-dimensional space are calculated. The three-dimensional spatial coordinates corresponding to the candidate matching point pairs of all images to be matched and the reference image are integrated, and the coordinate points that are calculated repeatedly are eliminated to form an initial point cloud dataset containing preliminary spatial coordinate information of the surface of the printed material.
[0131] In some embodiments, projecting color information from the registered image set onto the three-dimensional point cloud model to obtain a three-dimensional color distribution model includes:
[0132] Extract the RGB color data of each image from the registered image set to construct an initial color dataset containing the correspondence between pixel coordinates and RGB color values;
[0133] The initial color dataset is matched one by one with the point cloud points of the 3D point cloud model, and the empty point cloud points that do not match the color data are identified.
[0134] The point cloud empty space bits are labeled with empty value identifiers;
[0135] Assign corresponding RGB color values to color points that are not labeled with null value identifiers to obtain point cloud color assignment results containing real color information;
[0136] The point cloud color assignment results are fused with the geometric structural features of the 3D point cloud model to generate a 3D color distribution model.
[0137] Specifically, RGB color data of each image is extracted from the registered image set; RGB color data is a three-channel value that represents the color of an image pixel; for each registered image, the RGB color value of the corresponding pixel is extracted one by one according to the pixel coordinates (u, v) to construct an initial color dataset containing a one-to-one correspondence between pixel coordinates (u, v) and RGB color values (R, G, B). The initial color dataset is matched one-to-one with the point cloud locations of the 3D point cloud model. Each point cloud location contains unique 3D world coordinates (X, Y, Z). The matching process is based on a preset mapping relationship, which is established by the intrinsic and extrinsic parameter matrices calibrated by the multi-angle imaging device. This mapping relationship can convert the 2D coordinates (u, v) of image pixels into 3D world coordinates (X, Y, Z). Through coordinate mapping, the point cloud location corresponding to each pixel coordinate in the initial color dataset is found, realizing the association between color data and point cloud locations and identifying point cloud gaps where no color data is matched. Point cloud gaps are point cloud locations in the 3D point cloud model that cannot match several color information from the initial color data due to blind spots, missed images, etc. These locations lack effective color information and need to be marked separately to avoid subsequent color misjudgment. Null value identifiers are marked on the point cloud empty points. The aforementioned null value identifiers are marking symbols used to clearly distinguish between point cloud empty points and valid color points, in order to avoid misjudging empty points without color information as valid color areas, or color difference detection deviations caused by missing color information. After marking, the points in the point cloud model are divided into two categories: empty points with null value identifiers and valid color points without null value identifiers.
[0138] Assign corresponding RGB color values to color points that are not marked with null identifiers; during the assignment process, find the initial color data corresponding to the color point through coordinate mapping, and directly assign the RGB color values in the data to the corresponding point cloud point to obtain the point cloud color assignment result containing real color information.
[0139] The point cloud color assignment results are fused with the geometric structural features of the three-dimensional point cloud model; the geometric structural features include three-dimensional morphological information such as raised areas and wrinkles on the surface of the printed material; during the fusion process, the RGB color values in the point cloud color assignment results are associated and stored with the geometric information of the corresponding points in the three-dimensional point cloud model, and finally a three-dimensional color distribution model is generated.
[0140] This method establishes a mapping relationship based on camera calibration parameters to match color data with point cloud locations; it explicitly marks point cloud locations with empty values using null identifiers to avoid interference from points without color information; and it deeply integrates color assignment results with geometric structural features so that the 3D color distribution model simultaneously includes spatial location, color attributes, and geometric attributes.
[0141] In some embodiments, grouping pixels in the three-dimensional color distribution model to obtain boundary features of color difference regions includes:
[0142] Obtain the spatial coordinate data and RGB color data of all pixels in the three-dimensional color distribution model, filter out the valid color points without null values based on the null value identifier, and remove the point cloud null points with null value identifiers.
[0143] For the filtered valid color points, a two-dimensional point set matrix is constructed based on spatial coordinates and RGB color values: each valid color point contains spatial coordinate parameters and RGB color parameters. The spatial coordinate parameters and RGB color parameters of each valid color point are used as a row vector. All row vectors are arranged in order to form a two-dimensional point set matrix. All row vectors contained in the two-dimensional point set matrix together constitute the set of valid pixels.
[0144] The effective pixel set is grouped to obtain a grouped cluster set; wherein, the spatial Euclidean distance and RGB color difference between two points are calculated, and the spatial Euclidean distance and RGB color difference are weighted and summed according to a preset weight as a clustering metric. Pixels with a clustering metric value less than a preset initial threshold are divided into the same cluster to obtain the grouped cluster set.
[0145] Calculate the average inter-cluster color difference value among the grouped clusters; if the average inter-cluster color difference value exceeds a preset color difference threshold, mark the corresponding cluster as a color difference region and obtain a color difference region set;
[0146] Extract adjacent pixel pairs from the edge of each color difference region from the set of color difference regions, perform edge recognition on the adjacent pixel pairs, and obtain a continuous sequence of boundary points;
[0147] The curvature change value of each point in the boundary point sequence is calculated to determine the boundary type and obtain a boundary type set. If the curvature change value exceeds the preset curvature change range, the boundary is determined to be a sharp boundary; if the curvature change value does not exceed the preset curvature change range, the boundary is determined to be a smooth boundary.
[0148] The spatial distribution information of the boundary type set and the grouped cluster set is fused, and the dimensionality reduction of the fused data is performed by the principal component analysis algorithm to obtain N sets of dimensionality-reduced feature vectors.
[0149] The N sets of feature vectors after dimensionality reduction are matched with the preset boundary template by cosine similarity to obtain the shape of the color difference region corresponding to the boundary and the boundary features of the color difference region.
[0150] Specifically, the spatial coordinate data of all pixels in the three-dimensional color distribution model are obtained; valid color points without null values are filtered out based on the null value identifier, and point cloud null points with null value identifiers are removed. For the filtered valid color points, a two-dimensional point set matrix is constructed based on the spatial coordinates and RGB color values: each valid color point contains 3 spatial coordinate parameters (X, Y, Z) and 3 RGB color parameters (R, G, B), for a total of 6 feature parameters; the 6 parameters of each valid color point are combined into a row vector in the order XYZRGB, and all row vectors are arranged in the order of the X-axis coordinates of the point cloud points in three-dimensional space to form a two-dimensional point set matrix; the above two-dimensional point set matrix is a data matrix with the number of rows equal to the number of valid color points and the number of columns of 6, which can simultaneously store the spatial position and color attributes of the points.
[0151] The effective pixel set is grouped using a clustering algorithm. The specific process is as follows: calculate the spatial Euclidean distance and RGB color difference between any two effective pixels; sum the spatial Euclidean distance and RGB color difference according to preset weights, such as a spatial distance weight of 0.3 and a color difference weight of 0.7, to obtain a clustering metric; the above clustering metric is a quantitative index that comprehensively reflects the spatial proximity and color similarity between two points. The smaller the value, the more likely the two points are to belong to the same dyeing region; pixels with clustering metric values less than the threshold are divided into the same cluster; the cluster centers are iteratively optimized to finally obtain a grouped cluster set; the grouped cluster set is a collection of multiple clusters, each cluster containing effective pixels that are spatially close and have small color differences, representing a continuous dyeing region on the surface of the printed material.
[0152] Calculate the average inter-cluster color difference value between the grouped clusters. If the average inter-cluster color difference value between two clusters exceeds the preset color difference threshold, it indicates that there is a significant color difference in the dyeing area represented by these two clusters. The clusters whose colors deviate from the normal dyeing range are marked as color difference areas. Traverse all grouped clusters and repeat the above marking operation to finally obtain the color difference area set.
[0153] The adjacent pixel pairs at the edge of each color difference region are extracted from the set of color difference regions. The adjacent pixel pairs refer to the combination of adjacent effective pixels at the edge of the color difference region, one belonging to the color difference region and the other to the normal coloring region, which are used to locate the boundary of the color difference region. The Canny edge detection algorithm is used to perform edge recognition on the adjacent pixel pairs. Continuous edge pixels are selected through edge recognition and arranged in spatial order to form a boundary point sequence. Calculate the curvature change value of each point in the boundary point sequence. The curvature change value can be obtained by selecting a point in the boundary point sequence and one adjacent point before and after it, fitting the tangents of these three points, and calculating the angle difference between two adjacent tangents. This value is used to characterize the degree of contour curvature at the boundary point. If the curvature change value of a boundary point exceeds this range, the boundary is determined to be a sharp boundary. A sharp boundary refers to a boundary type with a drastic curvature change and is commonly found at the edges of spot-like or block-like color difference areas. If the curvature change value does not exceed the preset range, the boundary is determined to be a smooth boundary. A smooth boundary refers to a boundary type with a gentle curvature change and is commonly found at the edges of strip-like or band-like color difference areas. Traverse all points in the boundary point sequence and record the boundary type corresponding to each point to form a boundary type set.
[0154] The spatial distribution information of the boundary type set and the grouped cluster set is fused to form a fused dataset. The dimensions of the fused data are boundary type, spatial range, and pixel density. Principal component analysis (PCA) is used to reduce the dimensionality of the fused data, retaining the principal components with the largest variance and eliminating redundant information. This reduces the computational load of subsequent matching while preserving core features. The principal components of the fused data are extracted using PCA to generate N sets of feature vectors after dimensionality reduction. N equals the number of color difference regions in the color difference region set, and each feature vector set corresponds to the core feature of a color difference region.
[0155] The N sets of feature vectors after dimensionality reduction are matched with the preset boundary template by cosine similarity. The closer the cosine value is to 1, the higher the vector similarity. If the cosine similarity between a feature vector set and a preset boundary template is higher than the preset matching threshold, it is determined that the shape of the color difference region corresponding to the feature vector set is consistent with the template. The boundary type, shape and spatial range of each color difference region are integrated to finally obtain the boundary features of the color difference region.
[0156] In some embodiments, based on the boundary characteristics of the color difference region, the coordinate range of the color difference region in the three-dimensional color distribution model is analyzed to determine the spatial location coordinates of the defect, including:
[0157] Obtain the boundary features of the color difference region and extract the boundary point sequence and boundary type set;
[0158] By statistically analyzing the maximum and minimum coordinates of the boundary point sequence on the X, Y, and Z axes, the preliminary coordinate range of the color difference region can be obtained.
[0159] The spatial coordinates of the defect are obtained by taking the center point coordinates of the preliminary coordinate range as the defect center coordinates and combining them with the preliminary coordinate range.
[0160] In some embodiments, the method further includes:
[0161] Obtain the three-dimensional point cloud coordinates corresponding to each boundary point in the color difference region boundary point sequence;
[0162] Query the local curvature values and convex region information of the corresponding coordinates in the geometric structure features;
[0163] If a boundary point is located in a convex region and its local curvature value is greater than a preset structural sensitivity threshold, then the boundary point is marked as a structurally sensitive boundary point.
[0164] The proportion of structurally sensitive boundary points within the color difference region is statistically analyzed. If the proportion exceeds a preset threshold, geometric deformation compensation is performed on the spatial coordinates of the color difference region: based on the boundary curve parameters of the raised region, the initial coordinate range of the original color difference region is projected onto the undeformed reference plane through a mapping function to obtain the compensated coordinate range of the color difference region; wherein, the mapping function is constructed based on the boundary curve parameters of the raised region.
[0165] The center point of the compensated color difference area coordinate range is used as the corrected defect center coordinate, and the final spatial position coordinate of the defect is obtained by combining the compensated coordinate range.
[0166] Specifically, traditional methods typically identify defects based solely on color differences, neglecting the influence of surface three-dimensional structure on image color. For example, changes in light reflection at protrusions may be misjudged as color differences. This step analyzes boundary features in conjunction with geometric structural features to determine whether color differences are caused by genuine uneven dyeing or visual artifacts resulting from physical deformation. Based on this, spatial coordinate compensation is performed, improving detection accuracy.
[0167] In some embodiments, the method further includes, before marking clusters as color difference regions:
[0168] Obtain the design template image corresponding to the current printed material, and extract the theoretical color distribution map and texture structure map of the design template image;
[0169] The three-dimensional color distribution model is projected onto a two-dimensional plane and spatially aligned with the design template image;
[0170] For each candidate color difference cluster, query the expected color value and allowed color difference range of the corresponding region in the design template image;
[0171] If the color difference between the actual color value and the expected color value of the cluster is less than the allowable color difference range, then the cluster is determined to be a color change allowed by the design and is not marked as a color difference area.
[0172] Specifically, in actual printing and dyeing production, fabrics may have patterns, jacquards, or gradients. These designs themselves contain color variations, which can easily be misjudged as color difference defects. By following the steps above, the color variations allowed by the design can be effectively screened out, avoiding the mismarking of such non-defective color differences as color difference areas.
[0173] Reference Figure 2 The second embodiment of the present invention provides a dyeing and printing defect detection system, comprising:
[0174] The first processing module 201 is used to: acquire images of the surface of the printed and dyed material through a multi-angle imaging device arranged on the production line, and obtain a set of original images containing multiple perspectives;
[0175] The second processing module 202 is used to: perform alignment processing on the original image set to obtain a registered image set under a unified coordinate system;
[0176] The third processing module 203 is used to: generate a three-dimensional point cloud model based on the registered image set and obtain the geometric structural features of the surface of the printed material;
[0177] The fourth processing module 204 is used to: project the color information in the registered image set onto the three-dimensional point cloud model to obtain a three-dimensional color distribution model;
[0178] The fifth processing module 205 is used to: group the pixels in the three-dimensional color distribution model to obtain the boundary features of the color difference region;
[0179] The sixth processing module 206 is used to: analyze the coordinate range of the color difference region in the three-dimensional color distribution model based on the boundary characteristics of the color difference region, and determine the spatial location coordinates of the defect.
[0180] It should be noted that the dyeing defect detection system provided in this embodiment of the invention is used to execute all the process steps of the dyeing defect detection method in the above embodiment. The working principles and beneficial effects of the two are one-to-one, so they will not be described again.
[0181] In the description of this application, the terms "first" and "second" are used for descriptive purposes only and should not be construed as indicating or implying relative importance or implicitly specifying the number of technical features indicated. Therefore, a feature defined as "first" or "second" may explicitly or implicitly include one or more features. In the description of this application, "multiple" means two or more, unless otherwise explicitly specified.
[0182] In the above embodiments, the descriptions of each embodiment have different focuses. For parts not described in detail in a certain embodiment, please refer to the relevant descriptions in other embodiments.
[0183] The embodiments, implementation methods, and related technical features of this application can be combined and substituted for each other without conflict.
[0184] The above are merely preferred embodiments of this application and are not intended to limit this application in any way. Any simple modifications, equivalent changes, and alterations made to the above embodiments based on the technical essence of this application without departing from the scope of the technical solution of this application shall still fall within the scope of the technical solution of this application.
Claims
1. A method for detecting defects in printing and dyeing, characterized in that, include: Images of the printed and dyed materials are acquired by multi-angle imaging devices deployed on the production line, resulting in a set of original images containing multiple perspectives. The original image set is aligned to obtain a registered image set in a unified coordinate system; A three-dimensional point cloud model is generated based on the registered image set, and the geometric structural features of the printed and dyed material surface are obtained; The color information in the registered image set is projected onto the three-dimensional point cloud model to obtain a three-dimensional color distribution model; The boundary features of the color difference region are obtained by grouping the pixels in the three-dimensional color distribution model. Based on the boundary characteristics of the color difference region, the coordinate range of the color difference region in the three-dimensional color distribution model is analyzed to determine the spatial location coordinates of the defect.
2. The method according to claim 1, characterized in that, The original image set is aligned to obtain a registered image set in a unified coordinate system, including: Key feature points are extracted from the original image set; feature descriptors corresponding to the key feature points are generated using a scale-invariant feature transformation algorithm. Initial matching point pairs are obtained by matching the feature descriptors; if the number of initial matching point pairs exceeds a preset matching number threshold, an abnormal matching point in the initial matching point pairs is removed by a random sampling consensus algorithm to obtain reliable matching point pairs. Calculate the affine transformation matrix based on the reliable matching point pairs and extract the coordinate transformation parameters from it; Based on the coordinate transformation parameters, the original image set is geometrically corrected to obtain a corrected image set; The scale difference of the corrected image set is detected. If the scale difference exceeds a preset scale threshold, a scale adjustment operation is performed on the corrected image set to obtain a scale-consistent image set. The rotation angle deviation of the scale-consistent image set is detected. If the rotation angle deviation is greater than a preset angle threshold, a rotation matrix is applied to the scale-consistent image set to perform rotation correction, thereby obtaining a rotation-corrected image set. The translation vector between the rotation-corrected image set and the preset reference coordinate system is calculated to obtain the translation deviation; if the translation deviation is greater than the preset translation threshold, the translation vector is fused to perform translation correction on the rotation-corrected image set to obtain a registered image set under a unified coordinate system.
3. The method according to claim 2, characterized in that, A three-dimensional point cloud model is generated based on the registered image set, and the geometric structural features of the printed material surface are obtained, including: The registered image set is obtained, and the corresponding pixel points of the images from different perspectives in the registered image set are matched to generate an initial three-dimensional point cloud model containing the spatial coordinate information of the surface of the dyed material. The initial 3D point cloud model is registered using the iterative nearest point algorithm to obtain the aligned 3D point cloud model. Based on the aligned 3D point cloud model, the local curvature value of each point cloud location is calculated to generate a curvature distribution map of the printed material surface. If the local curvature value of a point cloud location in the curvature distribution map exceeds a preset curvature threshold, then the area formed by that point and its adjacent points is marked as a convex region, thus obtaining a set of convex regions. Extract the boundary points of each protruding region from the set of protruding regions, and perform quadratic curve fitting on the boundary points to obtain the boundary curve parameters; The shortest distance between two adjacent raised regions is calculated based on the boundary curve parameters to generate a distance matrix. If the shortest distance between any two adjacent raised regions in the distance matrix is less than a preset distance threshold, the two raised regions are determined to be of the same geometric structure, and the two raised regions are merged to obtain information on the merged raised region. Based on the merged raised area information, the spatial coordinate data of the aligned three-dimensional point cloud model, and the local curvature information of the curvature distribution map, the geometric structural features of the printed and dyed material surface are obtained.
4. The method according to claim 3, characterized in that, Obtain the registered image set, perform corresponding pixel matching on images from different perspectives in the registered image set, and generate an initial 3D point cloud model containing the spatial coordinate information of the printed material surface, including: Obtain the registration image set; select one image from the registration image set as the reference image, and use the remaining images in the registration image set as images to be matched; Dense feature point identification is performed on the reference image to generate a dense feature point coordinate set containing the spatial coordinates of all dense feature points; For each dense feature point in the set of dense feature point coordinates, generate a corresponding feature vector; integrate all feature vectors to establish a benchmark image feature library; Each image to be matched is matched with a reference image using a sliding window: based on the feature vectors of pixels in the image to be matched and the feature vectors of dense feature points in the feature library of the reference image, the Euclidean distance between the two is calculated to determine the similarity; point pairs with similarity higher than a preset matching threshold are selected as candidate matching point pairs. Calculate the disparity map between each candidate matching point pair between the image to be matched and the reference image. Based on the pre-calibrated intrinsic and extrinsic matrix of the multi-angle imaging device and the disparity map, the coordinates of each candidate matching point pair in three-dimensional space are calculated respectively. Integrate the three-dimensional spatial coordinates of all candidate matching point pairs to form an initial point cloud dataset containing preliminary spatial coordinate information of the surface of the printed material.
5. The method according to claim 4, characterized in that, Projecting the color information from the registered image set onto the 3D point cloud model to obtain a 3D color distribution model includes: Extract the RGB color data of each image from the registered image set to construct an initial color dataset containing the correspondence between pixel coordinates and RGB color values; The initial color dataset is matched one by one with the point cloud points of the 3D point cloud model, and the empty point cloud points that do not match the color data are identified. The point cloud empty space bits are labeled with empty value identifiers; Assign corresponding RGB color values to color points that are not labeled with null value identifiers to obtain point cloud color assignment results containing real color information; The point cloud color assignment results are fused with the geometric structural features of the 3D point cloud model to generate a 3D color distribution model.
6. The method according to claim 5, characterized in that, The boundary features of color difference regions are obtained by grouping the pixels in the three-dimensional color distribution model, including: Obtain the spatial coordinate data and RGB color data of all pixels in the three-dimensional color distribution model, filter out the valid color points without null values based on the null value identifier, and remove the point cloud null points with null value identifiers. For the filtered valid color points, a two-dimensional point set matrix is constructed based on spatial coordinates and RGB color values: each valid color point contains spatial coordinate parameters and RGB color parameters. The spatial coordinate parameters and RGB color parameters of each valid color point are used as a row vector. All row vectors are arranged in order to form a two-dimensional point set matrix. All row vectors contained in the two-dimensional point set matrix together constitute the set of valid pixels. The effective pixel set is grouped to obtain a grouped cluster set; wherein, the spatial Euclidean distance and RGB color difference between two points are calculated, and the spatial Euclidean distance and RGB color difference are weighted and summed according to a preset weight as a clustering metric. Pixels with a clustering metric value less than a preset initial threshold are divided into the same cluster to obtain the grouped cluster set. Calculate the average inter-cluster color difference value among the grouped clusters; if the average inter-cluster color difference value exceeds a preset color difference threshold, mark the corresponding cluster as a color difference region and obtain a color difference region set; Extract adjacent pixel pairs from the edge of each color difference region from the set of color difference regions, perform edge recognition on the adjacent pixel pairs, and obtain a continuous sequence of boundary points; The curvature change value of each point in the boundary point sequence is calculated to determine the boundary type and obtain a boundary type set. If the curvature change value exceeds the preset curvature change range, the boundary is determined to be a sharp boundary; if the curvature change value does not exceed the preset curvature change range, the boundary is determined to be a smooth boundary. The spatial distribution information of the boundary type set and the grouped cluster set is fused, and the dimensionality reduction of the fused data is performed by the principal component analysis algorithm to obtain N sets of dimensionality-reduced feature vectors. The N sets of feature vectors after dimensionality reduction are matched with the preset boundary template by cosine similarity to obtain the shape of the color difference region corresponding to the boundary and the boundary features of the color difference region.
7. The method according to claim 6, characterized in that, Based on the boundary characteristics of the color difference region, the coordinate range of the color difference region in the three-dimensional color distribution model is analyzed to determine the spatial location coordinates of the defect, including: Obtain the boundary features of the color difference region and extract the boundary point sequence and boundary type set; By statistically analyzing the maximum and minimum coordinates of the boundary point sequence on the X, Y, and Z axes, the preliminary coordinate range of the color difference region can be obtained. The spatial coordinates of the defect are obtained by taking the center point coordinates of the preliminary coordinate range as the defect center coordinates and combining them with the preliminary coordinate range.
8. The method according to claim 7, characterized in that, The method further includes: Obtain the three-dimensional point cloud coordinates corresponding to each boundary point in the color difference region boundary point sequence; Query the local curvature values and convex region information of the corresponding coordinates in the geometric structure features; If a boundary point is located in a convex region and its local curvature value is greater than a preset structural sensitivity threshold, then the boundary point is marked as a structurally sensitive boundary point. The proportion of structurally sensitive boundary points within the color difference region is statistically analyzed. If the proportion exceeds a preset threshold, geometric deformation compensation is performed on the spatial coordinates of the color difference region: based on the boundary curve parameters of the raised region, the initial coordinate range of the original color difference region is projected onto the undeformed reference plane through a mapping function to obtain the compensated coordinate range of the color difference region; wherein, the mapping function is constructed based on the boundary curve parameters of the raised region. The center point of the compensated color difference area coordinate range is used as the corrected defect center coordinate, and the final spatial position coordinate of the defect is obtained by combining the compensated coordinate range.
9. The method according to claim 8, characterized in that, Before labeling clusters as color difference regions, the method further includes: Obtain the design template image corresponding to the current printed material, and extract the theoretical color distribution map and texture structure map of the design template image; The three-dimensional color distribution model is projected onto a two-dimensional plane and spatially aligned with the design template image; For each candidate color difference cluster, query the expected color value and allowed color difference range of the corresponding region in the design template image; If the color difference between the actual color value and the expected color value of the cluster is less than the allowable color difference range, then the cluster is determined to be a color change allowed by the design and is not marked as a color difference area.
10. A dyeing and printing defect detection system, characterized in that, include: The first processing module is used to: acquire images of the surface of the printed and dyed material through a multi-angle imaging device arranged on the production line, and obtain a set of original images containing multiple perspectives; The second processing module is used to: perform alignment processing on the original image set to obtain a registered image set under a unified coordinate system; The third processing module is used to: generate a three-dimensional point cloud model based on the registered image set and obtain the geometric structural features of the surface of the printed material; The fourth processing module is used to: project the color information in the registered image set onto the three-dimensional point cloud model to obtain a three-dimensional color distribution model; The fifth processing module is used to: group the pixels in the three-dimensional color distribution model to obtain the boundary features of the color difference region; The sixth processing module is used to: analyze the coordinate range of the color difference region in the three-dimensional color distribution model based on the boundary characteristics of the color difference region, and determine the spatial location coordinates of the defect.
Citation Information
Patent Citations
Stamping plate defect detection system and method based on laser point cloud
CN118608481A
Vision-based point cloud image fusion method
CN119445005A
Three-dimensional digital protection and micro-change detection method for cultural relic mural
CN119887622A
Vision-based traditional Chinese medicinal material defect detection method
CN120374870A
Multi-projection picture splicing method and system based on geometric correction
CN120434366A
