Flight ink droplet volume measurement method, device and equipment and storage medium
By filtering and gradient processing of the flying ink drop images, edge features are extracted and segmented using an external rectangle algorithm and adaptive threshold, the accuracy and adaptability problems of flying ink drop volume measurement in the prior art are solved, and efficient and accurate ink droplet detection and measurement are achieved.
Patent Information
- Application Number
- CN202411883154.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-19
- Publication Date
- 2025-04-11
- Estimated Expiration
- 2044-12-19
AI Technical Summary
The prior art is difficult to accurately identify and measure the volume of flying ink droplets, especially when the shape changes, uneven grayscale and are affected by factors such as light and speed.
By obtaining the ink drop image from the camera, performing filtering processing and gradient calculation, edge features are extracted and the image is segmented based on the external rectangle algorithm and adaptive threshold value, and the ink drop volume is calculated.
It improves the accuracy and adaptability of flying ink droplet detection, can effectively deal with the problems of ink droplet shape changes and grayscale unevenness, reduces the need for labeled data, is suitable for real-time application scenarios, and avoids the black box properties of deep learning models.
Smart Images

Figure CN119810061A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of ink drop volume measurement, and in particular to a flying ink drop volume measurement method, device, equipment and storage medium. Background Art
[0002] In modern industrial production, the detection and measurement of flying ink droplets are crucial, especially in the fields of inkjet printing, spraying, and atomization, where precise control directly affects production quality and effect. However, the detection of flying ink droplets faces many challenges. Due to their small size, large shape changes, and the influence of factors such as light and speed, they are difficult to effectively distinguish in image processing. Traditional image processing technologies, such as threshold-based image segmentation methods, are difficult to cope with these changes and uncertainties. The volume and shape recognition of ink droplets is a key link in automated production lines. Accurately identifying the volume of ink droplets can improve production efficiency and ensure output quality. In the existing technology, threshold segmentation cannot effectively deal with the problems of ink droplet shape changes and grayscale unevenness, and the recognition effect is poor in high dynamic range images. Although deep learning technology has emerged, it has application potential in image segmentation. It can automatically learn ink droplet features and avoid the trouble of manually setting thresholds. However, it also faces problems, such as the need for a large amount of labeled data for training, and high requirements for ink droplet image acquisition and labeling; the training and inference process is computationally intensive, with high hardware requirements, and is not suitable for scenarios with high real-time requirements; and the black box nature of the model makes it difficult to explain the decision-making process in actual deployment, which brings difficulties to subsequent debugging and optimization. Summary of the invention
[0003] In order to solve the above-mentioned shortcomings in the prior art, the present invention proposes a flying ink drop volume measurement method, device, equipment and storage medium.
[0004] In order to solve the above technical problems, the technical solution adopted by the present invention is as follows:
[0005] A method for measuring the volume of flying ink droplets, comprising: acquiring an ink droplet image from a camera, and filtering the ink droplet image to obtain a filtered image; performing gradient calculation on the filtered image based on a preset gradient operation formula to obtain a gradient image; extracting edge features from the gradient image; performing region division on the gradient image based on the edge features to obtain two outer edge regions; performing a segmentation operation on the gradient image based on a preset circumscribed rectangle algorithm, a preset adjustment function and two outer edge regions to obtain two flying ink droplet regions; calculating the volume of ink droplets in the two outer edge regions based on the two outer edge regions, the edge features, the two flying ink droplet regions and the gradient image; and calculating the average value of the two ink droplet volumes to obtain the volume of flying ink droplets. The gradient image is obtained by calculating the gradient after filtering the ink drop image, which can effectively reduce the noise interference in the image, improve the accuracy of subsequent edge feature extraction, avoid misjudgment and missed judgment caused by noise and other factors, and thus improve the accuracy of the detection result; the region is divided based on the edge feature to obtain two outer edge regions, taking into account the various actual conditions of the ink droplets, and more effectively detect and measure the flying ink droplets with small volume, large shape changes, and affected by factors such as light and speed; the flying ink drop region is obtained by segmenting the gradient image through the circumscribed rectangle algorithm, adjustment function and two outer edge regions; it can effectively deal with the problems of ink drop shape change and grayscale unevenness. This solution can more accurately identify ink droplets of different shapes and grayscale distributions through innovative segmentation methods. It provides strong support for the recognition of ink droplet volume and shape in automated production lines, thereby improving production efficiency and ensuring output quality. Compared with deep learning methods, this solution does not require a large amount of labeled data for model training, which reduces the requirements for ink droplet image acquisition and annotation, saving time and labor costs. The calculation process is relatively simple, without the huge amount of calculation in the deep learning model training and reasoning process, and has lower hardware requirements, which is more suitable for application scenarios with high real-time requirements. At the same time, it also avoids the problems of difficult to explain decision-making processes and debugging and optimization difficulties caused by the black box nature of deep learning models. In summary, this solution can effectively improve the accuracy, adaptability and real-time performance of flying ink droplet detection, and provide more reliable ink droplet detection technology support for inkjet printing, spraying, and spraying in industrial production.
[0006] Further, the segmentation operation of the gradient image based on the preset circumscribed rectangle algorithm, the preset adjustment function and the two outer edge regions to obtain two flying ink drop regions includes: using the circumscribed rectangle algorithm to analyze the two outer edge regions to obtain two ink drop rectangular frames; calculating the first connection set and the second connection set according to the two outer edge regions and the two ink drop rectangular frames; setting the adaptive threshold of each first connection line in the first connection set according to the two ink drop rectangular frames, the preset adjustment function and the second connection set; segmenting the gradient image based on the two outer edge regions and each adaptive threshold to obtain two flying ink drop regions. The ink drop rectangular frame obtained by the circumscribed rectangle algorithm can accurately define the ink drop range; calculating the first and second connection sets and setting the adaptive threshold can better adapt to different ink drop situations in practical applications and effectively deal with the diversity of ink droplets; segmenting the gradient image based on the outer edge region and the adaptive threshold to obtain the flying ink drop region improves the detection accuracy and adaptability; compared with the traditional method, this embodiment can better adapt to complex situations, such as changes in illumination, changes in ink drop shape, etc., and provide more reliable ink drop detection technology support for inkjet and other fields in industrial production.
[0007] Furthermore, the use of a preset circumscribed rectangle algorithm to analyze the two outer edge regions to obtain two ink droplet rectangular frames includes: extracting outer boundary features of the two outer edge regions; and using a circumscribed rectangle algorithm to analyze the outer boundary features to obtain two ink droplet rectangular frames. Firstly, the outer boundary features of the outer edge regions are extracted to accurately grasp the edge conditions of the ink droplets; and then the circumscribed rectangle algorithm is used to obtain the ink droplet rectangular frame, which can accurately define the range of the ink droplets, provide an accurate basis for subsequent ink droplet detection and analysis, and improve detection accuracy and efficiency.
[0008] Furthermore, the method of calculating the first line set and the second line set based on the two outer edge areas and the two ink drop rectangular frames includes: obtaining the coordinates of the four vertices of the two ink drop rectangular frames to obtain the first coordinate set; calculating the center points of the two ink drop rectangular frames based on the first coordinate set and the circumscribed rectangle algorithm; obtaining all edge pixel points of the two outer edge areas to obtain an edge pixel point set; calculating the line between each edge pixel point in the edge pixel point set and its corresponding center point to obtain the first line set; dividing the two outer edge areas according to edge features to obtain two inner boundary areas; calculating the intersection of each first line in the first line set and its corresponding inner boundary area to obtain an intersection point set; and calculating the second line set based on the edge pixel point set, the intersection point set and the first line set. By obtaining the coordinates of the four vertices of the ink droplet rectangle and calculating the center point, a key reference point is provided for subsequent analysis; then, the edge pixel point set is obtained and the line connecting the edge pixel point and the center point is calculated, which can accurately reflect the relationship between the edge pixel point and the center point; the two outer edge areas are divided into regions to obtain the inner boundary area, which helps to analyze the ink droplet characteristics more finely; the intersection of the first line and the inner boundary area is calculated and the second line set is obtained, which further enriches the description of the ink droplet; overall, the morphology and characteristics of the ink droplets can be analyzed more comprehensively and accurately, providing more reliable data support for flying ink droplet detection, improving the accuracy and adaptability of detection, and being suitable for various complex industrial production scenarios, such as inkjet printing, spraying and other fields.
[0009] Furthermore, the method of setting the adaptive threshold of each first link in the first link set according to the two ink drop rectangular frames, the preset adjustment function and the second link set includes: calculating the line connecting the center points of the two ink drop rectangular frames to obtain the third link; calculating the angles between all the first links and the third lines in the first link set to obtain the angle set; obtaining the pixel point set of all the second links in the second link set; sorting and counting each pixel point set to obtain the gray value sequence set; calculating the median of each gray value sequence in the gray value sequence set to obtain the basic threshold set; and calculating the adaptive threshold of each first link according to the basic threshold set, the angle set and the adjustment function. The third line is obtained by calculating the line connecting the center points of the two ink droplet rectangular frames, and then the angle between the first line and the third line is calculated, providing angle information for subsequent analysis; the pixel point set of the second line is obtained and sorted and statistically obtained to obtain a gray value sequence set, and then the median is calculated to obtain a basic threshold set, and the adaptive threshold of each first line is calculated in combination with the angle set and the adjustment function. This method can dynamically adjust the threshold according to the specific characteristics of the ink droplet; compared with the traditional fixed threshold method, it can better adapt to complex situations such as the shape, size, and lighting of different ink droplets, improve the accuracy and adaptability of flying ink droplet detection, and provide more reliable technical support for inkjet printing, spraying and other fields in industrial production, which helps to improve production quality and efficiency.
[0010] Furthermore, the segmentation operation of the gradient image based on the two outer edge areas and each adaptive threshold to obtain two flying ink drop areas includes: obtaining the gray value of each pixel in the two outer edge areas, and comparing each gray value with the adaptive threshold of the first connecting line corresponding to it to obtain a comparison result; analyzing the comparison result; when the comparison result shows that there is a gray value greater than the adaptive threshold of the first connecting line corresponding to it, the pixel whose gray value is greater than the adaptive threshold of the first connecting line corresponding to it is set as the ink drop pixel point to obtain the ink drop pixel point set; otherwise, the pixel whose gray value is less than the adaptive threshold of the first connecting line corresponding to it is set as the background pixel point to obtain the background pixel point set; the gradient image is segmented according to the ink drop pixel point set and the background pixel point set to obtain two flying ink drop areas. By obtaining the gray value of each pixel in the outer edge area and comparing it with the adaptive threshold of the corresponding first connecting line, accurate classification of the pixels is achieved; this method can dynamically adjust the judgment standard according to the actual situation of the ink drop, and effectively deal with the changes of different ink droplets under complex conditions such as lighting and shape. When the grayscale value is greater than the adaptive threshold, it is determined as an ink droplet pixel, otherwise it is determined as a background pixel, which accurately distinguishes the ink droplet from the background and improves the accuracy of segmentation; the two flying ink droplet areas finally obtained provide accurate basic data for subsequent ink droplet detection and analysis; it has important application value in the fields of inkjet printing and spraying in industrial production, can improve production quality and efficiency, adapt to various complex production environments, and provides a reliable and efficient method for flying ink droplet detection.
[0011] Furthermore, the method of calculating the volume of ink droplets in the two outer edge areas based on the two outer edge areas, edge features, two flying ink droplet areas and gradient images includes: calculating the depth information of all pixel points of the two outer edge areas based on a preset stereo matching algorithm to obtain a depth information set; analyzing the gradient image based on the stereo matching algorithm to obtain the resolution of the gradient image; obtaining the internal and external parameters of the camera from the camera, and converting each depth information in the depth information set into a three-dimensional coordinate according to the internal and external parameters and the resolution to obtain a three-dimensional coordinate set; identifying the gradient image based on the two flying ink droplet areas and the edge features to obtain two ink droplet contours; and performing volume calculation on the two ink droplet contours based on a preset approximate geometric model and a three-dimensional coordinate set to obtain the volume of ink droplets in the two outer edge areas. The preset stereo matching algorithm is used to obtain pixel depth information, which is then converted into three-dimensional coordinates based on the internal and external parameters and resolution of the camera, achieving effective expansion from two-dimensional to three-dimensional, making ink drop analysis more in line with actual spatial conditions; the ink drop outline is obtained by recognizing the gradient image, and the ink drop volume is calculated using an approximate geometric model and a set of three-dimensional coordinates, making the volume calculation more accurate; overall, the spatial characteristics and edge characteristics of the ink droplets can be fully considered, improving the accuracy of the ink drop volume calculation, and providing reliable and valuable data support for ink drop detection and other links in related industrial production.
[0012] Furthermore, a flying ink drop volume measurement device includes: a filtered image calculation module, which is used to obtain an ink drop image from a camera and filter the ink drop image to obtain a filtered image; a gradient image calculation module, which is used to perform gradient calculation on the filtered image based on a preset gradient operation formula to obtain a gradient image; a feature extraction module, which is used to extract edge features from the gradient image; an outer edge region division module, which is used to divide the gradient image into regions based on the edge features to obtain two outer edge regions; a segmentation operation module, which is used to perform a segmentation operation on the gradient image based on a preset circumscribed rectangle algorithm, a preset adjustment function and two outer edge regions to obtain two flying ink drop regions; an ink drop volume calculation module, which is used to calculate the ink drop volume in the two outer edge regions based on the two outer edge regions, the edge features, the two flying ink drop regions and the gradient image; and a flying ink drop volume calculation module, which is used to calculate the average value of the two ink drop volumes to obtain the flying ink drop volume. After filtering the ink droplet image, the gradient is calculated to reduce noise interference, improve the accuracy of edge feature extraction, and avoid misjudgment and missed judgment; the area is divided based on edge features, considering the actual situation of ink droplets, and effectively detecting ink droplets with small volume, large shape changes, and those affected by light, etc.; the flying ink droplet area is obtained by segmenting the image through the external rectangle algorithm, which can deal with the problems of ink droplet shape and grayscale; compared with the deep learning method, it does not require a large amount of labeled data, saves costs, is simple in calculation, is suitable for real-time scenarios, and avoids the black box problem. Overall, it improves the detection accuracy, adaptability, and real-time performance, providing reliable technical support for industrial production.
[0013] Furthermore, a flying ink drop volume measuring device is provided, the flying ink drop volume measuring device comprising: a memory and at least one processor, the memory storing instructions; at least one of the processors calls the instructions in the memory to enable the flying ink drop volume measuring device to perform each step of a flying ink drop volume measuring method as described in any one of the above items.
[0014] Furthermore, a computer-readable storage medium stores instructions, wherein the instructions, when executed by a processor, implement the various steps of a flying ink drop volume measurement method as described in any one of the above items.
[0015] The beneficial effects of the flying ink drop volume measurement method of the present invention are:
[0016] The gradient image is obtained by calculating the gradient after filtering the ink drop image, which can effectively reduce the noise interference in the image, improve the accuracy of subsequent edge feature extraction, avoid misjudgment and missed judgment caused by noise and other factors, and thus improve the accuracy of the detection result; the region is divided based on the edge feature to obtain two outer edge regions, taking into account the various actual conditions of the ink droplets, and more effectively detect and measure the flying ink droplets with small volume, large shape changes, and affected by factors such as light and speed; the flying ink drop region is obtained by segmenting the gradient image through the circumscribed rectangle algorithm, adjustment function and two outer edge regions; it can effectively deal with the problems of ink drop shape change and grayscale unevenness. This solution can more accurately identify ink droplets of different shapes and grayscale distributions through innovative segmentation methods. It provides strong support for the recognition of ink droplet volume and shape in automated production lines, thereby improving production efficiency and ensuring output quality. Compared with deep learning methods, this solution does not require a large amount of labeled data for model training, which reduces the requirements for ink droplet image acquisition and annotation, saving time and labor costs. The calculation process is relatively simple, without the huge amount of calculation in the deep learning model training and reasoning process, and has lower hardware requirements, which is more suitable for application scenarios with high real-time requirements. At the same time, it also avoids the problems of difficult to explain decision-making processes and debugging and optimization difficulties caused by the black box nature of deep learning models. In summary, this solution can effectively improve the accuracy, adaptability and real-time performance of flying ink droplet detection, and provide more reliable ink droplet detection technology support for inkjet printing, spraying, and spraying in industrial production. BRIEF DESCRIPTION OF THE DRAWINGS
[0017] Figure 1 A first flow chart of a flying ink drop volume measurement method provided by an embodiment of the present invention;
[0018] Figure 2A second flow chart of a flying ink drop volume measurement method provided by an embodiment of the present invention;
[0019] Figure 3 A third flow chart of a flying ink drop volume measurement method provided by an embodiment of the present invention;
[0020] Figure 4 A fourth flow chart of a flying ink drop volume measurement method provided by an embodiment of the present invention;
[0021] Figure 5 A fifth flow chart of a flying ink drop volume measurement method provided by an embodiment of the present invention;
[0022] Figure 6 A sixth flow chart of a flying ink drop volume measurement method provided by an embodiment of the present invention;
[0023] Figure 7 A seventh flow chart of a flying ink drop volume measurement method provided by an embodiment of the present invention;
[0024] Figure 8 A schematic structural diagram of a flying ink drop volume measurement device provided by an embodiment of the present invention;
[0025] Fig. 9 A schematic structural diagram of a flying ink drop volume measurement device provided in an embodiment of the present invention. DETAILED DESCRIPTION
[0026] The technical solution of the present invention will be described clearly and completely below in conjunction with the accompanying drawings. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0027] The terms "first", "second", "third", "fourth", etc. (if any) in the specification and claims of the present invention and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchanged where appropriate, so that the embodiments described herein can be implemented in an order other than that illustrated or described herein. In addition, the terms "including" or "having" and any variations thereof are intended to cover non-exclusive inclusions, for example, a process, method, system, product or device that includes a series of steps or units is not necessarily limited to those steps or units that are clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.
[0028] For ease of understanding, the specific process of the embodiment of the present invention is described below. Figure 1 , an embodiment of a flying ink drop volume measurement method in an embodiment of the present invention includes:
[0029] 101. Acquire an ink drop image from a camera, and perform filtering processing on the ink drop image to obtain a filtered image;
[0030] In this embodiment, first, multi-angle images captured by the binocular camera are acquired, and then Gaussian filtering and denoising are performed on these images to smooth the noise in the image and enhance the outline of the ink droplet. In this embodiment, only one image is processed, and the other image processing operations are the same and will not be described again. Assume that the input image is I(x, y), and the image after Gaussian filtering is Ismooth(x, y), which is expressed as:
[0031] Among them, G(i,j) is the Gaussian kernel function, and k is the radius of the filter window. The filtered image can remove background noise and improve the contrast of the ink drop area.
[0032] 102. Performing gradient calculation on the filtered image based on a preset gradient calculation formula to obtain a gradient image;
[0033] In this embodiment, the Sobel operator is used to calculate the gradient of the image, so as to obtain the edge information of the image. The formula for gradient calculation is: in, is the image pixel, and They are the pixel x direction and y direction respectively; the image gradient size calculation formula is:
[0034] The gradient image can clearly show the edge and outline of the ink droplet, where Gx is the gradient of the pixel in the x direction and Gy is the gradient of the pixel in the y direction.
[0035] 103. Extract edge features from gradient images;
[0036] In this embodiment, the same ink droplet at different times may appear in one image, which are denoted as I1 and I2. The outer edges and inner edges of I1 and I2 may be determined by a gradient image. The edge of the ink droplet may be located according to the change in the value of the gradient image.
[0037] 104. Divide the gradient image into regions based on edge features to obtain two outer edge regions;
[0038] In this embodiment, it is assumed that the edge features of the ink drop region have been extracted through the gradient image, and the outer edge regions of I1 and I2 are respectively recorded as E1 and E2;
[0039] 105. Perform a segmentation operation on the gradient image based on a preset bounding rectangle algorithm, a preset adjustment function and two outer edge regions to obtain two flying ink drop regions;
[0040] 106. Calculate the volumes of ink drops in the two outer edge regions based on the two outer edge regions, the edge features, the two flying ink drop regions, and the gradient image;
[0041] 107. Calculate the average of the volumes of the two ink droplets to obtain the volume of the flying ink droplet.
[0042] In this embodiment, the gradient image is obtained by filtering the ink drop image and then calculating the gradient, which can effectively reduce noise interference in the image, improve the accuracy of subsequent edge feature extraction, avoid misjudgment and missed judgment caused by factors such as noise, and thus improve the accuracy of the detection result; two outer edge regions are obtained by region division based on edge features, taking into account various actual conditions of ink droplets, and more effectively detecting and measuring flying ink droplets with small volume, large shape changes, and affected by factors such as light and speed; the flying ink drop region is obtained by segmenting the gradient image through the circumscribed rectangle algorithm, adjustment function and two outer edge regions; it can effectively deal with the problems of ink drop shape change and grayscale unevenness. This solution can more accurately identify ink droplets of different shapes and grayscale distributions through innovative segmentation methods. It provides strong support for the recognition of ink droplet volume and shape in automated production lines, thereby improving production efficiency and ensuring output quality. Compared with deep learning methods, this solution does not require a large amount of labeled data for model training, reduces the requirements for ink droplet image acquisition and annotation, and saves time and labor costs. The calculation process is relatively simple, without the huge amount of calculation in the deep learning model training and reasoning process, and has lower hardware requirements. It is more suitable for application scenarios with high real-time requirements. At the same time, it also avoids the problems of difficulty in explaining the decision-making process and debugging and optimization caused by the black box nature of the deep learning model. In summary, this solution can effectively improve the accuracy, adaptability and real-time performance of flying ink droplet detection, and provide more reliable ink droplet detection technology support for inkjet printing, spraying, and spraying in industrial production.
[0043] See also Figure 2 A second embodiment of a flying ink drop volume measurement method according to an embodiment of the present invention includes:
[0044] 201. Analyze two outer edge regions using a circumscribed rectangle algorithm to obtain two ink droplet rectangular frames;
[0045] 202. Calculate a first connection line set and a second connection line set according to two outer edge regions and two ink droplet rectangular frames;
[0046] 203. Setting an adaptive threshold of each first link in the first link set according to the two ink drop rectangular frames, the preset adjustment function and the second link set;
[0047] 204. Perform a segmentation operation on the gradient image based on the two outer edge regions and each adaptive threshold to obtain two flying ink drop regions.
[0048] In this embodiment, the ink droplet rectangular frame is obtained through the circumscribed rectangle algorithm, which can accurately frame the ink droplet range; the first and second connection line sets are calculated and the adaptive threshold is set, which can better adapt to different ink droplet situations in practical applications and effectively deal with the diversity of ink droplets; the gradient image is segmented based on the outer edge area and the adaptive threshold to obtain the flying ink droplet area, which improves the detection accuracy and adaptability; compared with the traditional method, this embodiment can better adapt to complex situations, such as changes in lighting, changes in ink droplet shape, etc., and provide more reliable ink droplet detection technology support for fields such as inkjet in industrial production.
[0049] See also Figure 3 A third embodiment of a flying ink drop volume measurement method according to an embodiment of the present invention includes:
[0050] 303. Extract outer boundary features of two outer edge regions;
[0051] 304. Analyze the outer boundary features using a circumscribed rectangle algorithm to obtain two ink droplet rectangular frames.
[0052] In this embodiment, the two outer edge regions E1 and E2 are processed using a circumscribed rectangle algorithm to obtain a minimum rectangular frame surrounding the ink droplet. By analyzing the outer boundary features of the two outer edge regions, the minimum rectangular frame surrounding the ink droplet is calculated, that is, the ink droplet rectangular frame in step 302.
[0053] First, the outer boundary features of the outer edge area are extracted to accurately grasp the edge conditions of the ink droplets; then the circumscribed rectangle algorithm is used to obtain the ink droplet rectangular frame, which can accurately frame the ink droplet range, provide an accurate basis for subsequent ink droplet detection and analysis, and improve detection accuracy and efficiency.
[0054] See also Figure 4 A fourth embodiment of a flying ink drop volume measurement method according to an embodiment of the present invention includes:
[0055] 401. Obtain the coordinates of four vertices of two ink droplet rectangular frames to obtain a first coordinate set;
[0056] 402. Calculate the center points of two ink droplet rectangular frames according to the first coordinate set and the circumscribed rectangle algorithm;
[0057] In this embodiment, assuming that the center points of the two ink droplet rectangular frames are center point O1 and center point O2, then center point O1 and center point O2 represent the positions of the ink droplets in the two shots, and center point O1 and center point O2 can be calculated by the following formula:
[0058]
[0059] Among them, x1, x2, y1, y2 and x3, x4, y3, y4 are the coordinates of the vertices on any diagonal line of the two ink drop rectangles respectively;
[0060] 403. Acquire all edge pixel points of two outer edge regions to obtain an edge pixel point set;
[0061] In this embodiment, the two outer edge regions E1 and E2 of the ink droplet can obtain all edge pixel points of the two outer edge regions to obtain a complete set of edge pixel points;
[0062] 404. Calculate the connection line between each edge pixel point in the edge pixel point set and its corresponding center point to obtain a first connection line set;
[0063] In this embodiment, assuming that the center points of the two ink droplet rectangular frames are O1 and O2 respectively, by connecting each edge pixel point S with the center point O1 or O2 of its corresponding ink droplet rectangular frame, a set of all edge pixel points and their corresponding center point O1 or O2 can be obtained, that is, the first connection line set obtained in step 404;
[0064] 405. Divide the two outer edge regions according to the edge features to obtain two inner boundary regions;
[0065] In this embodiment, it is assumed that the two outer edge regions E1 and E2 are divided into regions according to edge features to obtain inner edge regions I1 and I2, and the two inner edge regions are recorded as F1 and F2 respectively;
[0066] 406. Calculate the intersection of each first link in the first link set and its corresponding inner boundary area to obtain an intersection set;
[0067] In this embodiment, assuming that there is a first connecting line O1S or O2S, the connecting line can intersect with the edge of the corresponding inner edge region F1 or F2 to obtain an intersection point P1.
[0068] 407. Calculate a second link set according to the edge pixel point set, the intersection point set, and the first link set;
[0069] In this embodiment, the first line set includes a second line set, an edge pixel set and an intersection set; each second line, edge pixel and intersection in the first line set is in a one-to-one correspondence, so the second line set can be calculated by the edge pixel set, the intersection set and the first line set, and the second line set is the line between each edge pixel in the edge pixel set S and its corresponding intersection. By obtaining the four vertex coordinates of the ink droplet rectangular frame and calculating the center point, a key reference point is provided for subsequent analysis; then, the edge pixel set is obtained and the line with the center point is calculated, which can accurately reflect the relationship between the edge pixel point and the center point; the two outer edge areas are divided into regions to obtain the inner boundary area, which is helpful for more detailed analysis of the ink droplet characteristics; the intersection of the first line and the inner boundary area is calculated and the second line set is obtained, which further enriches the description of the ink droplet; on the whole, the morphology and characteristics of the ink droplet can be analyzed more comprehensively and accurately, providing more reliable data support for flying ink droplet detection, improving the accuracy and adaptability of detection, and being suitable for various complex industrial production scenarios, such as inkjet printing, spraying and other fields.
[0070] See also Figure 5 A fifth embodiment of a flying ink drop volume measurement method according to an embodiment of the present invention includes:
[0071] 501. Calculate the line connecting the center points of the two ink droplet rectangular frames to obtain a third line;
[0072] 502. Calculate the angles between all first lines and third lines in the first line set to obtain an angle set;
[0073] 503. Obtain a pixel point set of all second connection lines in the second connection line set;
[0074] 504. Sort and count each pixel point set to obtain a gray value sequence set;
[0075] In this embodiment, it is assumed that there is a second connecting line SP1. By counting each pixel point on SP1 and arranging all the pixel points on SP1 from large to small, it is recorded as {g1, g2, ... g n} to obtain a gray value sequence.
[0076] 505. Calculate the median of each gray value sequence in the gray value sequence set to obtain a basic threshold set;
[0077] 506. Calculate an adaptive threshold of each first link according to the basic threshold set, the angle set, and the adjustment function.
[0078] In this embodiment, an adaptive threshold may be set for each first connecting line in the outer edge area. The adaptive thresholds of the first connecting lines at different positions may be dynamically adjusted according to their corresponding basic thresholds, corresponding angles and adjustment functions. Assuming that there is a first connecting line O1S and a third connecting line O1O2, the angle a between them may be calculated based on O1S and O1O2, and an adaptive threshold may be set for the first connecting line O1S based on the angle a. The calculation formula of the adaptive threshold of the first connecting line O1S includes: Ta=T0·f(a), wherein T0 is the basic threshold of the first connecting line, and here is the gray value sequence {g1, g2, ...g n}, f(a) is an adjustment function about angle a, Thus, as the angle a increases, the threshold T a It will also increase;
[0079] In another embodiment, in addition to the method based on adaptive threshold segmentation, the following alternatives may also be considered:
[0080] Segmentation based on morphological processing: Enhance the target area through morphological operations such as dilation and erosion, and then segment the ink droplets through regional analysis;
[0081] Segmentation method based on image clustering: Use clustering algorithms (such as k-means) to group images to distinguish ink drops from the background.
[0082] The third line is obtained by calculating the line connecting the center points of the two ink droplet rectangular frames, and then the angle between the first line and the third line is calculated, providing angle information for subsequent analysis; the pixel point set of the second line is obtained and sorted and statistically obtained to obtain a gray value sequence set, and then the median is calculated to obtain a basic threshold set, and the adaptive threshold of each first line is calculated in combination with the angle set and the adjustment function. This method can dynamically adjust the threshold according to the specific characteristics of the ink droplet; compared with the traditional fixed threshold method, it can better adapt to complex situations such as the shape, size, and lighting of different ink droplets, improve the accuracy and adaptability of flying ink droplet detection, and provide more reliable technical support for inkjet printing, spraying and other fields in industrial production, which helps to improve production quality and efficiency.
[0083] See also Figure 6 A sixth embodiment of a flying ink drop volume measurement method according to an embodiment of the present invention includes:
[0084] 601. Obtain the grayscale value of each pixel in two outer edge regions, and compare each grayscale value with the adaptive threshold of the first connecting line corresponding thereto to obtain a comparison result;
[0085] 602. Analyze the comparison result;
[0086] 603. When the comparison result shows that there is a grayscale value greater than the adaptive threshold of the corresponding first connecting line, set the pixel point whose grayscale value is greater than the adaptive threshold of the corresponding first connecting line as an ink drop pixel point to obtain an ink drop pixel point set;
[0087] 604. Otherwise, set the pixel points whose grayscale values are less than the adaptive threshold of the corresponding first connecting line as background pixel points to obtain a background pixel point set;
[0088] In this embodiment, in each outer edge region, a comparison result can be obtained by comparing the gray value of each pixel with the adaptive threshold of the first connecting line corresponding thereto; and then, according to the comparison result, each pixel is determined to be an ink drop pixel or a background pixel;
[0089] 605. Segment the gradient image according to the ink droplet pixel point set and the background pixel point set to obtain two flying ink droplet regions.
[0090] By obtaining the grayscale value of each pixel in the outer edge area and comparing it with the corresponding adaptive threshold of the first connecting line, accurate classification of the pixels is achieved; this method can dynamically adjust the judgment criteria according to the actual situation of the ink droplets, and effectively deal with the changes of different ink droplets under complex conditions such as lighting and shape. When the grayscale value is greater than the adaptive threshold, it is determined as an ink droplet pixel, otherwise it is determined as a background pixel, which accurately distinguishes the ink droplet from the background and improves the accuracy of segmentation; the two flying ink droplet areas finally obtained provide accurate basic data for subsequent ink droplet detection and analysis; it has important application value in the fields of inkjet printing and spraying in industrial production, can improve production quality and efficiency, adapt to various complex production environments, and provide a reliable and efficient method for flying ink droplet detection.
[0091] See also Figure 7 A seventh embodiment of a flying ink drop volume measurement method according to an embodiment of the present invention includes:
[0092] 701. Calculate depth information of all pixels in two outer edge regions based on a preset stereo matching algorithm to obtain a depth information set;
[0093] 702. Analyze the gradient image based on a stereo matching algorithm to obtain a resolution of the gradient image;
[0094] 703. Obtaining intrinsic and extrinsic parameters from the camera, and converting each depth information in the depth information set into a three-dimensional coordinate according to the intrinsic and extrinsic parameters and the resolution, so as to obtain a three-dimensional coordinate set;
[0095] 704. Recognize the gradient image based on the two flying ink drop regions and edge features to obtain two ink drop contours;
[0096] In this embodiment, the contour of the ink drop in the gradient image is identified by using the edge detection and region division results;
[0097] 705. Perform volume calculation on the two ink droplet contours based on a preset approximate geometric model and a three-dimensional coordinate set to obtain the volumes of the ink droplets in the two outer edge regions.
[0098] In this embodiment, the calculation of the ink drop volume can be achieved by using an approximate geometric model, such as an ellipsoid model or an irregularly shaped three-dimensional grid, to estimate the volume of the ink drop;
[0099] In this embodiment, in order to perform three-dimensional reconstruction of the volume of ink droplets in a gradient image based on a gradient image taken by a binocular camera, a preset stereo matching algorithm is used to obtain pixel depth information, which is converted into three-dimensional coordinates in combination with internal and external parameters and resolution of the camera, thereby achieving effective expansion from two-dimensional to three-dimensional, and making ink droplet analysis more in line with actual spatial conditions; the outline of ink droplets is obtained by recognizing the gradient image, and the volume of ink droplets is calculated using an approximate geometric model and a set of three-dimensional coordinates, making the volume calculation more accurate; overall, the spatial characteristics and edge characteristics of ink droplets can be fully considered, thereby improving the accuracy of ink droplet volume calculation, and providing reliable and valuable data support for ink droplet detection and other links in related industrial production.
[0100] A flying ink drop volume measurement method according to an embodiment of the present invention is described above. A flying ink drop volume measurement device according to an embodiment of the present invention is described below. Figure 8 In one embodiment of the present invention, a flying ink drop volume measuring device comprises:
[0101] A flying ink drop volume measuring device, comprising:
[0102] The filter image calculation module 1 is used to obtain the ink drop image from the camera and perform filtering on the ink drop image to obtain a filtered image;
[0103] A gradient image calculation module 2 is used to perform gradient calculation on the filtered image based on a preset gradient calculation formula to obtain a gradient image;
[0104] Feature extraction module 3, used to extract edge features from the gradient image;
[0105] The outer edge region division module 4 is used to divide the gradient image into regions based on edge features to obtain two outer edge regions;
[0106] A segmentation operation module 5, used for performing a segmentation operation on the gradient image based on a preset bounding rectangle algorithm, a preset adjustment function and two outer edge regions to obtain two flying ink drop regions;
[0107] An ink drop volume calculation module 6, used for calculating the ink drop volumes in the two outer edge regions based on the two outer edge regions, the edge features, the two flying ink drop regions and the gradient image;
[0108] The flying ink drop volume calculation module 7 is used to calculate the average value of the two ink drop volumes to obtain the flying ink drop volume.
[0109] In this embodiment, the gradient is calculated after filtering the ink droplet image to reduce noise interference, improve the accuracy of edge feature extraction, and avoid misjudgment and missed judgment; the area is divided based on the edge features, considering the actual situation of the ink droplets, and effectively detects ink droplets with small volume, large shape changes, and those affected by light, etc.; the flying ink droplet area is obtained by segmenting the image through the circumscribed rectangle algorithm, which can deal with the ink droplet shape and grayscale problems; compared with the deep learning method, it does not require a large amount of labeled data, saves costs, is simple in calculation, is suitable for real-time scenarios, and avoids the black box problem. Overall, the detection accuracy, adaptability and real-time performance are improved, providing reliable technical support for industrial production.
[0110] Fig. 9 1 is a schematic diagram of the structure of a flying ink drop volume measurement device provided by an embodiment of the present invention. The flying ink drop volume measurement device 800 may have relatively large differences due to different configurations or performances, and may include one or more processors (central processing units, CPU) 813 (for example, one or more processors) and a memory 820, and one or more storage media 830 (for example, one or more mass storage devices) storing application programs 833 or data 832. Among them, the memory 820 and the storage medium 830 can be short-term storage or permanent storage. The program stored in the storage medium 830 may include one or more modules (not shown in the figure), and each module may include a series of instruction operations in the flying ink drop volume measurement device 800. Furthermore, the processor 610 can be configured to communicate with the storage medium 830, and execute a series of instruction operations in the storage medium 830 on the flying ink drop volume measurement device 800 to implement the steps of a flying ink drop volume measurement method provided by the above-mentioned method embodiments.
[0111] The flying ink drop volume measurement device 800 may also include one or more power supplies 840, one or more wired or wireless network interfaces 850, one or more input and output interfaces 860, and / or one or more operating systems 831, such as Windows Serve, Mac OS X, Unix, Linux, FreeBSD, etc. It will be appreciated by those skilled in the art that Fig. 9 The structure of the flying ink drop volume measurement device shown does not constitute a limitation of a flying ink drop volume measurement device, and may include more or less components than shown in the figure, or combine certain components, or arrange the components differently.
[0112] The present invention also provides a computer-readable storage medium, which may be a non-volatile computer-readable storage medium or a volatile computer-readable storage medium. Instructions are stored in the computer-readable storage medium. When the instructions are executed on a computer, the computer executes the steps of the flying ink drop volume measurement method.
[0113] Finally, it should be noted that the above description is only a preferred example of the present invention and is not intended to limit the present invention. Although the present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art can still modify the technical solutions described in the aforementioned embodiments or replace some of the technical features therein by equivalents. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present invention shall be included in the protection scope of the present invention.
Claims
1. A method for measuring the volume of a flying ink droplet, characterized in that: include: Acquire an ink drop image from a camera, and perform filtering on the ink drop image to obtain a filtered image; Performing gradient calculation on the filtered image based on a preset gradient calculation formula to obtain a gradient image; Extract edge features from gradient images; The gradient image is divided into regions based on edge features to obtain two outer edge regions; The gradient image is segmented based on a preset bounding rectangle algorithm, a preset adjustment function and two outer edge regions to obtain two flying ink drop regions; The volume of ink droplets in the two outer edge regions is calculated based on the two outer edge regions, the edge features, the two flying ink drop regions and the gradient image; The two drop volumes are averaged to obtain the drop volume in flight.
2. A flying ink drop volume measurement method as claimed in claim 1, characterized in that: The segmentation operation of the gradient image based on the preset bounding rectangle algorithm, the preset adjustment function and the two outer edge areas to obtain two flying ink drop areas includes: The two outer edge regions are analyzed by using the circumscribed rectangle algorithm to obtain two ink droplet rectangular frames; According to the two outer edge areas and the two ink drop rectangular frames, a first connection line set and a second connection line set are calculated; Setting an adaptive threshold of each first link in the first link set according to the two ink drop rectangles, the preset adjustment function and the second link set; The gradient image is segmented based on the two outer edge regions and each adaptive threshold to obtain two flying ink drop regions.
3. A flying ink drop volume measurement method as claimed in claim 2, characterized in that: The method of using a preset bounding rectangle algorithm to analyze the two outer edge regions to obtain two ink droplet rectangular frames includes: Extract outer boundary features of two outer edge regions; The outer boundary features are analyzed using the circumscribed rectangle algorithm to obtain two ink droplet rectangular frames.
4. A flying ink drop volume measurement method as claimed in claim 2, characterized in that: The step of calculating the first connection line set and the second connection line set according to the two outer edge areas and the two ink droplet rectangular frames includes: Obtain the coordinates of the four vertices of the two ink droplet rectangular frames to obtain a first coordinate set; The center points of the two ink droplet rectangular frames are calculated according to the first coordinate set and the circumscribed rectangle algorithm; Obtain all edge pixel points of two outer edge regions to obtain an edge pixel point set; Calculate the connection line between each edge pixel point in the edge pixel point set and its corresponding center point to obtain a first connection line set; The two outer edge regions are divided according to the edge features to obtain two inner boundary regions; Calculate the intersection of each first link in the first link set and its corresponding inner boundary area to obtain an intersection set; The second link set is calculated based on the edge pixel point set, the intersection point set and the first link set.
5. A flying ink drop volume measurement method as claimed in claim 2, characterized in that: The step of setting the adaptive threshold of each first link in the first link set according to the two ink drop rectangles, the preset adjustment function and the second link set includes: Calculate the line connecting the center points of the two ink droplet rectangular frames to obtain a third line; Calculate the angles between all first lines and third lines in the first line set to obtain an angle set; Obtain a pixel point set of all second connection lines in the second connection line set; Sort and count each pixel point set to obtain a gray value sequence set; Calculate the median of each gray value sequence in the gray value sequence set to obtain a basic threshold set; The adaptive threshold of each first link is calculated according to the basic threshold set, the angle set and the adjustment function.
6. A flying ink drop volume measurement method as claimed in claim 2, characterized in that: The segmentation operation of the gradient image based on the two outer edge areas and each adaptive threshold to obtain two flying ink drop areas includes: Obtaining the grayscale value of each pixel in the two outer edge regions, and comparing each grayscale value with the adaptive threshold of the first connecting line corresponding thereto to obtain a comparison result; Conducting result analysis on the comparison results; When the comparison result shows that there is a grayscale value greater than the adaptive threshold of the corresponding first connecting line, the pixel point whose grayscale value is greater than the adaptive threshold of the corresponding first connecting line is set as an ink drop pixel point to obtain an ink drop pixel point set; Otherwise, the pixel points whose grayscale values are smaller than the adaptive threshold of the corresponding first connecting line are set as background pixel points to obtain a background pixel point set; The gradient image is segmented according to the ink droplet pixel set and the background pixel set to obtain two flying ink droplet regions.
7. A flying ink drop volume measurement method as claimed in claim 1, characterized in that: The method of calculating the ink drop volumes in the two outer edge regions based on the two outer edge regions, the edge features, the two flying ink drop regions and the gradient image includes: Calculating the depth information of all pixels in the two outer edge areas based on a preset stereo matching algorithm to obtain a depth information set; Analyze the gradient image based on the stereo matching algorithm to obtain the resolution of the gradient image; Obtaining intrinsic and extrinsic parameters from the camera, and converting each depth information in the depth information set into a three-dimensional coordinate according to the intrinsic and extrinsic parameters and the resolution to obtain a three-dimensional coordinate set; Recognize the gradient image based on the two flying ink drop regions and edge features to obtain two ink drop contours; The volumes of the two ink droplet contours are calculated based on a preset approximate geometric model and a three-dimensional coordinate set to obtain the volumes of the ink droplets in the two outer edge regions.
8. A flying ink drop volume measuring device, characterized in that: include: A filter image calculation module is used to obtain an ink drop image from a camera and filter the ink drop image to obtain a filter image; A gradient image calculation module is used to perform gradient calculation on the filtered image based on a preset gradient calculation formula to obtain a gradient image; A feature extraction module is used to extract edge features from the gradient image; An outer edge region division module is used to divide the gradient image into regions based on edge features to obtain two outer edge regions; A segmentation operation module, used for performing a segmentation operation on the gradient image based on a preset bounding rectangle algorithm, a preset adjustment function and two outer edge areas to obtain two flying ink drop areas; An ink drop volume calculation module, used for calculating the ink drop volumes in the two outer edge regions based on the two outer edge regions, the edge features, the two flying ink drop regions and the gradient image; The flying ink drop volume calculation module is used to calculate the average value of the volumes of two ink drops to obtain the flying ink drop volume.
9. A flying ink drop volume measurement device, characterized in that: The flying ink drop volume measurement device comprises: a memory and at least one processor, wherein the memory stores instructions; At least one of the processors calls the instructions in the memory to enable the flying ink drop volume measurement device to perform each step of the flying ink drop volume measurement method as described in any one of claims 1-7.
10. A computer-readable storage medium having instructions stored thereon, characterized in that: When the instructions are executed by the processor, the various steps of a flying ink drop volume measurement method as described in any one of claims 1-7 are implemented.
Citation Information
Patent Citations
Image deblurring method for flying ink droplets
CN117437155A
Monocular vision-based deformation monitoring method, apparatus and device, and storage medium
CN118602968A