Defect detection method and device for roller printing machine, roller printing machine and storage medium

By acquiring image data in a roller printing machine, extracting the target pixel value region and calculating the midpoint distance, and combining multiple threshold judgments and similarity analysis, the problem of low efficiency and insufficient accuracy in traditional printing defect detection is solved, achieving efficient and accurate printing defect identification.

CN119477913AActive Publication Date: 2025-02-18SHENZHEN JINMINJIANG RIVER MECHANICAL & ELECTRICAL EQUIP

Patent Information

Application Number
CN202510059169.2
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-01-15
Publication Date
2025-02-18
Estimated Expiration
2045-01-15

AI Technical Summary

Technical Problem

Traditional methods for detecting printing defects on roller printing machines rely on manual visual inspection or simple image processing algorithms, which are inefficient and have limited detection accuracy, making it difficult to meet the quality control requirements of modern large-scale production.

Method used

By acquiring image data from a camera, the target pixel value region is extracted, the midpoint distance is calculated, and a threshold is set. Combining multiple threshold judgments and similarity analysis, printing defects are identified.

Benefits of technology

It improves the efficiency and accuracy of printing defect detection, reduces missed and false detections, adapts to the detection needs of different printed materials, and reduces errors caused by changes in lighting and noise.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119477913A_ABST
    Figure CN119477913A_ABST
Patent Text Reader

Abstract

The invention is suitable for the technical field of image data processing, and provides a defect detection method and device of a roller printing machine, the roller printing machine and a storage medium. The defect detection method of the roller printing machine comprises the steps that a to-be-recognized image collected by a camera and target printing image data are obtained; extracting a plurality of target pixel value regions in the target printing image data; calculating first midpoints of the plurality of target pixel value regions, and calculating a first distance between the plurality of first midpoints; according to the pixel value range corresponding to the target pixel value region, extracting to-be-recognized pixel regions corresponding to the plurality of pixel value ranges in the to-be-recognized image; and according to the first distance and the second distance, determining whether the printed matter in the to-be-identified image has printing defects. According to the technical scheme, the efficiency and precision of printing defect detection are effectively improved, manual intervention can be reduced, and the detection requirements of different printed matters can be met.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention belongs to the technical field of image data processing, and in particular relates to a roller printing machine defect detection method, device, roller printing machine and storage medium. Background Art

[0002] With the growing demand for electronic products, especially in the application of high-performance and high-density electronic components, multi-layer ceramic capacitors (MLCC) are widely used in mobile phones, computers, automotive electronics and other consumer electronic products as an important electronic component. Due to its advantages of miniaturization, low cost and high capacitance density, MLCC has become one of the indispensable basic components of the modern electronic industry.

[0003] The manufacturing process of MLCC involves complex multi-layer printing and sintering processes. To ensure its performance and reliability, accurate printing quality control is essential. In the manufacturing process, especially the use of roller printing technology, the patterns and lines on the surface of the product can be accurately printed. The roller printer is a printing device widely used in the production of ceramic capacitors. It forms the required electrode pattern by evenly transferring the conductive paste to the surface of the substrate.

[0004] However, due to the accuracy of the roller printing machine, the characteristics of the printing material and the changes in the operating conditions of the equipment, various defects are prone to occur during the printing process. Common printing defects include image blur, pattern misalignment, voids, missing prints, etc.

[0005] Traditional printing defect detection methods mainly rely on manual visual inspection or simple image processing algorithms. These methods are not only inefficient, but also have limited detection accuracy, making it difficult to meet the high quality control requirements of modern large-scale production. Especially on high-speed, high-precision roller printing machine production lines, manual inspection cannot monitor and identify every detail in real time, and is prone to missed detection or misdetection. Summary of the invention

[0006] In view of this, an embodiment of the present invention provides a roller printing machine defect detection method, device, roller printing machine and storage medium to solve the technical problems that traditional printing defect detection methods mainly rely on manual visual inspection or are based on simple image processing algorithms, which are not only inefficient but also have limited detection accuracy.

[0007] A first aspect of an embodiment of the present invention provides a defect detection method for a roller printing machine, the defect detection method for the roller printing machine comprising: Acquire the image to be identified and the target printing image data collected by the camera; the target printing image data refers to the design drawing data printed on the product; Extracting a plurality of target pixel value regions from the target printing image data; the target pixel value region refers to an image region composed of the same pixel value; Calculating first midpoints of a plurality of target pixel value regions, and calculating first distances between the plurality of first midpoints; According to the pixel value range corresponding to the target pixel value area, extracting pixel areas to be identified corresponding to multiple pixel value ranges in the image to be identified; If the pixel value region to be identified meets a preset condition, then calculating a plurality of second midpoints of the pixel value region to be identified, and calculating a second distance between the plurality of second midpoints; the preset condition includes that a second pixel value difference between the pixel value region to be identified and the target pixel value region is less than a second threshold; It is determined whether there is a printing defect in the printed product in the image to be identified according to the first distance and the second distance.

[0008] Furthermore, the step of extracting a plurality of target pixel value regions in the target printing image data comprises: Extracting pixel values ​​of all pixels in the target printing image data; Aggregate the same pixel values ​​among all pixel values ​​into an initial pixel value set; wherein different initial pixel value sets are used to accommodate different pixel values, and the same initial pixel value set is used to accommodate the same pixel value; In the initial pixel value set, obtaining a pixel position corresponding to each pixel value; In each of the initial pixel value sets, pixel values ​​having adjacent pixel positions are respectively aggregated into a target subset; Calculating first pixel differences between all target subsets, and sorting the multiple first pixel differences; The target subsets corresponding to the first N first pixel difference values ​​are used as the plurality of target pixel value regions.

[0009] Furthermore, the step of respectively aggregating pixel values ​​having adjacent pixel positions in each of the initial pixel value sets into a target subset includes: In each of the initial pixel value sets, pixel values ​​having adjacent pixel positions are respectively aggregated into initial subsets; Among all initial subsets, the first subset with adjacent pixels is matched; Calculating a first difference in pixel values ​​between adjacent first subsets; If the first difference is less than a first threshold, merging adjacent first subsets to form a second subset; The remaining subsets and the second subset are used as the target subsets; the remaining subsets refer to the subsets of all initial subsets except the first subset.

[0010] Furthermore, if the first difference is less than a first threshold, the step of merging adjacent first subsets as a second subset includes: If the first difference is less than a first threshold, counting the number of pixel values ​​in any one of the first subsets; Multiplying the number of pixel values ​​by a lower limit coefficient to obtain a lower limit value of the number of adjacent pixels; Multiplying the number of pixel values ​​by an upper limit coefficient to obtain an upper limit value of the number of adjacent pixels; If the number of pixel values ​​in the first subset is between the upper limit of the number of adjacent pixels and the lower limit of the number of adjacent pixels, the adjacent first subsets are merged to form a second subset.

[0011] Furthermore, if the pixel value region to be identified meets a preset condition, the step of calculating a plurality of second midpoints of the pixel value region to be identified and calculating a second distance between the plurality of second midpoints comprises: If the second pixel value difference between the pixel value area to be identified and the target pixel value area is less than a second threshold, a plurality of second midpoints of the pixel value area to be identified are calculated, and a second distance between the plurality of second midpoints is calculated.

