Method and device for detecting printing defects based on color channel stitching
By combining color channel splicing and deep learning models, the problems of low efficiency and insufficient accuracy of traditional detection methods in color printing are solved, achieving efficient and accurate printing defect detection, which is particularly suitable for high-quality printing quality inspection.
Patent Information
- Application Number
- CN202511252138.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-09-03
- Publication Date
- 2025-12-16
- Estimated Expiration
- 2045-09-03
AI Technical Summary
In the color printing process, traditional manual visual inspection is inefficient and has the risk of missing detections. Furthermore, existing algorithms are unable to accurately identify complex color deviations and printing defects in complex backgrounds. Model training suffers from data bottlenecks and unbalanced class distribution, resulting in insufficient detection accuracy and robustness.
A color channel-based printing defect detection method is adopted. By stitching the reference image and the image to be detected along the channel axis in the same color space, a deep learning model is used for defect segmentation. Combined with angle consistency mismatch point filtering and morphological processing, the detection accuracy and robustness are improved.
It achieves efficient and accurate printing defect detection, capable of identifying defects at the 0.1 square millimeter level, suitable for high-quality printing quality inspection, reducing the false positive rate and improving the model's adaptability.
Smart Images

Figure CN120823196B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the technical field of printing defect detection, in particular to a printing defect detection method and device based on color channel splicing. BACKGROUND
[0002] In the process of color printing, equipment failure can cause various printing defects, including printing missing, color deviation, irregular stripes caused by color band wrinkles, and impurities mixed in, etc. Especially in the field of high security printing such as cards and certificates, the traditional quality control method relying on manual visual inspection not only has low efficiency (the average single detection time is more than 3 seconds), but also has the risk of missing detection. In order to realize efficient and accurate quality detection, automatic detection technology based on computer vision becomes an inevitable choice, but it needs to meet three core requirements:
[0003] (1) The detection accuracy needs to reach the micro resolution of 0.1 mm2; (2) The algorithm needs to have the ability of collaborative detection of multiple defects, including but not limited to the above printing defect types; (3) In some special scenarios such as card printing, the printed text or image has personalized features (such as personalized name, certificate number, portrait, etc.), and the algorithm needs to be robust when printing personalized information.
[0004] The implementation of this technology mainly faces the following technical challenges:
[0005] Firstly, there are multiple interference factors in the imaging link: the color distortion generated in the printing process and the imaging environment light interference superimposed form a composite color deviation, which makes it difficult for traditional color difference judgment methods to accurately identify the real color difference. At the same time, the complex background pattern on the printing substrate and the high light reflection characteristics of the post-processing anti-counterfeiting elements are easy to cause dynamic range compression of the imaging system (typical performance is the loss of details in the highlight area), causing false defect interference misjudgment.
[0006] Secondly, there are algorithm challenges in the defect recognition level: the non-linear deformation characteristics of the wrinkle stripe and the morphological diversity of the random impurities make it difficult for traditional rule-based image processing algorithms to effectively generalize. Especially in the field of personalized text / image features in card printing, it is unpredictable and cannot be learned through conventional samples, which puts higher requirements on the robustness and adaptability of the algorithm.
[0007] Thirdly, there is a data bottleneck in model training: in actual application, it is impossible to exhaustively collect samples of all types of printing defects, and existing defect samples not only have limited quantity, but also have serious class distribution imbalance problem, which leads to overfitting and missing detection phenomenon of traditional supervised learning model.
[0008] In view of the above technical bottlenecks, it is urgent to develop an intelligent high-precision detection solution to realize real-time and accurate identification of printing defects under complex working conditions.
[0009] In the cause analysis of printing defects, different defect types have clear corresponding relationship with the abnormal performance of CMYK four-color channels:
[0010] 1. Printing missing: It is manifested as that the CMYK four-color inks in a specific area are not effectively attached, forming a completely blank defect without printing. Such defects are often caused by ink supply system failure or abnormal surface of the printing substrate, resulting in overall ink rejection;
[0011] 2. Color deviation defects: caused by abnormality of single or multiple color channels, which can be divided into two categories:
[0012] (1) Channel missing type color deviation: when the ink of any C / M / Y channel is not attached, it will cause the complementary color to be developed (C missing shows red tone, M missing shows green tone, Y missing shows blue tone); for gray scale printing, K ink is usually used for printing, and when K is missing, it will cause gray scale printing missing defect;
[0013] (2) Ink shortage type color deviation: the ink amount of a single or multiple channels does not reach the set value (such as C channel ink amount is reduced by 50%), causing the color space coordinates to deviate from the standard value;
[0014] 3. Wrinkle stripe: essentially belongs to dynamic printing missing, caused by the deformation of the color band, resulting in a sudden drop in the transfer rate of four-color inks in the local area, which presents intermittent linear missing characteristics in the microscopic scale;
[0015] 4. Impurity pollution: it is manifested as that the exogenous substance (such as black impurity) covering the area causes double abnormality:
[0016] (1) Physical covering causes the loss of underlying four-color printed information (positive missing);
[0017] (2) Abnormal response value of impurity itself in four-color channel imaging (reverse interference);
[0018] This mechanism model reveals the essential characteristics of printing defects: from the perspective of separating four-color channels, all defects can be decomposed into abnormal gain (impurity interference) or abnormal attenuation (missing / ink shortage) of a specific channel. SUMMARY
[0019] In order to solve the problem of printing defect detection in the prior art, the present application provides a printing defect detection method and device based on color channel splicing. The following technical solutions are adopted:
[0020] The printing defect detection method based on color channel splicing comprises the following steps:
[0021] Step 1, align the first reference image to the image to be detected; align the second reference image to the image to be detected; the first reference image is a printed original, and the second reference image is a printed original of a background pattern or an object imaging image printed with a complex background;
[0022] Step 2, respectively convert the first reference image, the second reference image and the image to be detected to a specified color space;
[0023] Step 3, in the same color space, based on the color channel, the first reference image, the second reference image and the image to be detected are spliced along the channel axis to form a plurality of spliced images;
[0024] Step 4, using the spliced image data set to train a deep learning model specially used for defect segmentation;
[0025] Step 5, according to step 3, respectively input the spliced images into the deep learning model trained in step 4 to perform defect segmentation, and obtain a binary defect segmentation result;
[0026] Step 6, integrate the segmentation results of all color channels to form a final defect segmentation image.
[0027] By adopting the above technical scheme, the reference image and the image to be detected are processed after accurate alignment. Firstly, in the same color space, the two images are spliced along the channel axis according to the color channel to obtain spliced images of each color channel. A deep learning model specially used for defect segmentation is trained using the spliced image data set. The backbone network of the segmentation model can be UNet, DeepLab, HRNet, etc. The loss function can be one or a combination of more than one of cross-entropy loss function, DiceLoss, FocalLoss, etc. During training, R_combine, G_combine, B_combine or C_combine, M_combine, Y_combine can be used to train respective models, or a model can be trained together. In the testing stage, the trained segmentation network is applied to analyze the new input spliced image and identify the potential defect area. For the samples to be tested, the spliced images R_combine, G_combine, B_combine or C_combine, M_combine, Y_combine are obtained according to step 2. The above images are respectively input into the model trained in step 3 to perform defect segmentation, and a binary defect segmentation result is obtained, wherein the defect area takes value 255 and the normal area takes value 0.
[0028] This method realizes high efficiency and accuracy by reducing manual intervention, and can accurately segment different sizes, shapes and types of printing defects.
[0029] Optionally, step 7 is further included, and morphological processing is performed on the defect segmentation image obtained in step 6 to retain the defect area exceeding a set threshold T.
[0030] Optionally, the threshold T in step 7 is set to 0.1 square millimeter of the defect area.
[0031] By adopting the technical scheme, defects of 0.1 square millimeter level can be detected, and the technical scheme is particularly suitable for high-quality printing quality inspection.
[0032] Optionally, step 1 includes the following sub-steps:
[0033] Step 11, the card certificate target area is segmented from the image to be detected to ensure that the size ratio of the first reference image and the card certificate target to be detected is consistent;
[0034] Step 12, the false matching points are filtered based on the angle consistency.
[0035] Optionally, step 12 includes the following sub-steps:
[0036] Step 121, feature point detection is performed on the reference image and the card certificate image to be detected respectively, and preliminary matching is completed through a feature descriptor to obtain N groups of matching point pairs;
[0037] Step 122, the two images are horizontally spliced, connection line segments of all matching point pairs are drawn, and the inclination angle of each line segment is calculated;
[0038] Step 123, the interval [-180°, 180°] is divided into M sub-intervals, the frequency of the inclination angle in each interval is counted, a histogram is generated, the angle interval with the highest number of votes is selected, and the mean value of all angles in the angle interval is calculated.
[0039] Step 124, a deviation threshold A of the angle is set, the abnormal matching point pairs with a deviation of the included angle from the mean value exceeding A are removed, and the matching point pairs with a deviation of the angle not exceeding A are retained.
[0040] By adopting the technical scheme, the second reference image can be a printing original of a background pattern, or an imaging image of an object only printed with a complex background. The use of the second reference image mainly reduces the influence of the complex background on the defect detection and avoids false positives. Some scenes can only use the first reference image, and some scenes can use the first reference image and the second reference image at the same time, which is not limited here. In order to realize accurate alignment, an image alignment and false matching point filtering process (taking card certificate detection as an example) is adopted, and the target is cropped: the card certificate target area is segmented from the image to be detected to ensure that the size ratio of the reference image (the printing original) and the card certificate target to be detected is basically consistent.
[0041] Wherein the feature point detection in step 121 preferably adopts SIFT, ORB or SURF algorithm; in step 123, every 5° interval can be adopted; and in step 124, the angle deviation threshold is 5°.
[0042] Based on the angle consistency of the mismatched point filtering. For rigid body transformation (translation / rotation), the correct matching point corresponds to the similar offset vector direction, while the offset direction of the mismatched point is randomly distributed. By counting the offset angle histogram of the matching point pair, the abnormal matching can be effectively eliminated.
[0043] Optionally, in step 3, for color printing defect detection, RGB color space or CMY color space is adopted for splicing according to the color space used by the printing equipment.
[0044] For gray-scale printing quality inspection, the K channel of the CMYK space, the L channel of the LAB space or the V channel of the HSV space is adopted for splicing.
[0045] Optionally, in step 3, if the image is spliced based on the RGB color space, the R channel of the first reference image and the R channel of the to-be-detected image are spliced into a new image R_combine, R_combine is a 2-channel image, the first channel is the R channel of the first reference image, and the second channel is the R channel of the to-be-detected image; similarly, a new image G_combine of the G channel and a new image B_combine of the B channel are obtained.
[0046] If the image is spliced based on the CMY color space, the obtained images are C_combine, M_combine and Y_combine respectively.
[0047] Optionally, if the original printed object of the to-be-detected image is printed on an object with a pre-printed background image, the splicing method in step 3 is to splice the R channel of the first reference image, the R channel of the second reference image and the R channel of the to-be-detected image into R_combine in the form of channel splicing, and similarly, G_combine and B_combine are obtained.
[0048] By adopting the above technical scheme, according to the color channel splicing method, if a printing defect occurs, the difference between the reference image and the to-be-detected image on the single-channel image can be captured, and a accurate and robust segmentation model can be trained. Since the reference image information is used, the robustness problem caused by the unpredictability of personalized text / image features can be better handled, and the adaptive ability of the model is improved. Compared with the transformation detection scheme (such as the Siam-Unet method), the proposed technical scheme has higher accuracy and faster detection speed.
[0049] The printing defect detection device based on color channel splicing comprises an imaging device, a storage medium and a processor, the imaging device is used for imaging a printing object to be detected to obtain a to-be-detected image, the storage medium stores a printing defect detection program and a reference image designed by using a printing defect detection method based on color channel splicing, the storage medium communicates with the imaging device to interact with the to-be-detected image, the processor is in communication connection with the storage medium, executes the printing defect detection program, inputs the to-be-detected image into the printing defect detection program, runs the printing defect detection program to output a defect detection result, and stores the defect detection result in the storage medium.
[0050] Optionally, the device further comprises a display device in communication connection with the storage medium, used for displaying the defect detection result.
[0051] In summary, the present application comprises the following at least beneficial technical effects:
[0052] The present application can provide a printing defect detection method and device based on color channel splicing, which processes the reference image and the to-be-detected image after accurate alignment, first splices the two images along the channel axis according to the color channel in the same color space to obtain a splicing image of each color channel. Then, the trained defect segmentation network is used to perform a defect segmentation operation on the spliced image, and finally, the segmentation results of all color channels are fused to generate the final defect detection result. This method realizes high efficiency and accuracy by reducing manual intervention, can accurately segment different sizes, shapes and types of printing defects, can detect defects of 0.1 square millimeter level, and is especially suitable for high-quality printing quality inspection. BRIEF DESCRIPTION OF DRAWINGS
[0053] Figure 1 is a flowchart of the printing defect detection method based on color channel splicing of the present application;
[0054] Figure 2 is a schematic diagram of a to-be-detected image in a specific embodiment of the present application;
[0055] Figure 3 is a splicing result image obtained by splicing the first reference image and Figure 2 the to-be-detected image in the middle according to the color channel in a specific embodiment of the present application;
[0056] Figure 4 is a splicing result image obtained by splicing the first reference image and Figure 2 the to-be-detected image on the right according to the color channel in a specific embodiment of the present application;
[0057] Figure 5 is a defect segmentation result image obtained by performing a defect segmentation operation on Figure 3 and Figure 4a label image produced by stitching the stitching images. DETAILED DESCRIPTION
[0058] The present application is further described in detail below with reference to the accompanying drawings.
[0059] The embodiment of the present application discloses a printing defect detection method and device based on color channel stitching.
[0060] Reference Figures 1-5 The printing defect detection method based on color channel stitching comprises the following steps:
[0061] Step 1, align the first reference image to the image to be detected; align the second reference image to the image to be detected; the first reference image is a printing original, and the second reference image is a printing original of a background pattern or an object imaging image printed only with a complex background;
[0062] Step 2, respectively convert the first reference image, the second reference image and the image to be detected to a specified color space;
[0063] Step 3, in the same color space, based on the color channel, stitch the first reference image, the second reference image and the image to be detected along the channel axis to form a plurality of stitching images;
[0064] Step 4, use the stitched image data set to train a deep learning model specially used for defect segmentation;
[0065] Step 5, according to step 3, respectively input the stitching images into the deep learning model trained in step 4 to perform defect segmentation, and obtain a binary defect segmentation result;
[0066] Step 6, integrate the segmentation results of all color channels to form a final defect segmentation image.
[0067] After the precise alignment of the reference image and the image to be detected, the processing is performed on the two images. First, in the same color space, the two images are spliced along the channel axis according to the color channel to obtain a spliced image of each color channel. A deep learning model dedicated to defect segmentation is trained using the spliced image dataset. The backbone network of the segmentation model can be UNet, DeepLab, HRNet, etc. The loss function can be one or a combination of multiple fusion of cross-entropy loss function, DiceLoss, FocalLoss, etc. During training, R_combine, G_combine, B_combine or C_combine, M_combine, Y_combine can be used to train the respective model, or they can be combined to train one model. In the test stage, the trained segmentation network is applied to analyze the new input spliced image and identify potential defect areas. For the samples to be tested, the spliced images R_combine, G_combine, B_combine or C_combine, M_combine, Y_combine are obtained according to step 2. The above images are input into the model trained in step 3 for defect segmentation to obtain a binary defect segmentation result, where the defect area is valued as 255 and the normal area is valued as 0.
[0068] This method achieves high efficiency and accuracy by reducing manual intervention, and can accurately segment different sizes, shapes and types of printing defects.
[0069] Step 7 also includes morphological processing of the defect segmentation image obtained in step 6 to retain defect areas exceeding a set threshold T.
[0070] In step 7, the threshold T is set to 0.1 square millimeters of defect area.
[0071] By adopting the above technical scheme, defects of 0.1 square millimeter level can be detected, which is particularly suitable for high-quality printing quality inspection.
[0072] Step 1 includes the following sub-steps:
[0073] Step 11 segments the target area of the card from the image to be detected to ensure that the size of the first reference image is consistent with the target size of the card to be detected.
[0074] Step 12 filters out mismatched points based on angle consistency.
[0075] Step 12 includes the following sub-steps:
[0076] Step 121 detects feature points on the reference image and the card image to be detected, respectively, and completes preliminary matching through feature descriptors to obtain N sets of matched point pairs.
[0077] Step 122, horizontally splice the two images, draw the connecting line segments of all matching point pairs, and calculate the inclination angle of the straight line where each line segment is located;
[0078] Step 123, divide the [-180°, 180°] interval into M subintervals, count the frequency of the inclination angles in each interval, generate a histogram, select the angle interval with the highest number of votes, and calculate the mean of all angles in the angle interval;
[0079] Step 124, set an angle deviation threshold A, remove abnormal matching point pairs whose included angle deviation exceeds A, and keep matching point pairs whose angle deviation does not exceed A.
[0080] The second reference image can be a printed original of the background pattern, or an imaging image of an object with only a complex background printed. The use of the second reference image mainly reduces the impact of the complex background on defect detection and avoids false positives. Some scenarios can only use the first reference image, while others can use both the first and second reference images, which is not limited here. In order to achieve accurate alignment, the image alignment and false matching point filtering process (taking card detection as an example) is adopted, and the target is cropped: the card target area is segmented from the image to be detected to ensure that the size ratio of the reference image (printed original) and the target to be detected card is basically consistent.
[0081] Among them, the feature point detection in step 121 is preferably SIFT, ORB or SURF algorithm; In step 123, every 5° can be used as an interval; In step 124, the angle deviation threshold is 5°.
[0082] False matching point filtering based on angle consistency. For rigid body transformation (translation / rotation), correct matching points correspond to similar offset vector directions, while the offset directions of false matching points are randomly distributed. By counting the offset angle histogram of the matching points, abnormal matching can be effectively removed.
[0083] In step 3, according to the color space used by the printing equipment, for the printing defect detection of color printed matter, RGB color space or CMY color space is used for splicing;
[0084] For gray-scale printing quality inspection, the K channel of the CMYK space, the L channel of the LAB space, or the V channel of the HSV space is used for splicing.
[0085] In step 3, if the image is stitched based on the RGB color space, the R channel of the first reference image and the R channel of the image to be detected are stitched together to form a new image R_combine. R_combine is a 2-channel image, the first channel of which is the R channel of the first reference image and the second channel of which is the R channel of the image to be detected. Similarly, a new image G_combine with the G channel and a new image B_combine with the B channel are obtained.
[0086] If images are stitched together based on the CMY color space, the resulting images are C_combine, M_combine, and Y_combine, respectively.
[0087] If the original printed copy of the image to be detected was printed on an object with a pre-printed background image, then the stitching method in step 3 is to stitch the R channel of the first reference image, the R channel of the second reference image, and the R channel of the image to be detected into R_combine by channel stitching, and similarly obtain G_combine and B_combine.
[0088] Based on the color channel stitching method, if printing defects occur, it can help capture the differences between the reference image and the image to be detected in a single-channel image, making it easier to train an accurate and robust segmentation model.
[0089] A printing defect detection device based on color channel stitching includes an imaging device, a storage medium, and a processor. The imaging device is used to image the printed object to be detected to obtain an image to be detected. The storage medium stores a printing defect detection program and a reference image designed using a printing defect detection method based on color channel stitching. The storage medium communicates with the imaging device to interact with the image to be detected. The processor is communicatively connected to the storage medium, executes the printing defect detection program, inputs the image to be detected into the printing defect detection program, runs the printing defect detection program, outputs the defect detection result, and stores the defect detection result in the storage medium.
[0090] It also includes a display device, which is communicatively connected to the storage medium for displaying defect detection results.
[0091] The following specific embodiments illustrate the implementation principle of the printing defect detection method and device based on color channel splicing:
[0092] like Figure 2 As shown, these are the first reference image after alignment and two images to be inspected that show printing defects, respectively. Figure 2 The middle image shows two defects: missing print and inclusion of black impurities. Figure 2 The right image shows the color shift caused by the lack of ink in the C, M, and Y channels, respectively.
[0093] Figure 2 The left image is the first reference image (i.e., the original printed electronic image); the middle image shows two types of defects: printing defects and impurities. The upper left corner of the black rectangle indicates a printing defect, while the lower right black rectangle of the khaki rectangle indicates an impurity defect; the right image shows three types of color shift defects. The upper left blue rectangle is caused by a lack of ink in the Y channel, the lower right red rectangle of the black rectangle and the upper left corner of the khaki rectangle are both caused by a lack of ink in the C channel, and the lower right greenish rectangle of the khaki rectangle is caused by a lack of ink in the M channel.
[0094] Will Figure 2 The three images in the image are converted to the RGB color space, and the first reference image and... Figure 2 The R channels of the intermediate images to be detected are stitched together, with the R channel of the first reference image used as the B channel of R_combine, and the R channel of the image to be detected used as the G channel of R_combine. The R channel of R_combine is set to 0, resulting in an image as shown below. Figure 3 As shown in the left image. Similarly, by stitching the G channels of the first reference image and the image to be detected, the resulting image is as follows. Figure 3 As shown in the middle image, the B channels of the first reference image and the image to be detected are stitched together to obtain the following image: Figure 2 As shown in the right figure. If a second reference image is used, R_combine is constructed as follows: the R channel of the first reference image is used as the B channel of R_combine, the R channel of the image to be detected is used as the G channel of R_combine, and the R channel of the second reference image is used as the R channel of R_combine. Color channel stitching involves stitching together the same color channel images of the first reference image, the second reference image (if it exists), and the image to be detected for a specific color channel, without restriction on the stitching order.
[0095] Figure 3 It is to combine the first reference image and Figure 2 The image in the middle is the stitched result obtained by stitching the image to be inspected according to its color channels. The left, middle, and right sides represent R_combine, G_combine, and B_combine, respectively. The green rectangles in the image correspond to areas with missing printing in the image to be inspected, and the blue rectangle in the lower right corner corresponds to areas in the image to be inspected that contain impurities.
[0096] Will Figure 2 The first reference image and Figure 2 The stitching result obtained by stitching the image to be detected on the right according to its color channels is as follows: Figure 4 As shown.
[0097] Figure 4 It is to combine the first reference image and Figure 2The stitching result image obtained by stitching the right image to be detected according to the color channels. The left, middle and right are R_combine, G_combine and B_combine respectively. The two small rectangular frames in the left image are the rectangular frame regions of the red color deviation caused by the C channel ink missing in the image to be detected; the small rectangular frame in the lower right corner of the middle image corresponds to the rectangular frame region of the green color deviation caused by the M channel ink missing in the image to be detected; and the small rectangular frame in the upper left corner of the right image corresponds to the rectangular frame region of the blue color deviation caused by the Y channel ink missing in the image to be detected.
[0098] From Figure 3 and Figure 4 , it can be seen that the printing missing and the mixed impurities have an impact on R_combine, G_combine and B_combine. Specifically, the printing missing area will appear green, and the mixed impurity (mainly black impurity) area will appear blue, and the normally printed area will appear gray. The color deviation defect has an impact on the corresponding stitching image according to different reasons. Specifically, the C channel ink missing will cause R_combine to appear green in the defect area; the M channel ink missing will cause G_combine to appear green in the defect area; and the Y channel ink missing will cause B_combine to appear green in the defect area. Figure 3 and Figure 4 , the essential characteristics of the printing defects can also be verified: from the perspective of four color channel separation, all defects can be decomposed into abnormal gain (impurity interference, blue in the stitching image) or abnormal attenuation (missing / insufficient ink, green in the stitching image) of a specific channel.
[0099] By comparing Figure 2 , Figure 3 and Figure 4 , for printing missing, color deviation, wrinkle stripe and mixed impurities, if the first reference image and the image to be detected are fused into the change detection network for detection using the change detection idea, a complex model is needed to handle multiple defects. Through in-depth analysis of the color channel separation perspective, it can be seen that (see Figure 3 , Figure 4 ), all printing defects can be essentially decomposed into two abnormal states of a specific channel: abnormal gain (channel signal enhancement caused by impurity interference) showing blue in the stitching image, or abnormal attenuation (channel signal weakening caused by ink missing / insufficient ink) showing green. Figure 2 , Figure 3 , Figure 4The experimental results can know that although the printing defects exist in different forms such as missing, color deviation, wrinkle stripe and impurity mixing, but after the first reference image and the image to be detected are spliced according to the color channel, various defects are converted into the gain / decay binary problem of the channel dimension. This feature decomposition method effectively reduces the modeling complexity of the traditional change detection network (which needs to process the multi-modal difference of the first reference image and the image to be detected), simplifies the defect detection into the identification task of the specific channel abnormal state, and improves the accuracy and generalization ability of the defect detection.
[0100] To Figure 3 and Figure 4 The spliced image is labeled as shown in Figure 5 Here, the abnormal gain and the abnormal decay are combined into one type, and the label is set to 1. The two types can also be set as different labels, which is not limited here. All spliced images in the training set are trained into a deep learning model specially used for defect segmentation. The backbone network of the segmentation model can be UNet, DeepLab, HRNet, etc. The loss function can be one or more combinations of cross-entropy loss function, DiceLoss, FocalLoss, etc. During training, R_combine, G_combine, B_combine or C_combine, M_combine, Y_combine can be trained into respective models, or a model can be trained together.
[0101] Figure 5 The first row is the spliced image by channel. The second row is the label image, and the label value of the black area in the image is 0 and the label value of the white area is 1.
[0102] In the test stage, three images R_combine, G_combine and B_combine are obtained by splicing the first reference image and the image to be detected according to the color channel according to the above method. The three images are sent into the trained segmentation network for target segmentation to obtain three binary defect segmentation images.
[0103] The three binary segmentation images are taken as a set to obtain the final defect segmentation image.
[0104] The above are preferred embodiments of the present application, not to limit the protection scope of the present application, therefore: any equivalent changes made according to the structure, shape, principle of the present application should be covered within the protection scope of the present application.
Claims
1. A method for detecting print defects based on color channel stitching, characterized in that, The method comprises the following steps: Step 1: aligning a first reference image to a to-be-detected image; aligning a second reference image to the to-be-detected image; the first reference image is a printed original, and the second reference image is a printed original of a background pattern or an object imaging image printed with a complex background; Step 2: converting the first reference image, the second reference image and the to-be-detected image to a specified color space respectively; Step 3: in the same color space, splicing the first reference image, the second reference image and the to-be-detected image along a channel axis based on a color channel to form a plurality of spliced images; Step 4: training a deep learning model specially used for defect segmentation using the spliced image data set; Step 5: inputting the spliced images obtained in step 3 into the deep learning model trained in step 4 respectively to perform defect segmentation, and obtaining a binary defect segmentation result; Step 6: integrating the segmentation results of all color channels to form a final defect segmentation image; Further comprising step 7: performing morphological processing on the defect segmentation image obtained in step 6 to retain a defect region exceeding a set threshold T; Step 1 comprises the following sub-steps: Step 11: segmenting a card target region from the to-be-detected image to ensure that the size ratio of the first reference image to the to-be-detected card target is consistent; Step 12: filtering out mismatched points based on angle consistency; Step 12 comprises the following sub-steps: Step 121: respectively detecting feature points of the reference image and the to-be-detected card image, and completing preliminary matching through a feature descriptor to obtain N groups of matched point pairs; Step 122: horizontally splicing the two images, drawing connection line segments of all matched point pairs, and calculating the inclination angle of a straight line where each line segment is located; Step 123: dividing the [-180°, 180°] interval into M sub-intervals, counting the frequency of inclination angles in each interval to generate a histogram, selecting the angle interval with the highest number of votes, and calculating the mean value of all angles in the angle interval; Step 124: setting an angle deviation threshold T, removing abnormal matched point pairs with an angle deviation exceeding T, and retaining matched point pairs with an angle deviation not exceeding T; In step 3, for the printing defect detection of color printed matter, RGB color space or CMY color space is used for splicing; For gray-scale printing quality inspection, the K channel of the CMYK space, the L channel of the LAB space or the V channel of the HSV space is used for splicing; In step 3, if the image is spliced based on the RGB color space, the R channel of the first reference image and the R channel of the to-be-detected image are spliced into a new image R_combine, and R_combine is a 2-channel image, of which the first channel is the R channel of the first reference image, and the second channel is the R channel of the to-be-detected image; similarly, a new image G_combine of the G channel and a new image B_combine of the B channel are obtained; If the image is spliced based on the CMY color space, the obtained images are C_combine, M_combine and Y_combine respectively.
2. The color channel stitching based print defect detection method of claim 1, wherein, The threshold T in step 7 is set as 0.1 square millimeter of the defect area.
3. The color channel stitching based print defect detection method of claim 2, wherein, If the original printed object of the image to be detected is printed on the object with the background image printed in advance, the splicing manner of step 3 is to splice the R channel of the first reference image, the R channel of the second reference image and the R channel of the image to be detected into R_combine in the channel splicing manner, and the G_combine and B_combine are obtained in the same way.
4. A printed defect detection apparatus based on color channel stitching, characterized by: The imaging device is used to image the printed object to be detected to obtain the image to be detected, the storage medium stores the printing defect detection program and the reference image designed based on the printing defect detection method of the color channel splicing according to any one of claims 1-3, the storage medium communicates and interacts with the image to be detected, the processor is in communication connection with the storage medium, executes the printing defect detection program, inputs the image to be detected into the printing defect detection program, runs the printing defect detection program to output the defect detection result, and stores the defect detection result in the storage medium.
5. The print defect detection apparatus based on color channel stitching of claim 4, wherein: The display device is also included, which is in communication connection with the storage medium and is used to display the defect detection result.
Citation Information
Patent Citations
Dual-light image matching fusion method and system
CN115690551A
Image-based defect area detection method and device and computer equipment
CN117372369A