Defect Detection Method, Device, Roll Printing Machine and Storage Medium of a Roll Printing Machine
By extracting the target pixel value area in the roller printer and calculating the midpoint distance and similarity, the problems of inefficient and insufficient accuracy of traditional detection methods are solved, and efficient and accurate printing defect recognition is achieved.
Patent Information
- Application Number
- CN202510059169.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-01-15
- Publication Date
- 2025-06-27
- Estimated Expiration
- 2045-01-15
AI Technical Summary
The traditional roller printer printing defect detection method relies on manual visual inspection or simple image processing algorithms, which is inefficient and has limited detection accuracy, making it difficult to meet the quality control needs of modern large-scale production.
By obtaining the image to be identified and the target printed image data collected by the camera, the target pixel value area is extracted, the midpoint distance is calculated, and whether the printed material has defects is judged based on preset conditions, including calculating the first and second distance ratios and similarity, and identifying the first and second types of printing defects.
It significantly improves the efficiency and accuracy of printing defect detection, reduces missed and missed detection, can adapt to the detection needs of different printed materials, and reduces errors caused by lighting changes and image noise.
Smart Images

Figure CN119477913B_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the technical field of image data processing, and particularly relates to a method and device for defect detection of a roller printing machine, a roller printing machine, and a storage medium. Background Art
[0002] With the continuous growth of the demand for electronic products, especially in the applications of high-performance and high-density electronic components, multi-layer ceramic capacitors (MLCCs) are widely used in mobile phones, computers, automotive electronics, and other consumer electronic products as an important electronic component. Due to their advantages of miniaturization, low cost, and high capacitance density, MLCCs have become one of the indispensable basic components in the modern electronic industry.
[0003] The manufacturing process of MLCCs involves complex multi-layer printing and sintering processes. To ensure their performance and reliability, precise printing quality control is crucial. During the manufacturing process, especially the use of roller printing technology, enables accurate printing of patterns and circuits on the product surface. A roller printing machine is a printing device widely used in the production of ceramic capacitors, which forms the required electrode pattern by uniformly transferring conductive paste onto the substrate surface.
[0004] However, due to the accuracy of the roller printing machine, the characteristics of the printing materials, and the changes in the equipment operating conditions, various defects are prone to occur during the printing process. Common printing defects include image blurring, pattern misalignment, voids, missing printing, 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 requirements for quality control in modern large-scale production. Especially on high-speed and high-precision roller printing machine production lines, manual inspection cannot monitor and identify every detail in real time, and it is easy to miss or misdetect. Summary of the Invention
[0006] In view of this, embodiments of the present invention provide a method and device for defect detection of a roller printing machine, a roller printing machine, and a storage medium to solve the technical problems that traditional printing defect detection methods mainly rely on manual visual inspection or simple image processing algorithms, which are not only inefficient but also have limited detection accuracy.
[0007] The first aspect of the embodiments of the present invention provides a method for defect detection of a roller printing machine, and the method for defect detection of the roller printing machine includes:
[0008] Obtain the image to be recognized collected by the camera and the target printing image data; the target printing image data refers to the design drawing data printed on the product;
[0009] Extract multiple target pixel value regions from the target printed image data; the target pixel value region refers to an image region composed of the same pixel values.
[0010] Calculate the first midpoints of multiple said target pixel value regions, and calculate the first distances between multiple said first midpoints.
[0011] According to the pixel value ranges corresponding to the target pixel value regions, extract multiple to-be-recognized pixel regions corresponding to each pixel value range in the to-be-recognized image.
[0012] If the to-be-recognized pixel value region meets a preset condition, calculate the second midpoints of multiple said to-be-recognized pixel value regions, and calculate the second distances between multiple said second midpoints; the preset condition includes that the second pixel value difference between the to-be-recognized pixel value region and the target pixel value region is less than a second threshold.
[0013] Determine whether there are printing defects in the printed matter in the to-be-recognized image according to the first distance and the second distance.
[0014] Further, the step of extracting multiple target pixel value regions from the target printed image data includes:
[0015] Extract the pixel values of all pixel points in the target printed image data.
[0016] Aggregate the same pixel values among all pixel values into an initial pixel value set; among them, 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 kind of pixel values.
[0017] In the initial pixel value set, obtain the pixel positions corresponding to each pixel value.
[0018] In each said initial pixel value set, respectively aggregate the pixel values with adjacent pixel positions into target subsets.
[0019] Calculate the first pixel differences between all target subsets, and sort multiple first pixel differences.
[0020] Use the target subsets corresponding to the first N first pixel differences as multiple said target pixel value regions.
[0021] Further, the step of respectively aggregating the pixel values with adjacent pixel positions into target subsets in each said initial pixel value set includes:
[0022] In each said initial pixel value set, respectively aggregate the pixel values with adjacent pixel positions into initial subsets.
[0023] Among all the initial subsets, match the first subset with adjacent pixel points;
[0024] Calculate the first difference of pixel values between adjacent first subsets;
[0025] If the first difference is less than the first threshold, merge the adjacent first subsets as the second subset;
[0026] Take the remaining subsets and the second subset as the target subsets; the remaining subsets refer to the subsets other than the first subset among all the initial subsets.
[0027] Further, the step of if the first difference is less than the first threshold, merge the adjacent first subsets as the second subset includes:
[0028] If the first difference is less than the first threshold, count the number of pixel values in any one of the first subsets;
[0029] Multiply the number of pixel values by the lower limit coefficient to obtain the lower limit value of the number of adjacent pixels;
[0030] Multiply the number of pixel values by the upper limit coefficient to obtain the upper limit value of the number of adjacent pixels;
[0031] If the number of pixel values in the first subset is between the upper limit value and the lower limit value of the number of adjacent pixels, merge the adjacent first subsets as the second subset.
[0032] Further, the step of if the area of the pixel value to be recognized meets the preset conditions, calculate the second midpoint of multiple areas of the pixel value to be recognized and calculate the second distance between multiple second midpoints includes:
[0033] If the second pixel value difference between the area of the pixel value to be recognized and the area of the target pixel value is less than the second threshold, calculate the second midpoint of multiple areas of the pixel value to be recognized and calculate the second distance between multiple second midpoints.
[0034] Further, the step of determining whether there is a printing defect in the printed matter in the image to be recognized according to the first distance and the second distance includes:
[0035] Calculate the first distance ratio between multiple first distances;
[0036] Calculate the second distance ratio between multiple second distances;
[0037] Calculate the second difference between the first distance ratio and the second distance ratio;
[0038] If multiple ones of the second differences are all less than a third threshold value, it is confirmed that there are no printing defects in the printed matter;
[0039] If the second difference is not less than the third threshold value, it is confirmed that there is a first type of printing defect in the printed matter, and a pixel value region to be recognized corresponding to the second difference is extracted; the first type of printing defect includes printing misalignment, printing ghosting, printing distortion, printing unevenness or printing ink dragging;
[0040] Obtain a target pixel value region corresponding to the pixel value region to be recognized;
[0041] Calculate the similarity between the pixel value region to be recognized and the target pixel value region;
[0042] If the similarity is greater than a fourth threshold value, it is confirmed that there are no printing defects in the printed matter;
[0043] If the similarity is not greater than the fourth threshold value, it is determined that there is a second type of printing defect in the printed matter in the image to be recognized; the second type of printing defect includes printing stains, printing broken lines and printing blisters.
[0044] Further, the step of calculating the similarity between the pixel value region to be recognized and the target pixel value region includes:
[0045] Count the number of first pixel points in the pixel value region to be recognized, and count the number of second pixel points in the target pixel value region;
[0046] Extract a first midpoint of the target pixel value region, and extract a second midpoint of the pixel value region to be recognized;
[0047] Calculate a third difference between the number of first pixel points and the number of second pixel points;
[0048] Calculate the midpoint distance between the first midpoint and the second midpoint;
[0049] Multiply the third difference by a first adjustment coefficient to obtain a first product;
[0050] Multiply the midpoint distance by a second adjustment coefficient to obtain a second product;
[0051] Take the sum between the first product and the second product as the similarity.
[0052] A second aspect of the embodiments of the present invention provides a defect detection device for a roll printing machine, including:
[0053] An acquisition unit, configured to acquire an image to be recognized and target printed image data collected by a camera; the target printed image data refers to design drawing data printed on a product;
[0054] A first extraction unit, configured to extract multiple target pixel value regions from the target printed image data; the target pixel value region refers to an image region formed by the same pixel values;
[0055] A first calculation unit, configured to calculate a first midpoint of multiple target pixel value regions, and calculate a first distance between multiple first midpoints;
[0056] A second extraction unit, configured to extract multiple to-be-recognized pixel regions corresponding to respective pixel value ranges in the to-be-recognized image according to the pixel value ranges corresponding to the target pixel value regions;
[0057] A second calculation unit, configured to calculate a second midpoint of multiple to-be-recognized pixel value regions and calculate a second distance between multiple second midpoints if the to-be-recognized pixel value regions meet a preset condition; the preset condition includes that a second pixel value difference between the to-be-recognized pixel value regions and the target pixel value regions is less than a second threshold;
[0058] A determination unit, configured to determine whether there are defects in the printed matter in the to-be-recognized image according to the first distance and the second distance.
[0059] A third aspect of the embodiments of the present invention provides a roller printing machine, including a roller system, a camera, a memory, a processor, and a computer program stored in the memory and executable on the processor. When the processor executes the computer program, the steps of the defect detection method of the roller printing machine described in the first aspect are implemented.
[0060] A fourth aspect of the embodiments of the present invention provides a computer-readable storage medium storing a computer program, and when the computer program is executed by a processor, the steps of the defect detection method of the roller printing machine described in the first aspect are implemented.
[0061] The beneficial effects of the embodiments of the present invention compared with the prior art are as follows: First, this solution collects the image to be recognized and the target printed image data through a camera, and extracts multiple target pixel value regions in the target printed image. Since the target pixel value regions are divided based on the consistency of pixel values, the target image can be effectively compared with the image to be recognized, greatly improving the efficiency and accuracy of image processing. By calculating the first midpoints of multiple target pixel value regions and the first distances between them, this technology can accurately locate the feature regions in the target printed image. The calculation of these first midpoints provides an accurate benchmark for subsequent defect detection, enabling more accurate comparison and detection of possible defect regions in the image to be recognized. According to the pixel value range corresponding to the target pixel value region, the pixel value range region corresponding to the image to be recognized is extracted. By setting preset conditions (such as the number of pixel points condition), the detection range of the image to be recognized can be flexibly controlled, further improving the accuracy and adaptability of detection. During the detection process, by calculating the second midpoints of the pixel value regions to be recognized and the second distances between the second midpoints, further confirmation and determination of the defect regions in the image to be recognized are achieved. If the pixel value region of the image to be recognized meets the preset conditions, possible printing defects can be efficiently recognized. This method has a high fault tolerance and can achieve high-precision defect recognition in a variety of complex printed products. This technical solution performs defect detection based on the distance calculation of pixel value regions, which can effectively reduce the errors caused by light changes, image noise, or uneven printing quality, thereby improving the 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, can not only reduce manual intervention, but also adapt to the detection requirements of different printed products. BRIEF DESCRIPTION OF THE DRAWINGS
[0062] In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the following will briefly introduce the drawings required for use in the embodiments or related technical descriptions. Obviously, the following drawings are only some embodiments of the present invention. For those of ordinary skill in the art, without creative efforts, other drawings can be obtained based on these drawings.
[0063] Figure 1 FIG. shows a schematic flowchart of a method for detecting defects of a roller printing machine provided by the present invention;
[0064] Figure 2 FIG. shows a schematic diagram of a device for detecting defects of a roller printing machine provided by an embodiment of the present invention;
[0065] Figure 3 FIG. shows a schematic diagram of a roller printing machine provided by an embodiment of the present invention. Specific Embodiments
[0066] In the following description, specific details such as specific system architectures and technologies are presented for the purpose of illustration rather than limitation, so as to thoroughly understand the embodiments of the present invention. However, those skilled in the art should clearly understand that the present invention can also 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 avoid unnecessary details from interfering with the description of the present invention.
[0067] Embodiments of the present invention provide a method, apparatus, roller printing machine, and storage medium for defect detection of a roller printing machine to solve the technical problems that traditional printing defect detection methods mainly rely on manual visual inspection or simple image processing algorithms, which are not only inefficient but also have limited detection accuracy.
[0068] First, the present invention provides a method for defect detection of a roller printing machine. The method for defect detection of a roller printing machine is applied to a roller printing machine, which includes but is not limited to a roller system, a camera, a memory, a processor, and a defect detection program of the roller printing machine stored on the memory and executable on the processor. Please refer to Figure 1 , Figure 1 which shows a schematic flowchart of a method for defect detection of a roller printing machine provided by the present invention. As Figure 1 shown, the method for defect detection of the roller printing machine may include the following steps:
[0069] Step 101: Obtain an image to be recognized collected by the camera and target printing image data; the target printing image data refers to the design drawing data printed on the product;
[0070] The image to be recognized refers to the product image collected by the camera or other devices, and the image content is the surface of the printed matter to be inspected. The target printing image data is the pre-designed target image data, usually referring to the printing design pattern that should be presented on the product, which represents the ideal printing effect.
[0071] Step 102: Extract multiple 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 values;
[0072] In the target printing image, the image is segmented into multiple regions based on the similarity of pixel values. The pixel values of these regions are the same, representing a specific pattern or color block.
[0073] For example, in a printed pattern, an area often has the same or similar color, so at the pixel level, this area will be regarded as a target pixel value region.
[0074] Specifically, step 102 specifically includes steps 1021 to 1026:
[0075] Step 1021: Extract the pixel values of all pixel points in the target printed image data;
[0076] Extract all the pixel values from the target printed image. Each pixel has a specific color value (such as RGB value) in a digital image. In this process, each pixel point 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, aiming to obtain the original information of each pixel in the image.
[0077] Step 1022: Aggregate the same pixel values among all the 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 kind of pixel values;
[0078] Aggregate the pixel points with the same pixel values together to form multiple "initial pixel value sets". Each set only contains pixels of the same color. This aggregation helps the system understand the color distribution in the image and facilitates subsequent partitioning and analysis of the image area. By aggregating the same pixel values, the system can identify the areas with consistent colors as candidates for the target areas.
[0079] Step 1023: In the initial pixel value set, obtain the pixel positions corresponding to each pixel value;
[0080] For the pixel points in each pixel value set, record the specific position of the pixel in the image. For example, a pixel point has an RGB value of (255, 0, 0) and it is located at the coordinates (x = 100, y = 150) of the image. Such position coordinates are crucial for subsequent pixel aggregation and area analysis. Obtaining the position of the pixel is for subsequent aggregation of adjacent pixels according to the position to help more precisely define the area.
[0081] Step 1024: In each of the initial pixel value sets, respectively aggregate the pixel values with adjacent pixel positions into a target subset;
[0082] Since the initial pixel value sets obtained by aggregating the same pixel values may include multiple images or image regions, it is necessary to further divide the initial pixel value sets. In each initial pixel value set, pixel points with adjacent positions are aggregated into a smaller subset. Here, "adjacent" means in contact with each other in the image. If there are many pixel points of the same color in a certain area of the image, and their positions are close or adjacent, then these pixels will be grouped into a "target subset". The purpose of this step is to aggregate continuous and similar pixels to form relatively distinct regions. By aggregating adjacent pixels, some natural regions can be formed in the image, and these regions are more likely to represent the actual physical regions or specific pattern features of the image.
[0083] For the aggregation of pixel values, it is necessary to consider the pixel value difference and the number of adjacent pixel points respectively (the smaller the pixel value or the larger the number of adjacent pixel points, the greater the possibility of aggregation). The specific aggregation logic is as follows:
[0084] Specifically, step 1024 specifically includes steps A1 to A5:
[0085] Step A1: In each of the initial pixel value sets, pixel values with adjacent pixel positions are respectively aggregated into initial subsets;
[0086] In each initial pixel value set, find and aggregate those pixel points that are adjacent in spatial position. This means that if two pixel points are adjacent in the image, they are merged into an "initial subset".
[0087] Step A2: Among all the initial subsets, match the first subsets with adjacent pixel points;
[0088] Since there may be adjacent approximate pixel value regions (such as: edge color gradient regions or others) between the corresponding initial subsets of different initial pixel value sets. Therefore, it is necessary to perform a merging process on the adjacent approximate pixel value regions.
[0089] If two initial subsets are located in different parts of the image respectively, but their boundaries are adjacent (or the edge parts of the pixel points are in contact), then these two subsets will be regarded as "adjacent initial subsets". The purpose of this step is to match the subsets in the image according to the position relationship, so as to identify those closely connected regions. In this way, it can be further analyzed whether there is a larger structure or pattern between these regions.
[0090] Step A3: Calculate the first difference of the pixel values between the adjacent first subsets;
[0091] Calculating the "first difference" between two adjacent initial subsets generally refers to the difference in pixel values between these two subsets. Calculating the "pixel difference" is to determine whether these two adjacent subsets are similar or consistent enough. If their pixel difference is small, it means they are very similar in color, texture, or shape and may belong to the same region.
[0092] Step A4: If the first difference is less than the first threshold, merge the adjacent first subset as the second subset;
[0093] If the calculated "first difference" is less than the preset "first threshold", then merge these two adjacent initial subsets into a new subset, called the "second subset". If the pixel value difference between the first subset and the second subset is small (below the threshold), they will be considered to belong to the same region and thus merged into a larger region. The purpose of this step is to determine whether adjacent regions can be merged through the threshold. If the difference is small, it indicates that they may be part of the same printed pattern, and merging into one region helps improve the accuracy of subsequent analysis.
[0094] Specifically, step A4 specifically includes steps A41 to A44:
[0095] Step A41: If the first difference is less than the first threshold, count the number of pixel values in any one of the first subsets;
[0096] After determining that the pixel difference between two adjacent initial subsets is less than a certain "first threshold", next, it is necessary to count the number of pixel points in one of the subsets (i.e., the "first subset"). The purpose of this step is to understand the scale (number of pixel points) of the current subset, and then judge the number of adjacent pixel points in the subset, which is an important basis for subsequent judgment of whether to merge.
[0097] Step A42: Multiply the number of pixel values by the lower limit coefficient to obtain the lower limit value of the adjacent pixel number;
[0098] Step A43: Multiply the number of pixel values by the upper limit coefficient to obtain the upper limit value of the adjacent pixel number;
[0099] It should be noted that in the printed design pattern, there may be two different patterns that are only "tangent" or "adjacent in small amounts", while there are usually more adjacent pixel points in the same pattern. To avoid the merger between 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 subset through the number of adjacent pixels.
[0100] 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 pixel points in the first subset. That is, the more pixel points, the more adjacent pixels. The fewer pixel points, the fewer adjacent pixels. Therefore, it is necessary to calculate the lower limit value of the number of adjacent pixels according to the number of pixel values and the lower limit coefficient. Calculate the upper limit value of the number of adjacent pixels according to the number of pixel values and the upper limit coefficient.
[0101] Step A44: If the number of pixel values in the first subset is between the upper limit value and the lower limit value of the number of adjacent pixels, then merge the adjacent first subsets as the second subset.
[0102] In this embodiment, by combining the pixel value difference and the upper and lower limit control of the pixel number, a 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.
[0103] Step A5: Use the remaining subsets and the second subset as the target subsets; the remaining subsets refer to the subsets other than the first subset among all the initial subsets.
[0104] If there are multiple subsets after merging, among which the merged second subset and the remaining other subsets together form the final target subsets, these subsets will be used as the subsequent analysis objects.
[0105] In this embodiment, in this solution, by aggregating the pixel values at adjacent pixel positions into initial subsets in each initial pixel value set, it is possible to efficiently identify the pixel regions with similar features in the image. The aggregation of adjacent pixel values effectively improves the continuity and consistency of the regions, providing an accurate basis for subsequent image analysis and defect detection. This solution calculates the first difference of the pixel values between adjacent first subsets and judges whether to merge the subsets through a set first threshold. This method can automatically judge which subsets have sufficient similarity in pixel values for merging by introducing threshold control. 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 methods of the remaining subsets and the second subset further optimize the region division of the image. By combining the remaining subsets (that is, the other subsets except the first subset) with the merged second subset to form the target subsets, it is ensured that all important regions are reasonably covered, while avoiding the omission or redundancy of regions. This strategy effectively improves the integrity and accuracy of the image processing results. This technical solution realizes efficient and accurate image region extraction through precise adjacent pixel value aggregation, intelligent difference calculation and subset merging strategy, greatly improving the accuracy and efficiency of image processing.
[0106] Step 1025: Calculate the first pixel differences between all target subsets, and sort the multiple first pixel differences.
[0107] Calculate the "first pixel differences" between all target subsets. This "difference" refers to the difference in pixel values between two target subsets. Calculating the "pixel differences" helps the system measure the similarity or difference between different subsets. By sorting these differences, the most representative regions can be identified, and then the target regions that best meet the expectations can be filtered out.
[0108] Step 1026: Use the target subsets corresponding to the top N first pixel differences as the multiple target pixel value regions.
[0109] According to the calculated pixel differences, select the top N target subsets with the largest differences as the final target pixel value regions. It can be understood that since the subsets with the largest differences have less "similarity interference" in the image and have greater differences, the subsequent judgment accuracy can be improved.
[0110] In this embodiment, first, extract the pixel values of all pixel points in the target printed image, and aggregate the pixel points with the same pixel value into an initial pixel value set. This aggregation method can efficiently classify the pixel information in the image, enabling subsequent processing steps to focus on specific pixel value regions, improving the processing efficiency, and effectively reducing the computational complexity. Obtain the pixel positions corresponding to the pixel values in each initial pixel value set, providing accurate spatial position information for subsequent region division and aggregation of target subsets. In this way, it can be ensured that the positional relationship in the region division and pixel aggregation process is accurate, 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 target subsets, continuous regions of pixel values can be effectively identified. This aggregation method can effectively extract similar regions in the image, improve the accuracy of image processing, and reduce misjudgments caused by noise or irregular pixel distributions. By calculating the first pixel differences between all target subsets and sorting the multiple first pixel differences, the most representative target subsets can be intelligently filtered out. By selecting the target subsets corresponding to the top N first pixel differences as the final target pixel value regions, the accuracy and rationality of region extraction are further optimized. This sorting method ensures that the selected regions have high cohesion and consistency. In summary, this technical solution greatly improves the extraction efficiency and accuracy of multiple target pixel value regions in the target printed image data through precise pixel value aggregation, target subset division, and intelligent sorting methods.
[0111] Step 103: Calculate the first midpoints of multiple said target pixel value regions, and calculate the first distances between multiple said first midpoints;
[0112] For each target pixel value region, calculate its geometric center, i.e., the average position of all pixel points in this region. Calculate the first distances between the midpoints of all target pixel value regions. The first distances will help the system understand whether the arrangement of the printed pattern is normal.
[0113] Step 104: According to the pixel value ranges corresponding to the target pixel value regions, extract multiple to-be-recognized pixel regions corresponding to respective pixel value ranges in the to-be-recognized image;
[0114] According to the pixel value ranges of the target pixel value regions in the target printed image, extract the corresponding pixel value regions in the to-be-recognized image. These to-be-recognized pixel regions should correspond to the regions in the target image and have similar pixel value ranges.
[0115] Step 105: If the to-be-recognized pixel value regions meet the preset conditions, calculate the second midpoints of multiple said to-be-recognized pixel value regions, and calculate the second distances between multiple said second midpoints; the preset conditions include that the second pixel value difference between the to-be-recognized pixel value regions and the target pixel value regions is less than a second threshold;
[0116] Specifically, step 105 specifically includes: If the second pixel value difference between the to-be-recognized pixel value regions and the target pixel value regions is less than the second threshold, calculate the second midpoints of multiple said to-be-recognized pixel value regions, and calculate the second distances between multiple said second midpoints.
[0117] The preset conditions include threshold conditions based on the number of pixel points. That is to say, only those to-be-recognized regions containing a sufficient number of pixel points will be further analyzed. This step is to ensure that only relatively important regions are considered and to avoid small noise regions from interfering with the detection.
[0118] For multiple to-be-recognized pixel regions in the to-be-recognized image, also calculate their geometric centers (second midpoints). Calculate the second distances between the second midpoints to compare the differences between the to-be-recognized image and the target image.
[0119] Step 106: Determine whether there are printing defects in the printed matter in the to-be-recognized image according to the first distance and the second distance.
[0120] Specifically, step 106 specifically includes steps 1061 to 1069:
[0121] Step 1061: Calculate the first distance ratio between multiple said first distances;
[0122] Step 1062: Calculate the second distance ratio between multiple said second distances;
[0123] This step can help evaluate whether the relative positions of features in the printed image meet the expectations. If the ratio of these distances is too large or too small, it may indicate that there are some abnormal conditions in the image.
[0124] Step 1063: Calculate the second difference between the first distance ratio and the second distance ratio;
[0125] By calculating the difference between these two ratios, it is possible to further determine whether the positional relationship in the printed matter is normal. A large difference may mean that there are abnormal deformations or misalignments in some areas of the printing.
[0126] Step 1064: If multiple said second differences are all less than the third threshold, confirm that the printed matter has no printing defects;
[0127] 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 matter has no defects. The purpose of this judgment step is to exclude those images without defects and ensure the efficiency and accuracy of the detection process.
[0128] Step 1065: If the second difference is not less than the third threshold, confirm that the printed matter has a type of printing defect, and extract the region of the pixel value corresponding to the second difference; the type of printing defect includes printing misalignment, printing ghosting, printing distortion, printing unevenness, or printing ink dragging;
[0129] If some "second differences" are not less than the third threshold, it means that the printed matter has defects. At this time, the system will mark the defective areas and extract the pixel values in these areas. It provides specific image information for further defect analysis. The type of printing defect includes but is not limited to printing misalignment, printing ghosting, printing distortion, printing unevenness, or printing ink dragging. It can be understood that the type of printing defect will cause the pattern to be displaced, which in turn causes the second difference to be not less than the third threshold.
[0130] Printing misalignment: The pattern or text is not aligned as expected.
[0131] Printing ghosting: Multiple contours appear in the image, similar to image overlap.
[0132] Printing distortion: The form of the image or pattern is deformed and loses its original proportion or shape.
[0133] Printing unevenness: The color or brightness distribution in some areas of the image is uneven.
[0134] Printing ink drag: The ink spreads during the printing process, causing blur or smearing.
[0135] 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.
[0136] 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.
[0137] 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.
[0138] 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.
[0139] 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.
[0140] These printing defects (misregistration, ghosting, distortion, unevenness, ink dragging) will essentially cause changes in the spatial position relationship between various regions in the image. This change is usually local, but through the calculation of the midpoint distance difference, such positional anomalies can be identified.
[0141] Step 1066: Obtain the target pixel value region corresponding to the pixel value region to be recognized.
[0142] Step 1067: Calculate the similarity between the pixel value region to be recognized and the target pixel value region.
[0143] By comparing the similarity, it is further confirmed whether there are defects. A higher similarity indicates that the region to be recognized is consistent with the target region, and the defect is small or non-existent. A lower similarity indicates that there are obvious defects in the region to be recognized.
[0144] In order to further improve the accuracy of printing defect recognition, after determining the printing defect according to the distance gap, it is necessary to make a further judgment based on the region similarity, and the region similarity can be used to judge the second type of printing defect. The specific calculation logic of the similarity is as follows:
[0145] Specifically, step 1067 specifically includes steps B1 to B7:
[0146] Step B1: Count the number of first pixel points in the pixel value region to be recognized, and count the number of second pixel points in the target pixel value region.
[0147] Count the number of pixel points in the region to be recognized (the region to be detected in the image) and the target region (the standard image region). By counting the number of pixel points, the size information of these two regions is obtained. The difference in region size can reflect whether there is a significant gap between the two regions, which is crucial for judging the similarity.
[0148] Step B2: Extract the first midpoint of the target pixel value region, and extract the second midpoint of the pixel value region to be recognized.
[0149] Step B3: Calculate the third difference between the number of first pixel points and the number of second pixel points.
[0150] Step B4: Calculate the midpoint distance between the first midpoint and the second midpoint.
[0151] Step B5: Multiply the third difference by the first adjustment coefficient to obtain the first product.
[0152] The first adjustment coefficient is used to weight-adjust the pixel quantity difference, making the influence of this difference more in line with the actual application requirements.
[0153] Step B6: Multiply the midpoint distance by the second adjustment coefficient to obtain a second product.
[0154] The second adjustment coefficient determines the contribution degree of the midpoint distance to the similarity. When the adjustment coefficient is relatively large, the distance difference at the midpoint will have a greater impact on the similarity.
[0155] Step B7: Take the sum between the first product and the second product as the similarity.
[0156] In this embodiment, this solution calculates the difference between regions by counting the number of pixel points in the region of the pixel value to be recognized and the region of the target pixel value, and extracting the midpoints of the two regions. By comprehensively considering the difference in the number of pixel points and the difference in the region positions, it can accurately reflect the similarity between the region to be recognized and the target region. This calculation method avoids the simple way of directly comparing only based on pixel values in the traditional method, takes into account the overall distribution and structural differences of the regions, and ensures that the calculation of the similarity is more comprehensive and accurate. During the calculation of the similarity, this solution counts the number of pixel points in the region to be recognized 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 pixel points in the region to be recognized 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 the similarity calculation. By extracting the midpoint of the region of the pixel value to be recognized and the midpoint of the region of the target pixel value, and calculating the midpoint distance between the two, this solution can further measure the position difference between regions. This operation can identify the offset in the spatial position between the target region and the region to be recognized. If the deviation of the center points of the two regions is large, the similarity value will decrease accordingly, thereby effectively distinguishing the similarity of regions in different positions. During the calculation process, this solution introduces a first adjustment coefficient and a second adjustment coefficient, which act on the products of the difference in the number of pixel points and the midpoint distance respectively. These coefficients can be adjusted according to the actual application scenario to optimize the sensitivity of the similarity calculation for different types of images or region features. For example, in some scenarios, the difference in the number of pixel points may be more important than the position difference, or vice versa, and the adjustment coefficients can be configured flexibly, thereby improving the adaptability and accuracy of the similarity calculation. By comprehensively considering the difference in pixel quantity, the difference in region position, and the adjustment coefficients, this solution can accurately capture the similarity or difference between image regions. Compared with the traditional technology that simply compares based on pixels, the multi-dimensional analysis method of this solution can better handle complex images, especially suitable for tasks such as image quality detection and defect detection that require high-precision region matching, and avoids errors caused by over-reliance on a single feature. This technical solution not only qualitatively evaluates whether the regions are similar, but also provides a quantitative similarity value, which can be directly used for subsequent analysis and decision-making, improving the operability of the detection results.
[0157] Step 1068: If the similarity is greater than the fourth threshold, it is confirmed that there are no printing defects in the printed matter;
[0158] Since there are certain limitations in judging printing defects based on the distance ratio, the accuracy of defect recognition can be improved through similarity comparison.
[0159] If the calculated similarity is greater than the fourth threshold, it means that the difference between the area to be recognized and the target area is small, and it is confirmed that there are no defects. For example: If the similarity is higher than a certain threshold (such as 0.95), the printed matter is considered to have no defects.
[0160] Step 1069: If the similarity is not greater than the fourth threshold, it is determined that there are secondary printing defects in the printed matter in the image to be recognized; the secondary printing defects include printing stains, printing breaks, and printing blisters.
[0161] If the similarity is not greater than the fourth threshold, it means that the difference between the area to be recognized and the target area is large, and it is confirmed that there are secondary printing defects. The secondary printing defects include but are not limited to:
[0162] Printing stains: There are irregular stains or spots in the image.
[0163] Printing breaks: The pattern or line is interrupted, resulting in discontinuity.
[0164] Printing blisters: Bubbles appear on the printing surface, affecting the pattern quality.
[0165] In this embodiment, the solution can effectively identify potential defects in printed matter 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 defects of traditional defect detection methods that rely on a single feature and can capture the patterns of printing errors or defects in images more comprehensively. The solution first calculates the difference between the first distance ratio and the second distance ratio and determines whether there are printing defects in the image according to 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 matter in the image, and the system confirms that the printed matter 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 type of printing defect, such as printing misalignment, ghosting, distortion, unevenness, or ink dragging, etc., thus providing a basis for subsequent defect localization 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 types of defects, including a type of printing defect (misalignment, ghosting, distortion, unevenness, ink dragging) and a type II printing defect (stain, broken line, blister). This hierarchical classification method provides more detailed defect recognition capabilities, which helps subsequent quality control and defect repair work. When the system identifies that the second difference exceeds the third threshold, it can extract the corresponding area of pixel values to be identified and compare it with the target area of pixel values. Through this method of area extraction and comparison, 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 area of pixel values to be identified and the target area of pixel values, 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 there are no defects in the printed matter; otherwise, it is determined that there are type II defects. The similarity measurement mechanism enhances the accuracy and robustness of image analysis and effectively excludes noise interference and occasional non-defect areas. This technical solution can intelligently classify according to different defect types, and the distinction between defect types is obvious. For common type I defects such as printing misalignment and ghosting, the system can quickly identify them through the difference in distance ratios and extract and classify the possible defect areas; for type II defects such as stains, broken lines, and blisters, the system can still accurately judge the defect type through the comparison of similarity 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 unobvious problems in complex images, the system can accurately identify and mark potential problem areas through fine calculations, ensuring the comprehensiveness and accuracy of printed matter quality detection. This technical solution realizes the precise identification and intelligent classification of printed matter defects by introducing multi-dimensional ratio calculation, 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.
[0166] It should be noted that avoiding printing defects by controlling the speed of the roll printing machine is an effective quality control strategy. The printing quality of the roll printing machine is closely related to the operating speed of the equipment. Too fast or too slow speed may lead to the occurrence of printing defects. In order to optimize the printing quality and reduce defects, the following aspects need to be considered:
[0167] During the printing process of the roll printing machine, the fluidity and drying speed of the printing slurry are crucial for the final printing effect. If the speed of the roll printing machine is too fast, the slurry may not have enough time to be evenly coated, resulting in blurred, missing or incomplete patterns. If the speed is too slow, the slurry may dry prematurely or adhere to the roller, thus affecting the printing quality.
[0168] For different types of slurries (such as ceramic slurries, electrode slurries, etc.), their fluidity, adhesion and drying rates are different. Therefore, the printing speed must be adjusted according to the characteristics of the slurry. For example, slurries containing higher viscosity components need to appropriately reduce the printing speed to ensure that the slurry can be evenly transferred and will not clump or dry out.
[0169] The printing accuracy of the roll printing machine 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 slurry may not be fully imprinted on the substrate surface, resulting in unclear or misaligned patterns. In addition, vibrations of the substrate during the printing process may also be caused by too fast a speed, resulting in pattern deviation or unevenness.
[0170] Although too slow a speed can ensure a longer contact time, it may bring problems such as slurry accumulation, excessive printing slurry buildup, and even overflow or printing overlap. Too slow a speed may also lead to a reduction in the production efficiency of the equipment, increasing production costs and cycle times.
[0171] Substrates of different thicknesses have different requirements for the printing speed. For example, thinner substrates may require a lower speed to avoid deformation or damage to the substrate due to excessive pressure during printing. For thicker substrates, the speed can be appropriately increased, but still needs to be controlled within a reasonable range to avoid blurred or missing patterns.
[0172] 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 volatilize too fast, and even cause cracks in the printed pattern. Therefore, reasonably controlling the matching between the speed and the temperature can reduce printing defects caused by temperature changes.
[0173] In actual production, the speed of the roller printing machine usually needs to be dynamically adjusted according to real-time monitoring feedback. For example, an image recognition system is used to monitor the printing quality in real time. When it is found that the pattern is unclear or irregular, the printing speed is automatically adjusted to avoid the spread of defects.
[0174] For different types or sizes of MLCC products, their requirements for pattern accuracy are different, and the printing machine 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.
[0175] 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. Combining factors such as temperature, humidity, and slurry viscosity, the system can dynamically optimize the printing process and reduce printing defects caused by improper speed.
[0176] In the initial stage of production, the speed of the roller printing machine can be relatively low to ensure uniform coating of the slurry and avoid uneven coating. As production stabilizes, the speed is gradually increased to improve production efficiency while ensuring quality. Especially when the production cycle is long, gradually accelerating or decelerating can better avoid the impact of sudden speed changes on pattern accuracy.
[0177] In this embodiment, the solution first collects the image to be recognized and the target printed image data through a camera, and extracts multiple target pixel value regions in the target printed image. Since the target pixel value regions are divided based on the consistency of pixel values, the target image can be effectively compared with the image to be recognized, greatly improving 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 regions in the target printed image. The calculation of these first midpoints provides an accurate benchmark for subsequent defect detection, enabling more accurate comparison and detection of possible defect regions in the image to be recognized. According to the pixel value range corresponding to the target pixel value region, the pixel value range region corresponding to the image to be recognized is extracted. By setting preset conditions (such as the pixel point number condition), the detection range of the image to be recognized can be flexibly controlled, further improving the accuracy and adaptability of detection. During the detection process, by calculating the second midpoints of the pixel value regions to be recognized and the second distances between the second midpoints, the further confirmation and determination of the defect regions in the image to be recognized are realized. If the pixel value region of the image to be recognized meets the preset conditions, possible printing defects can be efficiently recognized. This method has a high fault tolerance and can achieve high-precision defect recognition in a variety of complex printed products. The technical solution of the present technology performs defect detection based on the distance calculation of pixel value regions, which can effectively reduce the errors caused by light changes, image noise, or uneven printing quality, thereby improving the 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, the technical solution of the present technology effectively improves the efficiency and accuracy of printing defect detection, can not only reduce manual intervention, but also adapt to the detection requirements of different printed products.
[0178] Such as Figure 2 The present invention provides a defect detection device for a roller printing machine. Please refer to Figure 2 , Figure 2 which shows a schematic diagram of a defect detection device for a roller printing machine provided by the present invention. Such as Figure 2 shown, a defect detection device for a roller printing machine includes:
[0179] An acquisition unit 21, configured to acquire the image to be recognized and the target printed image data collected by a camera; the target printed image data refers to the design drawing data printed on a product;
[0180] A first extraction unit 22, configured to extract multiple target pixel value regions from the target printed image data; the target pixel value region refers to an image region composed of the same pixel values;
[0181] The first calculation unit 23 is configured to calculate the first midpoints of the multiple target pixel value regions and calculate the first distances between the multiple first midpoints;
[0182] The second extraction unit 24 is configured to extract, according to the pixel value ranges corresponding to the target pixel value regions, multiple to-be-identified pixel regions corresponding to the respective pixel value ranges in the to-be-identified image;
[0183] The second calculation unit 25 is configured to calculate the second midpoints of the multiple to-be-identified pixel value regions and calculate the second distances between the multiple second midpoints if the to-be-identified pixel value regions meet a preset condition; the preset condition includes that a second pixel value difference between the to-be-identified pixel value region and the target pixel value region is less than a second threshold;
[0184] The determination unit 26 is configured to determine whether there are defects in the printed matter in the to-be-identified image according to the first distance and the second distance.
[0185] A defect detection device for a roller printing machine provided by the present invention. This solution first collects the data of the to-be-identified image 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 regions are divided based on the consistency of pixel values, the target image and the to-be-identified image can be effectively compared, greatly improving the efficiency and accuracy of image processing. By calculating the first midpoints of the multiple target pixel value regions and the first distances therebetween, this technology can accurately locate the feature regions in the target printed image. The calculation of these first midpoints provides an accurate benchmark for subsequent defect detection, enabling more accurate comparison and detection of possible defect regions in the to-be-identified image. According to the pixel value ranges corresponding to the target pixel value regions, the pixel value range regions corresponding thereto in the to-be-identified image are extracted. By setting preset conditions (such as the pixel point quantity condition), the detection range of the to-be-identified image can be flexibly controlled, further improving the accuracy and adaptability of detection. During the detection process, by calculating the second midpoints of the to-be-identified pixel value regions and the second distances between the second midpoints, further confirmation and determination of the defect regions in the to-be-identified image are achieved. If the pixel value regions of the to-be-identified image meet the preset conditions, possible printing defects can be efficiently identified. This method has a high fault tolerance and can achieve high-precision defect identification in a variety of complex printed matters. This technical solution performs defect detection based on the distance calculation of pixel value regions, which can effectively reduce the errors caused by light changes, image noise, or uneven printing quality, thereby improving the 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, can not only reduce manual intervention but also adapt to the detection requirements of different printed matters.
[0186] Figure 3 This is a schematic diagram of a roller printing machine provided by an embodiment of the present invention. As Figure 3 shown, a roller printing machine 3 in 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 in the above-mentioned embodiments of the defect detection method for each roller printing machine are implemented, such as Figure 1 the steps 101 to 106 shown. Alternatively, when the processor 30 executes the computer program 32, the functions of each unit in the above-mentioned device embodiments are implemented, such as Figure 2 the functions of the units shown.
[0187] Exemplarily, the computer program 32 can be divided into one or more units. The one or more units are stored in the memory 31 and executed by the processor 30 to complete the present invention. The one or more units can be a series of computer program instruction segments capable of performing specific functions, and these instruction segments are used to describe the execution process of the computer program 32 in the roller printing machine 3. For example, the specific functions of the computer program 32 divided into each unit are as follows:
[0188] An acquisition unit, configured to acquire a to-be-recognized image collected by the camera and target printing image data; the target printing image data refers to the design drawing data printed on the product;
[0189] A first extraction unit, configured 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 values;
[0190] A first calculation unit, configured to calculate a first midpoint of the plurality of target pixel value regions and calculate a first distance between the plurality of first midpoints;
[0191] A second extraction unit, configured to extract a plurality of to-be-recognized pixel regions corresponding to respective pixel value ranges in the to-be-recognized image according to the pixel value ranges corresponding to the target pixel value regions;
[0192] A second calculation unit, configured to calculate a second midpoint of the plurality of to-be-recognized pixel value regions and calculate a second distance between the plurality of second midpoints if the to-be-recognized pixel value region meets a preset condition; the preset condition includes that a second pixel value difference between the to-be-recognized pixel value region and the target pixel value region is less than a second threshold;
[0193] A determination unit, configured to determine whether there is a defect in the printed matter in the image to be recognized according to the first distance and the second distance.
[0194] The roll printer includes, but is not limited to, a processor 30 and a memory 31. Those skilled in the art can understand that Figure 3 This is merely an example of a roll printer 3 and does not constitute a limitation on a roll printer 3. It may include more or fewer components than shown in the figure, or combine certain components, or different components. For example, the roll printer may further include an input / output device, a network access device, a bus, etc.
[0195] The processor 30 may be a central processing unit (CPU), or may also be other general-purpose processors, digital signal processors (DSPs), application specific integrated circuits (ASICs), field-programmable gate arrays (FPGAs), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. The general-purpose processor may be a microprocessor or the processor may also be any conventional processor, etc.
[0196] The memory 31 may be an internal storage unit of the roll printer 3, such as a hard disk or memory of the roll printer 3. The memory 31 may also be an external storage device of the roll printer 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 roll printer 3. Further, the memory 31 may also include both the internal storage unit of the roll printer 3 and the external storage device. The memory 31 is used to store the computer program and other programs and data required for the defect detection method of the roll printer. The memory 31 may also be used to temporarily store the data that has been output or will be output.
[0197] It should be understood that the magnitudes of the sequence numbers of the steps in the above embodiments do not mean the order of execution. The order of execution of each process should be determined according to its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of the present invention.
[0198] It should be noted that for the content such as information interaction and execution process among the above-mentioned devices / units, since it is based on the same concept as the method embodiment of the present invention, for its specific functions and the technical effects brought, reference can be specifically made to the method embodiment part, and details are not described herein again.
[0199] Those skilled in the art can clearly understand that for the convenience and conciseness of description, only the above-mentioned division of each functional unit and module is used as an example for illustration. In practical applications, the above functions can be allocated to different functional units and modules according to needs, that is, the internal structure of the device is divided into different functional units or modules to complete all or part of the functions described above. Each functional unit and module in the embodiment can be integrated in a processing unit, or each unit can exist physically alone, or two or more units can be integrated in one unit. The above integrated unit can be implemented in the form of hardware or in the form of a software functional unit. In addition, the specific names of each functional unit and module are only for the convenience of mutual distinction and do not limit the protection scope of the present invention. The specific working process of the units and modules in the above system can refer to the corresponding process in the foregoing method embodiment, and details are not described herein again.
[0200] The embodiment of the present invention also provides a computer-readable storage medium, which stores a computer program. When the computer program is executed by a processor, the steps in each of the above method embodiments can be implemented.
[0201] The embodiment of the present invention provides a computer program product. When the computer program product runs on a mobile terminal, the mobile terminal can be caused to execute the steps in each of the above method embodiments.
[0202] When 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, to implement all or part of the processes in the above-described embodiment methods of the present invention, a computer program can be used to instruct relevant hardware to complete. The computer program can be stored in a computer-readable storage medium. When the computer program is executed by a processor, the steps of the above-described various method embodiments can be implemented. Among them, the computer program includes computer program code, and the computer program code can be in the form of source code, object code, executable file, or some intermediate form, etc. The computer-readable medium can at least include: any entity or device that can carry the computer program code to the photographing device / roller printing machine, recording medium, computer memory, read-only memory (ROM), random access memory (RAM), electrical carrier signal, telecommunication signal, and software distribution medium. For example, a USB flash drive, a mobile hard disk, a magnetic disk, or an optical disc, etc.
[0203] In the above embodiments, the descriptions of the various embodiments have their own focuses. For the parts not detailed or recorded in a certain embodiment, reference can be made to the relevant descriptions of other embodiments.
[0204] Those of ordinary skill in the art can realize that the units and algorithm steps of the examples described in combination with the embodiments disclosed herein can be implemented by electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are executed in a hardware or software manner depends on the specific application and design constraints of the technical solution. A professional technician can use different methods to implement the described functions for each specific application, but such implementation should not be considered to exceed the scope of the present invention.
[0205] In the embodiments provided by the present invention, it should be understood that the disclosed device / network device and method can be implemented in other ways. For example, the device / network device embodiments described above are merely illustrative. For example, the division of the modules or units is only a logical function division. In actual implementation, there can be other division methods. For example, 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 displayed or discussed couplings or direct couplings or communication connections to each other can be through some interfaces. The indirect couplings or communication connections of the devices or units can be in electrical, mechanical, or other forms.
[0206] The units described as separate components may or may not be physically separated. The components shown as units may or may not be physical units. They can be located in one place or distributed to multiple network units.
[0207] It should be understood that when used in the specification of the present invention and the appended claims, the term "comprising" indicates the presence of the described features, wholes, steps, operations, elements and / or components, but does not exclude the presence or addition of one or more other features, wholes, steps, operations, elements, components and / or their combinations.
[0208] It should also be understood that the term "and / or" used in the specification of the present invention and the appended claims refers to any combination and all possible combinations of one or more of the associated listed items, and includes these combinations.
[0209] As used in the specification of the present invention and the appended claims, the term "if" can be interpreted as "when", "once", "in response to determining", or "in response to detecting" depending on the context. Similarly, the phrases "if determined" or "if [the described condition or event] is detected" can be interpreted as meaning "once determined", "in response to determining", "once [the described condition or event] is detected", or "in response to detecting [the described condition or event]" depending on the context.
[0210] In addition, in the description of the specification of the present invention and the appended claims, the terms "first", "second", "third", etc. are only used for distinguishing descriptions and cannot be understood as indicating or implying relative importance.
[0211] Reference to "one embodiment" or "some embodiments" or the like described in the specification of the present invention means that a specific feature, structure, or characteristic described in connection with that embodiment is included in one or more embodiments of the present invention. Thus, statements such as "in one embodiment", "in some embodiments", "in other some embodiments", "in still other embodiments", etc. that appear in different places in this specification do not necessarily all refer to the same embodiment, but mean "one or more but not all embodiments", unless otherwise specifically emphasized in another way. The terms "comprising", "including", "having" and their variants all mean "including but not limited to", unless otherwise specifically emphasized in another way.
[0212] The above-described embodiments are only used to illustrate the technical solutions of the present invention and are not intended to limit them; although the present invention has been described in detail with reference to the foregoing embodiments, those of ordinary skill in the art should understand that they can still modify the technical solutions recorded in the foregoing embodiments, or perform equivalent replacements for some of the technical features; and these modifications or replacements do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the various 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 the pixel value areas to be identified corresponding to the plurality of 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; 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 does not have a printing defect; 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 to-be-identified pixel value region and the target pixel value region; If the similarity is greater than a fourth threshold, confirming that the printed product has no printing defects; 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.
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 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.
7. 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 value 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 calculate a first distance ratio between multiple first distances; calculate a second distance ratio between multiple second distances; calculate a second difference between the first distance ratio and the second distance ratio; if multiple second differences are all less than a third threshold, it is confirmed that there is no printing defect in the printed product; if the second difference is not less than the third threshold, it is confirmed that there is a type of printing defect in the printed product, 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, uneven printing or printing ink drag; obtain a target pixel value area corresponding to the pixel value area to be identified; calculate the similarity between the pixel value area to be identified and the target pixel value area; if the similarity is greater than a fourth threshold, it is confirmed that there is no printing defect in the printed product; if the similarity is not greater than the fourth threshold, it is determined that there are two types of printing defects in the printed product in the image to be identified; the two types of printing defects include printing stains, printing line breaks and printing bubbles.
8. 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 6.
9. 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 6 are implemented.
Citation Information
Patent Citations
Printing defect detection method based on machine vision
CN117705815A
Product defect detection method, device and system
WO2021017725A1