[0012] Further, the step of determining whether there is a printing defect in the printed product in the image to be identified according to the first distance and the second distance includes: calculating a first distance ratio between a plurality of the first distances; calculating a second distance ratio between a plurality of the second distances; Calculate a second difference between the first distance ratio and the second distance ratio; If the plurality of second differences are all smaller than the third threshold, it is confirmed that the printed product has no printing defects; If the second difference is not less than the third threshold, it is confirmed that the printed product has a type of printing defect, and the pixel value area to be identified corresponding to the second difference is extracted; the type of printing defect includes printing misalignment, printing ghosting, printing distortion, printing unevenness or printing ink drag; Obtaining a target pixel value region corresponding to the pixel value region to be identified; Calculating the similarity between the pixel value region to be identified and the target pixel value region; If the similarity is greater than a fourth threshold, it is confirmed that the printed product does not have a printing defect; If the similarity is not greater than the fourth threshold, it is determined that the printed product in the image to be identified has two types of printing defects; the two types of printing defects include printing stains, printing line breaks and printing bubbles.

[0013] Furthermore, the step of calculating the similarity between the to-be-identified pixel value region and the target pixel value region comprises: Counting the number of first pixel points in the pixel value area to be identified, and counting the number of second pixel points in the target pixel value area; Extracting a first midpoint of a target pixel value region and extracting a second midpoint of a pixel value region to be identified; Calculating a third difference between the first number of pixels and the second number of pixels; Calculating a midpoint distance between the first midpoint and the second midpoint; multiplying the third difference by the first adjustment coefficient to obtain a first product; Multiplying the midpoint distance by a second adjustment coefficient to obtain a second product; The sum of the first product and the second product is taken as the similarity.

[0014] A second aspect of an embodiment of the present invention provides a defect detection device for a roller printing machine, comprising: An acquisition unit, used to acquire the image to be recognized and the target printing image data collected by the camera; the target printing image data refers to the design drawing data printed on the product; A first extraction unit is used to extract a plurality of target pixel value regions from the target printing image data; the target pixel value region refers to an image region composed of the same pixel value; A first calculation unit, used for calculating a plurality of first midpoints of the target pixel value regions, and calculating a first distance between the plurality of first midpoints; A second extraction unit is used to extract pixel regions to be identified corresponding to a plurality of pixel value ranges in the image to be identified according to the pixel value range corresponding to the target pixel value region; a second calculation unit, configured to calculate a plurality of second midpoints of the pixel value region to be identified and calculate a second distance between the plurality of second midpoints if the pixel value region to be identified meets a preset condition; the preset condition includes that a second pixel value difference between the pixel value region to be identified and the target pixel value region is less than a second threshold; A determination unit is used to determine whether there is a defect in the printed product in the image to be identified according to the first distance and the second distance.

[0015] A third aspect of an embodiment of the present invention provides a roller printing machine, comprising a roller system, a camera, a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein when the processor executes the computer program, the steps of the defect detection method for the roller printing machine described in the first aspect are implemented.

[0016] A fourth aspect of an embodiment of the present invention provides a computer-readable storage medium, wherein the computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the steps of the defect detection method for the roller printing machine described in the first aspect are implemented.

[0017] Compared with the prior art, the embodiments of the present invention have the following beneficial effects: the scheme first collects the data of the image to be identified and the target printed image through a camera, and extracts multiple target pixel value regions in the target printed image. Since the target pixel value region is divided based on the consistency of the pixel value, the target image can be effectively compared with the image to be identified, which greatly improves the efficiency and accuracy of image processing. By calculating the first midpoints of multiple target pixel value regions and the first distances between them, the present technology can accurately locate the feature region in the target printed image. The calculation of these first midpoints provides an accurate benchmark for subsequent defect detection, so that the defective regions that may exist in the image to be identified can be more accurately compared and detected. According to the pixel value range corresponding to the target pixel value region, the corresponding pixel value range region in the image to be identified is extracted. By setting preset conditions (such as the number of pixels), the detection range of the image to be identified can be flexibly controlled, further improving the accuracy and adaptability of the detection. In the detection process, by calculating the second midpoint of the pixel value region to be identified and the second distance between the second midpoints, the defective region in the image to be identified is further confirmed and determined. If the pixel value region of the image to be identified meets the preset conditions, the possible printing defects can be efficiently identified. This method has high fault tolerance and can achieve high-precision defect identification in a variety of complex printed products. This technical solution performs defect detection based on distance calculation of pixel value areas, which can effectively reduce errors caused by lighting changes, image noise or uneven printing quality, thereby improving detection accuracy. Under the same detection conditions, the solution significantly improves the accuracy of traditional printing defect detection methods and reduces the occurrence of missed detections and false detections. In summary, this technical solution effectively improves the efficiency and accuracy of printing defect detection, which can not only reduce manual intervention, but also adapt to the detection needs of different printed products. BRIEF DESCRIPTION OF THE DRAWINGS

[0018] In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the following briefly introduces the drawings required for use in the embodiments or related technical descriptions. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work.

[0019] Figure 1 A schematic flow chart of a defect detection method for a roller printing machine provided by the present invention is shown; Figure 2 A schematic diagram of a defect detection device for a roller printing machine provided by an embodiment of the present invention is shown; Figure 3 A schematic diagram of a roller printing machine provided in one embodiment of the present invention is shown. DETAILED DESCRIPTION

[0020] In the following description, specific details such as specific system structures, technologies, etc. are provided for the purpose of illustration rather than limitation, so as to provide a thorough understanding of the embodiments of the present invention. However, it should be clear to those skilled in the art that the present invention may be implemented in other embodiments without these specific details. In other cases, detailed descriptions of well-known systems, devices, circuits, and methods are omitted to prevent unnecessary details from obstructing the description of the present invention.

[0021] The embodiments of the present invention provide a roller printing machine defect detection method, device, roller printing machine and storage medium to solve the technical problems that traditional printing defect detection methods mainly rely on manual visual inspection or are based on simple image processing algorithms, which are not only inefficient but also have limited detection accuracy.

[0022] First, the present invention provides a roller printing machine defect detection method. The roller printing machine defect detection method is applied to the roller printing machine, which includes but is not limited to a roller system, a camera, a memory, a processor, and a roller printing machine defect detection program stored in the memory and runnable on the processor. Figure 1 , Figure 1 FIG. 1 is a schematic flow chart of a defect detection method for a roller printing machine provided by the present invention. Figure 1 As shown, the defect detection method of the roller printing machine may include the following steps: Step 101: obtaining an image to be recognized and target printing image data collected by a camera; the target printing image data refers to design drawing data printed on a product; The image to be identified refers to the product image captured by a camera or other device, and the image content is the surface of the printed product to be inspected. The target printing image data is the pre-designed target image data, which usually refers to the printed design pattern that should be presented on the product, and it represents the ideal printing effect.

[0023] Step 102: extracting a plurality of target pixel value regions from the target printing image data; the target pixel value region refers to an image region composed of the same pixel value; In the target printing image, the image is segmented into multiple regions based on the similarity of pixel values. These regions have the same pixel values ​​and represent a specific pattern or color block.

[0024] For example, in a printed pattern, an area is often of the same color or similar colors, so this area will be regarded as a target pixel value area at the pixel level.

[0025] Specifically, step 102 specifically includes steps 1021 to 1026: Step 1021: extracting pixel values ​​of all pixels in the target printing image data; Extract all pixel values ​​from the target printed image. Each pixel in a digital image has a specific color value (such as RGB value). In this process, each pixel of the image will be read and its corresponding color or grayscale value will be recorded. This step is the starting point of image data processing, and the purpose is to obtain the original information of each pixel in the image.

[0026] Step 1022: Aggregate the same pixel values ​​among all pixel values ​​into an initial pixel value set; wherein different initial pixel value sets are used to accommodate different pixel values, and the same initial pixel value set is used to accommodate the same type of pixel value; All pixels with the same pixel value are clustered together to form multiple "initial pixel value sets". Each set contains only pixels of the same color. This aggregation helps the system understand the color distribution in the image, facilitating the subsequent division and analysis of image regions. By aggregating the same pixel values, the system can identify regions with consistent colors as candidates for target regions.

[0027] Step 1023: Obtain the pixel position corresponding to each pixel value in the initial pixel value set; For each pixel in the pixel value set, record the specific position of the pixel in the image. For example, the RGB value of a pixel is (255,0,0), and it is located at the coordinates of the image (x=100, y=150). This position coordinate is crucial for subsequent pixel aggregation and regional analysis. The purpose of obtaining the pixel position is to aggregate adjacent pixels based on the position and help define the region more accurately.

[0028] Step 1024: In each of the initial pixel value sets, pixel values ​​having adjacent pixel positions are aggregated into a target subset; Since the initial pixel value set obtained by aggregating the same pixel values ​​may include multiple images or image areas, the initial pixel value set needs to be further divided. In each initial pixel value set, the pixels with adjacent positions are aggregated into a smaller subset. "Adjacent" here means touching each other in the image. If there are many pixels of the same color in a certain area of ​​the image, and their positions are close or adjacent, then these pixels will be classified as a "target subset". The purpose of this step is to aggregate continuous and similar pixels to form a clearer area. By aggregating adjacent pixels, some natural areas can be formed in the image, which are more likely to represent the actual physical areas of the image or specific pattern features.

[0029] For the aggregation of pixel values, the pixel value gap and the number of adjacent pixels need to be considered separately (the smaller the pixel value or the larger the number of adjacent pixels, the greater the possibility of aggregation). The specific aggregation logic is as follows: Specifically, step 1024 specifically includes steps A1 to A5: Step A1: In each of the initial pixel value sets, pixel values ​​having adjacent pixel positions are aggregated into initial subsets; In each initial pixel value set, find and aggregate those pixels that are adjacent in spatial position. This means that if two pixels are adjacent in the image, merge them into an "initial subset".

[0030] Step A2: among all initial subsets, matching the first subset with adjacent pixels; Since there may be adjacent approximate pixel value regions (eg, edge color gradient regions or others) between the corresponding initial subsets of different initial pixel value sets, it is necessary to merge the adjacent approximate pixel value regions.

[0031] If two initial subsets are located in different parts of the image, but their boundaries are adjacent (or the edges of the pixels are touching), then the two subsets are considered "adjacent initial subsets". The purpose of this step is to match the subsets in the image according to their positional relationship, so as to identify those closely connected areas. This allows further analysis to determine whether there are larger structures or patterns between these areas.

[0032] Step A3: calculating a first difference in pixel values ​​between adjacent first subsets; Calculating the "first difference" between two adjacent initial subsets usually refers to the difference in pixel values ​​between the two subsets. The "pixel difference" is calculated to determine whether the two adjacent subsets are similar or consistent enough. If their pixel difference is small, it means that they are very similar in color, texture or morphology and may belong to the same area.

[0033] Step A4: if the first difference is less than a first threshold, merging adjacent first subsets to form a second subset; If the calculated "first difference" is less than the preset "first threshold", the two adjacent initial subsets are merged into a new subset, called the "second subset". If the difference in pixel values ​​between the first and second subsets is small (lower than the threshold), they will be considered to belong to the same area and merged into a larger area. The purpose of this step is to determine whether adjacent areas can be merged by threshold. If the difference is small, it means that they may be part of the same printed pattern, and merging them into one area will help improve the accuracy of subsequent analysis.

[0034] Specifically, step A4 includes steps A41 to A44: Step A41: if the first difference is less than a first threshold, counting the number of pixel values ​​in any one of the first subsets; After determining that the pixel difference between two adjacent initial subsets is less than a certain "first threshold", the next step is to count the number of pixels in one of the subsets (i.e., the "first subset"). The purpose of this step is to understand the size of the current subset (the number of pixels) and then determine the number of adjacent pixels in the subset, which is an important basis for subsequent determination of whether to merge.

[0035] Step A42: multiplying the number of pixel values ​​by the lower limit coefficient to obtain a lower limit value of the number of adjacent pixels; Step A43: multiplying the number of pixel values ​​by the upper limit coefficient to obtain an upper limit value of the number of adjacent pixels; It should be noted that, in the printed design pattern, there may be two different patterns that are only "tangent" or "slightly adjacent", while the same pattern usually has more adjacent pixels. In order to avoid merging two different patterns, it is necessary to consider the number of adjacent pixels between the two first subsets, and determine whether to merge the first subsets based on the number of adjacent pixels.

[0036] Since the number of adjacent pixels between multiple adjacent first subsets in the same image is often large, and the number of adjacent pixels is related to the number of pixels in the first subset. That is, the more pixels there are, the more adjacent pixels there are. The fewer pixels there are, the fewer adjacent pixels there are. Therefore, it is necessary to calculate the lower limit of the number of adjacent pixels based on the number of pixel values ​​and the lower limit coefficient. The upper limit of the number of adjacent pixels is calculated based on the number of pixel values ​​and the upper limit coefficient.

[0037] Step A44: If the number of pixel values ​​in the first subset is between the upper limit of the number of adjacent pixels and the lower limit of the number of adjacent pixels, the adjacent first subsets are merged to form a second subset.

[0038] In this embodiment, by combining the upper and lower limits of pixel value difference and pixel number, more accurate and intelligent region merging is achieved. By dynamically adjusting the merging conditions, this solution effectively improves the accuracy and efficiency of image processing and has high adaptability and robustness.

[0039] Step A5: taking the remaining subsets and the second subset as the target subsets; the remaining subsets refer to the set of all initial subsets except the first subset.

[0040] If there are multiple subsets after merging, the second subset after merging and the remaining subsets together constitute the final target subset, and these subsets will be used as subsequent analysis objects.

[0041] In this embodiment, this solution can efficiently identify pixel areas with similar features in an image by aggregating pixel values ​​of adjacent pixel positions into initial subsets in each initial pixel value set. The aggregation of adjacent pixel values ​​effectively improves the continuity and consistency of the region, and provides an accurate basis for subsequent image analysis and defect detection. This solution calculates the first difference of pixel values ​​between adjacent first subsets, and determines whether to merge the subsets by setting a first threshold. This method can automatically determine which subsets have sufficient similarity in pixel values ​​by introducing threshold control, so as to merge them. If the first difference is less than the first threshold, the adjacent first subsets are merged into the second subset. During the merging process, the processing method of the remaining subsets and the second subset further optimizes the regional division of the image. By combining the remaining subsets (i.e., other subsets except the first subset) with the merged second subset to form a target subset, it is ensured that all important areas are reasonably covered, while avoiding omission or redundancy of areas. This strategy effectively improves the integrity and accuracy of the image processing results. This technical solution achieves efficient and accurate image region extraction through precise aggregation of adjacent pixel values, intelligent difference calculation and subset merging strategy, greatly improving the accuracy and efficiency of image processing.

[0042] Step 1025: Calculate the first pixel difference between all target subsets, and sort the multiple first pixel differences; Calculate the "first pixel difference" between all target subsets. This "difference" refers to the difference in pixel values ​​between two target subsets. Calculating the "pixel difference" helps the system measure the similarities or differences between different subsets. By sorting these differences, the most representative areas can be identified, and then the target areas that best meet the expectations can be screened out.

[0043] Step 1026: taking the target subsets corresponding to the first N first pixel difference values ​​as the plurality of target pixel value regions.

[0044] According to the calculated pixel difference, the top N target subsets with the largest difference are selected as the final target pixel value area. It can be understood that since the subset with the largest difference has a smaller "similar interference" in the image and has a larger difference, the subsequent judgment accuracy can be improved.

[0045] In this embodiment, the pixel values ​​of all pixels in the target printed image are first extracted, and the pixels with the same pixel value are aggregated into an initial pixel value set. This aggregation method can efficiently classify the pixel information in the image, so that the subsequent processing steps can be concentrated in a specific pixel value area, improve the processing efficiency, and effectively reduce the computational complexity. The pixel position corresponding to the pixel value in each initial pixel value set is obtained, which provides accurate spatial position information for the subsequent region division and aggregation of target subsets. In this way, the positional relationship in the region division and pixel aggregation process can be ensured to be accurate, thereby laying a solid foundation for defect detection or other subsequent operations. In each initial pixel value set, by aggregating the pixel values ​​of adjacent pixel positions into a target subset, the continuous area of ​​pixel values ​​can be effectively identified. This aggregation method can effectively extract similar areas in the image, improve the accuracy of image processing, and reduce misjudgment caused by noise or irregular pixel distribution. By calculating the first pixel difference between all target subsets and sorting multiple first pixel differences, the most representative target subset can be intelligently screened. By selecting the target subset corresponding to the first N first pixel differences as the final target pixel value region, the accuracy and rationality of region extraction are further optimized. This sorting method ensures that the selected region has high cohesion and consistency. In summary, this technical solution greatly improves the extraction efficiency and accuracy of multiple target pixel value regions in target printed image data through precise pixel value aggregation, target subset division and intelligent sorting methods.

[0046] Step 103: calculating a plurality of first midpoints of the target pixel value regions, and calculating a first distance between the plurality of first midpoints; For each target pixel value area, calculate its geometric center, that is, the average position of all pixels in the area. Calculate the first distance between the midpoints of all target pixel value areas. The first distance will help the system understand whether the arrangement of the printed pattern is normal.

[0047] Step 104: extracting pixel regions to be identified corresponding to a plurality of pixel value ranges from the image to be identified according to the pixel value range corresponding to the target pixel value region; According to the pixel value range of the target pixel value area in the target printed image, the corresponding pixel value area is extracted in the image to be identified. These pixel value areas to be identified should correspond to the areas in the target image and have similar pixel value ranges.

[0048] Step 105: If the pixel value region to be identified meets a preset condition, calculating a plurality of second midpoints of the pixel value region to be identified, and calculating a second distance between the plurality of second midpoints; the preset condition includes that a second pixel value difference between the pixel value region to be identified and the target pixel value region is less than a second threshold; Specifically, step 105 specifically includes: if the second pixel value difference between the pixel value area to be identified and the target pixel value area is less than a second threshold, calculating a plurality of second midpoints of the pixel value area to be identified, and calculating a second distance between the plurality of second midpoints.

[0049] The preset conditions include a threshold condition based on the number of pixels. That is, only those areas to be identified that contain a sufficient number of pixels will be further analyzed. This step is to ensure that only the more important areas are considered, and avoid too small noise areas that interfere with the detection.

[0050] For multiple pixel regions to be identified in the image to be identified, their geometric centers (second midpoints) are also calculated. The second distances between the second midpoints are calculated to compare the difference between the image to be identified and the target image.

[0051] Step 106: Determine whether there is a printing defect in the printed product in the image to be identified based on the first distance and the second distance.

[0052] Specifically, step 106 specifically includes steps 1061 to 1069: Step 1061: Calculate a first distance ratio between a plurality of the first distances; Step 1062: Calculate a second distance ratio between a plurality of the second distances; This step can help assess whether the relative positions of features in the printed image are as expected. If the ratio of these distances is too large or too small, it may indicate that there is something abnormal in the image.

[0053] Step 1063: Calculate a second difference between the first distance ratio and the second distance ratio; By calculating the difference between these two ratios, we can further determine whether the positional relationship in the printed product is normal. A large difference may mean that some areas in the print have abnormal deformation or misalignment.

[0054] Step 1064: If the plurality of second differences are all smaller than the third threshold, confirming that the printed product does not have a printing defect; If multiple "second differences" are all less than the set "third threshold", it means that the differences between these printing features are within the normal range, and it can be confirmed that the printed product has no defects. The purpose of this judgment step is to exclude those images without defects to ensure the efficiency and accuracy of the detection process.

[0055] Step 1065: if the second difference is not less than the third threshold, confirm that the printed product has a type of printing defect, and extract the pixel value area to be identified corresponding to the second difference; the type of printing defect includes printing misalignment, printing ghosting, printing distortion, printing unevenness, or printing ink drag; If some of the "second difference values" are not less than the third threshold, it indicates that the printed product has defects. At this time, the system will mark the defective areas and extract the pixel values ​​in these areas. Further defect analysis provides specific image information. A type of printing defect includes but is not limited to printing misalignment, printing ghosting, printing distortion, printing unevenness or printing ink drag. It is understandable that a type of printing defect will cause the pattern to shift, which in turn causes the second difference value to be not less than the third threshold.

[0056] Printing Misalignment: The pattern or text is not aligned as expected.

[0057] Printing ghosting: Multiple outlines appear in the image, similar to overlapping images.

[0058] Printing distortion: The morphology of an image or pattern is deformed, losing its original proportions or shape.

[0059] Uneven printing: Uneven distribution of color or brightness in certain areas of the image.

[0060] Printing ink drag: The ink spreads during the printing process, causing blur or smearing.

[0061] Among them, printing misalignment refers to the fact that different parts of the image are not aligned during the printing process, resulting in an offset or disordered image. Misalignment may be caused by mechanical errors in the printing equipment, improper paper positioning, or alignment problems during the printing process. If the midpoint distance between two areas has shifted significantly, and the magnitude of this shift is not within the normal range (usually within a certain tolerance), it may indicate that the image is misaligned. Especially in printing, different parts of the same image should be aligned, but due to misalignment, there is an abnormal difference in their relative position. For example, in industrial inspection, the similarity value can be directly used as the basis for defect identification to help determine whether further processing or repair is needed.

[0062] Printing ghosting is when parts of an image overlap or repeat, usually due to ink overlap or offset between two prints in a printing press. Ghosting usually results in a slight spatial offset between two copies of the same image area. Here, areas that should overlap or align are displaced due to equipment or operating issues. By calculating the distance between the points in different areas, if the distance is significantly larger, it may indicate that the image has ghosting.

[0063] Printing distortion refers to the deformation or thickening or thinning of the image during the printing process, usually caused by pressure, paper deformation or uneven ink flow. Distortion may cause areas of the image to deform, causing the distance between their midpoints to change. In some cases, the center of the area may be stretched or compressed, resulting in abnormal distances. By analyzing the distance differences between these midpoints, the distortion phenomenon in the printing process can be revealed.

[0064] Uneven printing refers to the uneven distribution of ink, which causes different shades of color in some areas, mottled images, or uneven color transitions. Uneven printing may cause the displacement of some areas to be inconsistent with the original image expectations, especially when the printing ink is unevenly distributed, which may cause the pixel density in the same area to change. These displacement phenomena caused by uneven printing can be found by calculating the distance difference between the center points of the areas.

[0065] Printing ink drag refers to the phenomenon of ink dragging caused by incomplete drying of the ink or excessive printing during the printing process, which usually manifests as blurred or overlapping edges. Ink drag usually causes the edges of the image area to become blurred, and may even cause pixel misalignment. At this time, the areas that should have been closely aligned may have additional displacement due to the influence of ink drag. By calculating the distance difference between the points in these areas, if the difference is large, it may indicate that the image has ink drag.

[0066] These printing defects (misalignment, ghosting, distortion, unevenness, ink drag) essentially cause changes in the spatial position relationship between various areas in the image. This change is usually local, but by calculating the midpoint distance difference, this positional anomaly can be identified.

[0067] Step 1066: Obtain a target pixel value region corresponding to the pixel value region to be identified; Step 1067: Calculate the similarity between the to-be-identified pixel value region and the target pixel value region; By comparing the similarity, we can further confirm whether there are defects. A higher similarity indicates that the area to be identified is consistent with the target area, and the defects are small or non-existent. A lower similarity indicates that there are obvious defects in the area to be identified.

[0068] In order to further improve the accuracy of printing defect recognition, after determining the presence of printing defects based on the distance difference, further judgment needs to be made based on regional similarity, and regional similarity can be used to determine the second type of printing defects. The specific calculation logic of similarity is as follows: Specifically, step 1067 specifically includes steps B1 to B7: Step B1: Counting the number of first pixel points in the pixel value area to be identified, and counting the number of second pixel points in the target pixel value area; Count the number of pixels in the area to be identified (the area to be detected in the image) and the target area (the standard image area). By counting the number of pixels, the size information of the two areas is obtained. The difference in area size can reflect whether there is a significant gap between the two areas, which is crucial for judging similarity.

[0069] Step B2: extracting the first midpoint of the target pixel value area and extracting the second midpoint of the pixel value area to be identified; Step B3: calculating a third difference between the first number of pixel points and the second number of pixel points; Step B4: calculating the midpoint distance between the first midpoint and the second midpoint; Step B5: multiplying the third difference by the first adjustment coefficient to obtain a first product; The first adjustment coefficient is used to perform weight adjustment on the difference in the number of pixels so that the impact of the difference is more in line with actual application requirements.

[0070] Step B6: multiplying the midpoint distance by the second adjustment coefficient to obtain a second product; The second adjustment factor determines the contribution of the midpoint distance to the similarity. When the adjustment factor is large, the midpoint distance difference will have a greater impact on the similarity.

[0071] Step B7: The sum of the first product and the second product is taken as the similarity.

[0072] In this embodiment, this scheme calculates the difference between the regions by counting the number of pixels in the pixel value region to be identified and the target pixel value region, and extracting the midpoint of the two regions. By combining the difference in the number of pixels and the difference in the position of the regions, the similarity between the region to be identified and the target region can be accurately reflected. This calculation method avoids the simple way of relying only on direct comparison of pixel values ​​in the traditional way, takes into account the overall distribution and structural differences of the regions, and ensures that the calculation of similarity is more comprehensive and accurate. In the similarity calculation process, the scheme counts the number of pixels in the region to be identified and the target region, and calculates the difference between them (i.e., the third difference). This process can effectively identify the difference in scale between the two regions. If the number of pixels in the region to be identified and the target region differs greatly, the system will automatically reflect this difference, thereby avoiding misjudgment caused by inconsistent region sizes and improving the reliability of similarity calculation. By extracting the midpoint of the pixel value region to be identified and the midpoint of the target pixel value region, and calculating the midpoint distance between the two, this scheme can further measure the position difference between the regions. This operation can identify the offset of the target area and the area to be identified in space. If the center point deviation of the two areas is large, the similarity value will decrease accordingly, thereby effectively distinguishing the similarity of areas at different positions. In the calculation process, this scheme introduces the first adjustment coefficient and the second adjustment coefficient, which act on the product of the difference in the number of pixels and the midpoint distance respectively. These coefficients can be adjusted according to the actual application scenario to optimize the sensitivity of similarity calculation for different types of images or regional features. For example, in some scenarios, the difference in the number of pixels may be more important than the difference in position, or vice versa, and the adjustment coefficient can be flexibly configured to improve the adaptability and accuracy of similarity calculation. By comprehensively considering the difference in the number of pixels, the difference in regional position and the adjustment coefficient, this scheme can accurately capture the similarity or difference between image areas. Compared with the traditional technology based solely on pixel comparison, the multi-dimensional analysis method of this scheme can better handle complex images, especially for tasks that require high-precision regional matching such as image quality detection and defect detection, avoiding errors caused by over-reliance on a single feature. This technical solution is not only based on qualitative evaluation of whether the regions are similar, but also provides a quantitative similarity value, which can be directly used for subsequent analysis and decision-making, thereby improving the operability of the detection results.

[0073] Step 1068: If the similarity is greater than a fourth threshold, confirming that the printed product has no printing defects; Since judging printing defects based on distance ratio has certain limitations, the accuracy of defect recognition can be improved through similarity comparison.

[0074] If the calculated similarity is greater than the fourth threshold, it means that the difference between the area to be identified and the target area is small, and it is confirmed that there is no defect. For example: if the similarity is higher than a certain threshold (such as 0.95), the printed product is considered to have no defects.

[0075] Step 1069: If the similarity is not greater than the fourth threshold, it is determined that the printed product in the image to be identified has two types of printing defects; the two types of printing defects include printing stains, printing line breaks, and printing bubbles.

[0076] If the similarity is not greater than the fourth threshold, it means that the difference between the area to be identified and the target area is large, and it is confirmed that there is a second type of printing defect. The second type of printing defects include but are not limited to: Print smear: Irregular spots or specks in the image.

[0077] Printing line break: The pattern or line is interrupted, resulting in discontinuity.

[0078] Printing bubbling: Bubbles appear on the printing surface, affecting the quality of the pattern.

[0079] In this embodiment, this solution can effectively identify potential defects of printed products by calculating the ratios of multiple first distances and second distances and analyzing the differences between these ratios. This calculation method based on distance ratios and differences avoids the traditional defect detection method that relies on a single feature, and can more comprehensively capture the pattern of printing errors or defects in the image. The solution first calculates the difference between the first distance ratio and the second distance ratio, and judges whether there are printing defects in the image based on a preset third threshold. When multiple second differences are all less than the third threshold, it indicates that there are no defects in the printed product in the image, and the system confirms that the printed product is a qualified product, reducing the risk of misjudgment. On the contrary, when the second difference is not less than the third threshold, the system can identify a class of printing defects, such as printing misalignment, ghosting, distortion, unevenness or ink drag, thereby providing a basis for subsequent defect location and repair. This technical solution can not only identify the existence of printing defects, but also further distinguish different types of defects. According to the similarity comparison between the second difference and the fourth threshold, the system can confirm the type of defects, including Class I printing defects (misalignment, ghosting, distortion, unevenness, ink drag) and Class II printing defects (stains, line breaks, bubbles). This hierarchical classification method provides a more detailed defect recognition capability, which is helpful for subsequent quality control and defect repair work. When the system recognizes that the second difference exceeds the third threshold, it can extract the corresponding pixel value area to be identified and compare it with the target pixel value area. Through this area extraction and comparison method, the system can accurately locate the specific area where defects may exist, thereby improving the accuracy of detection and reducing interference with irrelevant areas. By calculating the similarity between the pixel value area to be identified and the target pixel value area, the system can further confirm whether there are indeed defects in the area to be identified. If the similarity is greater than the fourth threshold, the system confirms that the printed product has no defects, otherwise it is determined that there are Class II defects. The similarity measurement mechanism enhances the accuracy and robustness of image analysis, and effectively eliminates noise interference and occasional non-defective areas. This technical solution can intelligently classify according to different defect types, and clearly distinguish between defect types. For common defects such as printing misalignment and ghosting, the system can quickly identify them through the difference in distance ratios, and extract and classify possible defective areas; for defects such as stains, broken lines, and bubbles, the system can still accurately determine the defect type through similarity comparison and provide accurate quality assessment results. The solution can effectively avoid misjudgment and missed detection through a multiple threshold judgment mechanism combined with further confirmation of similarity. For tiny defects or subtle problems in complex images, the system can accurately identify and mark potential problem areas through sophisticated calculations to ensure the comprehensiveness and accuracy of printed product quality inspection. This technical solution achieves accurate identification and intelligent classification of printed product defects by introducing multi-dimensional ratio calculations, difference analysis, and similarity measurement mechanisms. This solution not only improves the accuracy and efficiency of detection, but also effectively reduces the misjudgment rate and missed detection rate.

[0080] It is worth noting that avoiding printing defects by controlling the speed of the roller printing machine is an effective quality control strategy. The printing quality of the roller printing machine is closely related to the operating speed of the equipment. Too fast or too slow speed may cause printing defects. In order to optimize printing quality and reduce defects, the following aspects need to be considered: During the printing process of the roller printing machine, the fluidity and drying speed of the printing paste are crucial to the final printing effect. If the speed of the roller printing machine is too fast, the paste may not have enough time to be evenly coated, resulting in blurred, missing or incomplete patterns. If the speed is too slow, the paste may dry prematurely or adhere to the roller, thus affecting the printing quality.

[0081] Different types of slurries (such as ceramic slurries, electrode slurries, etc.) have different fluidity, adhesion, and drying rates. Therefore, the printing speed must be adjusted according to the characteristics of the slurry. For example, slurries with higher viscosity components require a lower printing speed to ensure that the slurry can be transferred evenly and does not clump or dry up.

[0082] The printing accuracy of the roller printer is directly affected by the speed. If the equipment runs too fast, the contact time between the roller and the substrate is shortened, and the printing paste may not be fully pressed onto the substrate surface, resulting in unclear or misaligned patterns. In addition, vibration of the substrate during printing may also be caused by excessive speed, resulting in offset or uneven patterns.

[0083] Although too slow a speed can ensure a longer contact time, it may cause slurry accumulation, excessive printing slurry accumulation, and even overflow or printing overlap. Too slow a speed may also reduce equipment production efficiency and increase production costs and cycles.

[0084] Substrates of different thicknesses have different requirements for printing speeds. For example, thinner substrates may require lower speeds to avoid deformation or damage to the substrate due to excessive pressure during printing. For thicker substrates, the speed can be increased appropriately, but it still needs to be controlled within a reasonable range to avoid blurring or missing patterns.

[0085] Temperature control during the printing process has an important impact on the fluidity and adhesion of the slurry. Too low a temperature will increase the viscosity of the slurry, affecting the transfer effect; while too high a temperature may cause the slurry to evaporate too quickly, or even cause cracks in the printed pattern. Therefore, reasonable control of the match between speed and temperature can reduce printing defects caused by temperature changes.

[0086] In actual production, the speed of the roller printing machine usually needs to be dynamically adjusted based on real-time monitoring feedback. For example, the image recognition system is used to monitor the printing quality in real time. When the pattern is found to be unclear or irregular, the printing speed is automatically adjusted to avoid the expansion of defects.

[0087] For different types or sizes of MLCC products, the requirements for pattern accuracy are different, and the printing speed should be adjusted according to the specific needs of different products. For example, for high-precision, small-size MLCC components, the printing speed can be appropriately reduced to ensure higher printing accuracy.

[0088] Modern roller printing machines are generally equipped with advanced automatic control systems, which can adjust the printing speed in real time according to different production requirements and equipment status. Combined with factors such as temperature, humidity, slurry viscosity, etc., the system can dynamically optimize the printing process and reduce printing defects caused by improper speed.

[0089] In the early stage of production, the speed of the roller printing machine can be lower to ensure uniform coating of the slurry and avoid uneven coating. As the production progresses steadily, the speed can be gradually increased to improve production efficiency while ensuring quality. Especially when the production cycle is long, gradual acceleration or deceleration can better avoid the impact of sudden speed changes on pattern accuracy.

[0090] In this embodiment, the scheme first collects the data of the image to be identified and the target printed image through a camera, and extracts multiple target pixel value areas in the target printed image. Since the target pixel value area is divided based on the consistency of the pixel value, the target image can be effectively compared with the image to be identified, which greatly improves the efficiency and accuracy of image processing. By calculating the first midpoints of multiple target pixel value areas and the first distances between them, the technology can accurately locate the feature area in the target printed image. The calculation of these first midpoints provides an accurate benchmark for subsequent defect detection, so that the defective areas that may exist in the image to be identified can be more accurately compared and detected. According to the pixel value range corresponding to the target pixel value area, the corresponding pixel value range area in the image to be identified is extracted. By setting preset conditions (such as the number of pixels), the detection range of the image to be identified can be flexibly controlled, further improving the accuracy and adaptability of the detection. In the detection process, by calculating the second midpoint of the pixel value area to be identified and the second distance between the second midpoints, the defective area in the image to be identified is further confirmed and determined. If the pixel value area of ​​the image to be identified meets the preset conditions, the possible printing defects can be efficiently identified. This method has high fault tolerance and can achieve high-precision defect identification in a variety of complex printed products. This technical solution performs defect detection based on distance calculation of pixel value areas, which can effectively reduce errors caused by lighting changes, image noise or uneven printing quality, thereby improving detection accuracy. Under the same detection conditions, the solution significantly improves the accuracy of traditional printing defect detection methods and reduces the occurrence of missed detections and false detections. In summary, this technical solution effectively improves the efficiency and accuracy of printing defect detection, which can not only reduce manual intervention, but also adapt to the detection needs of different printed products.

[0091] like Figure 2 The present invention provides a defect detection device for a roller printing machine, see Figure 2 , Figure 2 A schematic diagram of a defect detection device for a roller printing machine provided by the present invention is shown. Figure 2 A defect detection device for a roller printing machine includes: The acquisition unit 21 is used to acquire the image to be recognized and the target printing image data collected by the camera; the target printing image data refers to the design drawing data printed on the product; A first extraction unit 22 is used to extract a plurality of target pixel value regions from the target printing image data; the target pixel value region refers to an image region composed of the same pixel value; A first calculation unit 23, used for calculating a plurality of first midpoints of the target pixel value regions, and calculating a first distance between the plurality of first midpoints; A second extraction unit 24 is used to extract pixel regions to be identified corresponding to a plurality of pixel value ranges in the image to be identified according to the pixel value range corresponding to the target pixel value region; A second calculation unit 25 is used to calculate a plurality of second midpoints of the pixel value region to be identified and calculate a second distance between the plurality of second midpoints if the pixel value region to be identified meets a preset condition; the preset condition includes that a second pixel value difference between the pixel value region to be identified and the target pixel value region is less than a second threshold; The determination unit 26 is configured to determine whether there is a defect in the printed product in the image to be identified according to the first distance and the second distance.

[0092] The present invention provides a defect detection device for a roller printing machine. The scheme first collects data of an image to be identified and a target printed image through a camera, and extracts multiple target pixel value areas in the target printed image. Since the target pixel value area is divided based on the consistency of pixel values, the target image can be effectively compared with the image to be identified, which greatly improves the efficiency and accuracy of image processing. By calculating the first midpoints of multiple target pixel value areas and the first distances between them, the technology can accurately locate the feature area in the target printed image. The calculation of these first midpoints provides an accurate benchmark for subsequent defect detection, so that the defective areas that may exist in the image to be identified can be more accurately compared and detected. According to the pixel value range corresponding to the target pixel value area, the corresponding pixel value range area in the image to be identified is extracted. By setting preset conditions (such as pixel number conditions), the detection range of the image to be identified can be flexibly controlled, further improving the accuracy and adaptability of the detection. In the detection process, by calculating the second midpoint of the pixel value area to be identified and the second distance between the second midpoints, the defective area in the image to be identified is further confirmed and determined. If the pixel value area of ​​the image to be identified meets the preset conditions, the possible printing defects can be efficiently identified. This method has high fault tolerance and can achieve high-precision defect identification in a variety of complex printed products. This technical solution performs defect detection based on distance calculation of pixel value areas, which can effectively reduce errors caused by lighting changes, image noise or uneven printing quality, thereby improving detection accuracy. Under the same detection conditions, the solution significantly improves the accuracy of traditional printing defect detection methods and reduces the occurrence of missed detections and false detections. In summary, this technical solution effectively improves the efficiency and accuracy of printing defect detection, which can not only reduce manual intervention, but also adapt to the detection needs of different printed products.

[0093] Figure 3 FIG. 1 is a schematic diagram of a roller printing machine provided by an embodiment of the present invention. Figure 3As shown, a roller printing machine 3 of this embodiment includes: a processor 30, a memory 31, a roller system 33, a camera 34, and a computer program 32 stored in the memory 31 and executable on the processor 30, such as a defect detection program for a roller printing machine. When the processor 30 executes the computer program 32, the steps of each of the above-mentioned defect detection method embodiments of a roller printing machine are implemented, such as Figure 1 Alternatively, when the processor 30 executes the computer program 32, the functions of each unit in the above-mentioned device embodiments are realized, for example, Figure 2 Function of the unit shown.

[0094] Exemplarily, the computer program 32 may be divided into one or more units, which are stored in the memory 31 and executed by the processor 30 to implement the present invention. The one or more units may be a series of computer program instruction segments capable of implementing specific functions, which are used to describe the execution process of the computer program 32 in the roller printing machine 3. For example, the computer program 32 may be divided into the following specific functions of each unit: An acquisition unit, used to acquire the image to be recognized and the target printing image data collected by the camera; the target printing image data refers to the design drawing data printed on the product; A first extraction unit is used to extract a plurality of target pixel value regions from the target printing image data; the target pixel value region refers to an image region composed of the same pixel value; A first calculation unit, used for calculating a plurality of first midpoints of the target pixel value regions, and calculating a first distance between the plurality of first midpoints; A second extraction unit is used to extract pixel regions to be identified corresponding to a plurality of pixel value ranges in the image to be identified according to the pixel value range corresponding to the target pixel value region; a second calculation unit, configured to calculate a plurality of second midpoints of the pixel value region to be identified and calculate a second distance between the plurality of second midpoints if the pixel value region to be identified meets a preset condition; the preset condition includes that a second pixel value difference between the pixel value region to be identified and the target pixel value region is less than a second threshold; A determination unit is used to determine whether there is a defect in the printed product in the image to be identified according to the first distance and the second distance.

[0095] The roller printing machine includes but is not limited to a processor 30 and a memory 31. Those skilled in the art will appreciate that Figure 3It is only an example of a roller printing machine 3 and does not constitute a limitation of a roller printing machine 3. It may include more or fewer components than shown in the figure, or a combination of certain components, or different components. For example, the roller printing machine may also include input and output devices, network access devices, buses, etc.

[0096] The processor 30 may be a central processing unit (CPU), or other general-purpose processors, digital signal processors (DSP), application-specific integrated circuits (ASIC), field-programmable gate arrays (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. A general-purpose processor may be a microprocessor or any conventional processor, etc.

[0097] The memory 31 may be an internal storage unit of the roller printing machine 3, such as a hard disk or memory of the roller printing machine 3. The memory 31 may also be an external storage device of the roller printing machine 3, such as a plug-in hard disk, a smart media card (SMC), a secure digital (SD) card, a flash card, etc. equipped on the roller printing machine 3. Further, the memory 31 may also include both an internal storage unit and an external storage device of the roller printing machine 3. The memory 31 is used to store the computer program and other programs and data required for the defect detection method of the roller printing machine. The memory 31 may also be used to temporarily store data that has been output or is to be output.

[0098] It should be understood that the order of execution of the steps in the above embodiment does not necessarily mean the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiment of the present invention.

[0099] It should be noted that the information interaction, execution process, etc. between the above-mentioned devices / units are based on the same concept as the method embodiment of the present invention. Their specific functions and technical effects can be found in the method embodiment part and will not be repeated here.

[0100] Those skilled in the art can clearly understand that for the convenience and simplicity of description, only the division of the above-mentioned functional units and modules is used as an example for illustration. In actual applications, the above-mentioned function allocation can be completed by different functional units and modules as needed, that is, the internal structure of the device can be divided into different functional units or modules to complete all or part of the functions described above. The functional units and modules in the embodiment can be integrated into a processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The above-mentioned integrated unit can be implemented in the form of hardware or in the form of software functional units. In addition, the specific names of the functional units and modules are only for the convenience of distinguishing each other, and are not used to limit the scope of protection of the present invention. The specific working process of the units and modules in the above-mentioned system can refer to the corresponding process in the aforementioned method embodiment, which will not be repeated here.

[0101] An embodiment of the present invention further provides a computer-readable storage medium, wherein the computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the steps in the above-mentioned method embodiments can be implemented.

[0102] An embodiment of the present invention provides a computer program product. When the computer program product runs on a mobile terminal, the mobile terminal can implement the steps in the above-mentioned method embodiments when executing the computer program product.

[0103] If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the present invention implements all or part of the processes in the above-mentioned embodiment method, which can be completed by instructing the relevant hardware through a computer program. The computer program can be stored in a computer-readable storage medium. When the computer program is executed by the processor, the steps of the above-mentioned method embodiments can be implemented. Among them, the computer program includes computer program code, and the computer program code can be in source code form, object code form, executable file or some intermediate form. The computer-readable medium may at least include: any entity or device that can carry the computer program code to the camera / roller printer, a recording medium, a computer memory, a read-only memory (ROM), a random access memory (RAM), an electrical carrier signal, a telecommunication signal, and a software distribution medium. For example, a USB flash drive, a mobile hard disk, a disk or an optical disk.

[0104] In the above embodiments, the description of each embodiment has its own emphasis. For parts that are not described or recorded in detail in a certain embodiment, reference can be made to the relevant descriptions of other embodiments.

[0105] Those skilled in the art will appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of the present invention.

[0106] In the embodiments provided by the present invention, it should be understood that the disclosed devices / network equipment and methods can be implemented in other ways. For example, the device / network equipment embodiments described above are only schematic. For example, the division of the modules or units is only a logical function division. There may be other division methods in actual implementation, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of devices or units, which can be electrical, mechanical or other forms.

[0107] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, and may be located in one place or distributed over multiple network units.

[0108] It should be understood that when used in the present specification and the appended claims, the term "comprising" indicates the presence of described features, integers, steps, operations, elements and / or components, but does not exclude the presence or addition of one or more other features, integers, steps, operations, elements, components and / or combinations thereof.

[0109] It should also be understood that the term "and / or" used in the present description and the appended claims refers to and includes any and all possible combinations of one or more of the associated listed items.

[0110] As used in the present specification and the appended claims, the term "if" can be interpreted as "when" or "uponce" or "in response to determining" or "in response to monitoring, depending on the context. Similarly, the phrase "if it is determined" or "if [described condition or event] is monitored" can be interpreted as meaning "uponce it is determined" or "in response to determining" or "uponce [described condition or event] is monitored" or "in response to monitoring [described condition or event]", depending on the context.

[0111] In addition, in the description of the present specification and the appended claims, the terms "first", "second", "third", etc. are only used to distinguish the descriptions and cannot be understood as indicating or implying relative importance.

[0112] References to "one embodiment" or "some embodiments" etc. described in the present specification mean that one or more embodiments of the present invention include specific features, structures or characteristics described in conjunction with the embodiment. Therefore, the statements "in one embodiment", "in some embodiments", "in some other embodiments", "in some other embodiments", etc. that appear in different places in this specification do not necessarily refer to the same embodiment, but mean "one or more but not all embodiments", unless otherwise specifically emphasized in other ways. The terms "including", "comprising", "having" and their variations all mean "including but not limited to", unless otherwise specifically emphasized in other ways.

[0113] The embodiments described above are only used to illustrate the technical solutions of the present invention, rather than to limit the same. Although the present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that the technical solutions described in the aforementioned embodiments may still be modified, or some of the technical features may be replaced by equivalents. Such modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present invention, and should all be included in the protection scope of the present invention.

Claims

1. A defect detection method for a roller printing machine, characterized in that: The defect detection method of the roller printing machine comprises: Acquire the image to be identified and the target printing image data collected by the camera; the target printing image data refers to the design drawing data printed on the product; Extracting a plurality of target pixel value regions from the target printing image data; the target pixel value region refers to an image region composed of the same pixel value; Calculating first midpoints of a plurality of target pixel value regions, and calculating first distances between the plurality of first midpoints; According to the pixel value range corresponding to the target pixel value area, extracting pixel areas to be identified corresponding to multiple pixel value ranges in the image to be identified; If the pixel value region to be identified meets a preset condition, calculating a plurality of second midpoints of the pixel value region to be identified, and calculating a second distance between the plurality of second midpoints; the preset condition includes that a second pixel value difference between the pixel value region to be identified and the target pixel value region is less than a second threshold; It is determined whether there is a printing defect in the printed product in the image to be identified according to the first distance and the second distance.

2. The defect detection method of a roller printing machine according to claim 1, characterized in that: The step of extracting a plurality of target pixel value areas in the target printing image data comprises: Extracting pixel values ​​of all pixels in the target printing image data; Aggregate the same pixel values ​​among all pixel values ​​into an initial pixel value set; wherein different initial pixel value sets are used to accommodate different pixel values, and the same initial pixel value set is used to accommodate the same pixel value; In the initial pixel value set, obtaining a pixel position corresponding to each pixel value; In each of the initial pixel value sets, pixel values ​​having adjacent pixel positions are respectively aggregated into a target subset; Calculating first pixel differences between all target subsets, and sorting the multiple first pixel differences; The target subsets corresponding to the first N first pixel difference values ​​are used as the plurality of target pixel value regions.

3. The defect detection method of a roller printing machine according to claim 2, characterized in that: The step of respectively aggregating pixel values ​​having adjacent pixel positions in each of the initial pixel value sets into a target subset comprises: In each of the initial pixel value sets, pixel values ​​having adjacent pixel positions are respectively aggregated into initial subsets; Among all initial subsets, the first subset with adjacent pixels is matched; Calculating a first difference in pixel values ​​between adjacent first subsets; If the first difference is less than a first threshold, merging adjacent first subsets to form a second subset; The remaining subsets and the second subset are used as the target subsets; the remaining subsets refer to the subsets of all initial subsets except the first subset.

4. The defect detection method of a roller printing machine according to claim 3, characterized in that: The step of merging adjacent first subsets as a second subset if the first difference is less than a first threshold comprises: If the first difference is less than a first threshold, counting the number of pixel values ​​in any one of the first subsets; Multiplying the number of pixel values ​​by a lower limit coefficient to obtain a lower limit value of the number of adjacent pixels; Multiplying the number of pixel values ​​by an upper limit coefficient to obtain an upper limit value of the number of adjacent pixels; If the number of pixel values ​​in the first subset is between the upper limit of the number of adjacent pixels and the lower limit of the number of adjacent pixels, the adjacent first subsets are merged to form a second subset.

5. The defect detection method of a roller printing machine according to claim 1, characterized in that: If the pixel value region to be identified meets the preset condition, the step of calculating the second midpoints of the plurality of pixel value regions to be identified and calculating the second distances between the plurality of second midpoints comprises: If the second pixel value difference between the pixel value area to be identified and the target pixel value area is less than a second threshold, a plurality of second midpoints of the pixel value area to be identified are calculated, and a second distance between the plurality of second midpoints is calculated.

6. The defect detection method of a roller printing machine according to claim 1, characterized in that: The step of determining whether there is a printing defect in the printed product in the image to be identified according to the first distance and the second distance includes: calculating a first distance ratio between a plurality of the first distances; calculating a second distance ratio between a plurality of the second distances; Calculate a second difference between the first distance ratio and the second distance ratio; If the plurality of second differences are all smaller than the third threshold, it is confirmed that the printed product has no printing defects; If the second difference is not less than the third threshold, it is confirmed that the printed product has a type of printing defect, and the pixel value area to be identified corresponding to the second difference is extracted; the type of printing defect includes printing misalignment, printing ghosting, printing distortion, printing unevenness or printing ink drag; Obtaining a target pixel value region corresponding to the pixel value region to be identified; Calculating the similarity between the pixel value region to be identified and the target pixel value region; If the similarity is greater than a fourth threshold, it is confirmed that the printed product does not have a printing defect; If the similarity is not greater than the fourth threshold, it is determined that the printed product in the image to be identified has two types of printing defects; the two types of printing defects include printing stains, printing line breaks and printing bubbles.

7. The defect detection method of a roller printing machine according to claim 6, characterized in that: The step of calculating the similarity between the to-be-identified pixel value region and the target pixel value region comprises: Counting the number of first pixel points in the pixel value area to be identified, and counting the number of second pixel points in the target pixel value area; Extracting a first midpoint of a target pixel value region and extracting a second midpoint of a pixel value region to be identified; Calculating a third difference between the first number of pixels and the second number of pixels; Calculating a midpoint distance between the first midpoint and the second midpoint; multiplying the third difference by the first adjustment coefficient to obtain a first product; Multiplying the midpoint distance by a second adjustment coefficient to obtain a second product; The sum of the first product and the second product is taken as the similarity.

8. A defect detection device for a roller printing machine, characterized in that: The defect detection device of the roller printing machine comprises: An acquisition unit, used to acquire the image to be recognized and the target printing image data collected by the camera; the target printing image data refers to the design drawing data printed on the product; A first extraction unit is used to extract a plurality of target pixel value regions from the target printing image data; the target pixel value region refers to an image region composed of the same pixel value; A first calculation unit, used for calculating a plurality of first midpoints of the target pixel value regions, and calculating a first distance between the plurality of first midpoints; A second extraction unit is used to extract pixel regions to be identified corresponding to a plurality of pixel value ranges in the image to be identified according to the pixel value range corresponding to the target pixel value region; a second calculation unit, configured to calculate a plurality of second midpoints of the pixel value region to be identified and calculate a second distance between the plurality of second midpoints if the pixel value region to be identified meets a preset condition; the preset condition includes that a second pixel value difference between the pixel value region to be identified and the target pixel value region is less than a second threshold; A determination unit is used to determine whether there is a defect in the printed product in the image to be identified according to the first distance and the second distance.

9. A roller printing machine, characterized in that: The roller printing machine includes: a roller system, a camera, a memory, a processor, and a defect detection program of the roller printing machine stored in the memory and executable on the processor, wherein the defect detection program of the roller printing machine is configured to implement the steps in the defect detection method of the roller printing machine as described in any one of claims 1 to 7.

10. A computer-readable storage medium storing a computer program, characterized in that: When the computer program is executed by a processor, the steps of the defect detection method for a roller printing machine according to any one of claims 1 to 7 are implemented.

Citation Information

Patent Citations

  • Printing defect detection method based on machine vision

    CN117705815A

  • Product defect detection method, device and system

    WO2021017725A1

Cited By

  • Surface quality visual inspection system for packaging paper presswork

    CN120064294A