Advanced Algorithm for Reliable Quantification of the Geometry and Printability of Printed Patterns

In nanoparticle-based printed electronic devices, the printability of the patterns constituting the device are crucial factors. Although many studies have investigated the printability of patterns, only a few have analyzed and established international standards for measuring the dimensions and printability of shape patterns. This study introduces an advanced algorithm for accurate measurement of the geometry and printability of shape patterns to establish an international standard for pattern dimensions and printability. The algorithm involves three core concepts: extraction of edges of printed patterns and identification of pixel positions, identification of reference edges via the best-fitting of the shape pattern, and calculation of different pixel positions of edges related to reference edges. This method enables the measurement of the pattern geometry and printability, including edge waviness and widening, while considering all pixels comprising the edges of the patterns. The study results revealed that the rectangle and circle patterns exhibited an average widening of 3.55% and a maximum deviation of 1.58%, based on an average of 1662 data points. This indicates that the algorithm has potential applications in real-time pattern quality evaluation, process optimization using statistical or AI-based methods, and foundation of International Electrotechnical Commission standards for shape patterns.


Introduction
Printed electronics is considered a promising candidate for mass production of flexible electronic devices owing to its flexibility, environmental friendliness, and costeffectiveness [1][2][3][4][5][6]. Nanoparticle-based printing and coating methods are essential for the fabrication of flexible electronic devices comprising several patterns, such as lines and shapes, formed from single or multiple layers. The quality and printability of the pattern are crucial factors affecting the outcomes of printed electronics [7][8][9][10].
Thus far, several studies have focused on improving the printability of functional patterns. Kapur analyzed the effects of the ratio of web speed to roll speed, that is, the speed ratio and ink properties on the ink transfer ratio during doctoring and ink transferring processes [11]. Kitsomboonloha et al. comprehensively analyzed the ink transfer ratio in the ink transferring phase of direct gravure printing, that is, ink filling, doctoring, and ink transferring phases, according to the capillary number of ink [12]. In addition, they studied the effects of doctoring conditions, such as the geometry of the doctor blade and blade angle, and the speed parameter on the thickness of the lubrication film in the doctoring phase [13]. The air volume in the cell in the ink filling phase of direct gravure printing was studied by Cen et al. in terms of the capillary number of ink [14]. Raske et al. theoretically analyzed the ink transfer ratio during the ink transferring phase of reverse gravure coating in terms of the speed ratio, capillary number, and web tension [15]. In these studies [11][12][13][14][15], printability was evaluated based on the net ink transfer ratio during the printing and coating. Nguyen et al. theoretically and experimentally studied the effects of the surface tension of ink, surface energy, and the aspect ratio of the cell on the ink transfer ratio and pattern width [16]. Moreover, they studied the relationships among printing conditions such as printing speed, nip pressure, and contact angle of ink on web and pattern width [17]. Hyun et al. studied the printed pattern width in terms of the width of line openings in a screen mask for screen printing [18]. Park et al. experimentally analyzed the widening effect because of the engraving type (groove and dot) and aspect ratio of the engraved patterns [19]. Noh et al. and Park et al. fabricated thin film transistor active matrices using roll-to-roll direct gravure printing. Consequently, they evaluated the printability of the component patterns of the transistors using the line width, edge waviness, and surface roughness [20,21]. Lee et al. defined the criteria for evaluating the printability as the continuity, average width, and local smudging. They statistically optimized the printing conditions using these criteria based on the Box-Behnken design of experiments [22][23][24]. The effects of web speed and ink viscosity on the pattern width were experimentally analyzed by Nam et al. and Lee et al. [25,26]. Further, Jeon et al. evaluated line and mesh patterns using width, edge waviness, and pinhole ratio [27]. Lee et al. analyzed the relationship among the ink viscosity, printing speed, pattern width, and length of the tailing defects affecting the edge waviness [28]. The printability of the pattern was evaluated on the basis of the pattern width and edge waviness in [16][17][18][19][20][21][22][23][24][25][26][27][28].
Considering that printability directly affects the performance and reliability of devices, the appropriate management and control of the printability of patterns during the printing process can enhance device quality and increase productivity. IEC/TC119 has established several international standards for printability, including measurements of the line pattern width, void, and waviness [29,30]. Although shape patterns are essential for printing the component layers of flexible electronic devices, there exists no accepted international standard for the measurement of the dimensions and printability of shape patterns. Therefore, to establish an international standard for the measurement of the dimensions and printability (widening and edge waviness) of patterns, this study proposed an advanced algorithm that ensures reliable quantification of the geometry and quality of shape patterns that are most frequently used in printed electronic devices using image processing. Moreover, the experimental verifications have shown that the proposed algorithm accurately determines the geometry and quality of the pattern. Figure 1a,b shows the proposed quantification method and its flowchart, respectively. The method has three core ideas: (1) extracting the edges of printed patterns and identifying the positions of pixels constituting the edges; (2) identifying the reference edges (reference sides and circles for rectangular and circular patterns, respectively), which are the bestfitting of the shape pattern; and (3) calculating the different pixel positions of the edges related to the reference sides or circles. Using this method, one can measure the geometry of the pattern and quantify its printability, including widening and edge waviness, considering that all pixels constitute the edges of the patterns.

Methods
The process for quantifying the geometry and printability of a pattern is shown in Figure 2 and involves five steps. The process for quantifying the geometry and printability of a pattern is shown in Figure 2 and involves five steps.
Step 1. Preparation of the printed pattern to be measured ( Figure 2a).
Step 2. Capturing an image of the pattern using a microscope or camera. The entire image has patterned and non-patterned areas (Figure 2b). For a rectangular pattern, in cases of an oblique extracted image, it should be rotated such that one of its sides is parallel to the x-or y-axis using a rotation matrix ( Figure 2c); a captured image may be tilted by angle θ owing to the oblique angle of its design or by the rotation of the sample in an optical measurement device. If a design pattern is tilted, the tilt angle of the image is dependent on tilting angle θ of its design pattern. If a sample is positioned on a stage of the device while being rotated by angle θ, the tilt angle of the image can be obtained by determining the angle at which a line parallel to the reference line, which is one of the lines composing the shape, appears following the rotation of the shape.
Step 3. The edges of the pattern that distinguish the patterned and non-patterned areas are identified, the coordinates of each pixel that constitutes the edge are obtained, and the pattern image is converted into a brightness matrix using image-processing software such as MATLAB (Figure 2d), and the pattern sides are extracted from the matrix using a Sobel operator, depending on the minimum brightness level of the pattern ( Figure  2e).
Step 4. The reference edges that are the best-fitting lines for the edges of printed patterns are identified. The reference edges correspond to the four sides in the case of a rectangle, or a circle in the case of a circular pattern. Reference edges can be obtained by applying the least squares method to the coordinates of the pixels on each side.
Step 5. Measure the geometry of the pattern and/or evaluate the printability by calculating the edge waviness related to the reference edge and widening of the pattern compared to the dimensions of the original design.  Figure 3 shows a schematic for the measurement of the geometry of a rectangle from the extracted pattern edges in Figure 2e. First, vertical and horizontal reference lines that are parallel to the sides of the rectangle are drawn (Figure 3a). The lengths of the horizontal and vertical reference lines extend over the horizontal and vertical sides of the target pattern, respectively. All points comprising the vertical and horizontal sides can be em- Step 1. Preparation of the printed pattern to be measured ( Figure 2a).

Measurement Method for Rectangle Pattern
Step 2. Capturing an image of the pattern using a microscope or camera. The entire image has patterned and non-patterned areas (Figure 2b). For a rectangular pattern, in cases of an oblique extracted image, it should be rotated such that one of its sides is parallel to the xor y-axis using a rotation matrix ( Figure 2c); a captured image may be tilted by angle θ owing to the oblique angle of its design or by the rotation of the sample in an optical measurement device. If a design pattern is tilted, the tilt angle of the image is dependent on tilting angle θ of its design pattern. If a sample is positioned on a stage of the device while being rotated by angle θ, the tilt angle of the image can be obtained by determining the angle at which a line parallel to the reference line, which is one of the lines composing the shape, appears following the rotation of the shape.
Step 3. The edges of the pattern that distinguish the patterned and non-patterned areas are identified, the coordinates of each pixel that constitutes the edge are obtained, and the pattern image is converted into a brightness matrix using image-processing software such as MATLAB (Figure 2d), and the pattern sides are extracted from the matrix using a Sobel operator, depending on the minimum brightness level of the pattern (Figure 2e).
Step 4. The reference edges that are the best-fitting lines for the edges of printed patterns are identified. The reference edges correspond to the four sides in the case of a rectangle, or a circle in the case of a circular pattern. Reference edges can be obtained by applying the least squares method to the coordinates of the pixels on each side.
Step 5. Measure the geometry of the pattern and/or evaluate the printability by calculating the edge waviness related to the reference edge and widening of the pattern compared to the dimensions of the original design. Figure 3 shows a schematic for the measurement of the geometry of a rectangle from the extracted pattern edges in Figure 2e. First, vertical and horizontal reference lines that are parallel to the sides of the rectangle are drawn (Figure 3a). The lengths of the horizontal and vertical reference lines extend over the horizontal and vertical sides of the target pattern, respectively. All points comprising the vertical and horizontal sides can be employed as sample points via the calculation of the average distance between the pair of pixels constituting the horizontal (left and right) and vertical (top and bottom) boundaries and their corresponding horizontal and vertical reference lines, respectively. Subsequently, the distance between the pixels of the left W L (n) and right W R (n) sides can be determined on the basis of the vertical reference line. Similarly, the distance between the pixels of the top H T (n) and bottom H B (n) sides can be obtained from the horizontal reference line. The width of the rectangle (W) can be determined by calculating the average distance between the pair of pixels constituting the left and right boundaries and their corresponding vertical reference lines. Similarly, the height of the rectangle (H) can be determined by calculating the average distance between the pair of pixels that form the top and bottom boundaries, and the corresponding horizontal reference lines. The center of the rectangle (W C , H C ) can be obtained by averaging W L and W R , and H B and H T , respectively. These measurements are represented mathematically in Equations (1)-(3) as

Measurement Method for Rectangle Pattern
Using the above information, the extent of widening (w, h) can be calculated by comparing the pattern with the reference design in Equations (4) and (5).
where w and h are the ratios of widening in the width and height of the printed rectangular pattern, respectively; and W0 and H0 are the width and height of the original rectangular design, respectively. Using Equations (6)-(9), we can obtain the average (DmX and DmY) and standard deviations of the distance between the sides of the rectangle and its centerlines (DsX and DsY). The reference sides WL0, WR0, HB0, and HT0 were obtained by applying the least-squares method to WL(n), WR(n), HT(n), and HB(n) (Figure 3b). Because the corners of the rectangle have curvatures, the data near the corners should be excluded while applying the leastmean-square. This can be achieved by selecting only those pixels whose distance falls within some boundaries, such as Dm − 3Ds and Dm + 3Ds on each side (Figure 3c). Using the above information, the extent of widening (w, h) can be calculated by comparing the pattern with the reference design in Equations (4) and (5).
where w and h are the ratios of widening in the width and height of the printed rectangular pattern, respectively; and W 0 and H 0 are the width and height of the original rectangular design, respectively. Using Equations (6)-(9), we can obtain the average (D mX and D mY ) and standard deviations of the distance between the sides of the rectangle and its centerlines (D sX and D sY ). The reference sides W L0 , W R0 , H B0 , and H T0 were obtained by applying the leastsquares method to W L (n), W R (n), H T (n), and H B (n) (Figure 3b). Because the corners of the rectangle have curvatures, the data near the corners should be excluded while applying the least-mean-square. This can be achieved by selecting only those pixels whose distance falls within some boundaries, such as D m − 3D s and D m + 3D s on each side (Figure 3c).
where X and Y indicate the position of the sides of the rectangle on the x-axis and y-axis, that is, the left (L) and right (R) sides, and the bottom (B) and top (T) sides, respectively. Finally, we obtain the edge waviness for each edge (Figure 3d), given by Equations (10) and (11), and calculate the root-mean-square as the statistical data for edge waviness using Equations (12) and (13). Figure 4a shows a schematic of the radius of the circle. It is necessary to determine the center of the circle before measuring its radius. Figure 4b-d illustrates how to identify the center of a circular pattern using lines passing through the edge. Two lines (L and M) are drawn through any two points on the edge (Figure 4b), while two lines (l 1 and m 1 ) are drawn perpendicular through the centers of L and M, respectively (Figure 4c). The intersection of these two lines is the center of the circular pattern (W C and H C ). If we select a pair of points on the edge for lines L n and M n , that is, ((Lx n1 , Ly n1 ) and (Lx n2 , Ly n2 )), and ((Mx n1 , My n1 ) and (Mx n2 , My n2 )), respectively, we can obtain the intersection points (Wc and Hc) using Equations (14) and (15):

Measurement Method for Circle Pattern
where My n2 − My n1 lx ln = Lx n1 + Lx n2 2 , ly ln = Ly n1 + Ly n2 2 , lx mn = Mx n1 + Mx n2 2 , ly mn = My n1 + My n2 2  If the edge of the circle is not uniform, an additional line (ln and mn) passing through two points on the edge (Ln and Mn) may result in more than two additional centers (WCn and HCn). Thus, to obtain the statistically converged coordinates of the center, the average of the multiple sets of center positions can be considered. First, we obtain the median of the x and y coordinates of the points constituting the target circle (Wm, Hm). Subsequently, the center positions in the range of 0.9-1.1 times the derived medians (WC, HC) are extracted. Let WC0 and HC0 be the averages of WC and HC, respectively.
The mean (Radm) and standard deviation of the circle radius (Rads) can be obtained by calculating the distance between the points constituting the edge and center of the circle, as expressed by Equations (16) and (17), respectively.  If the edge of the circle is not uniform, an additional line (l n and m n ) passing through two points on the edge (L n and M n ) may result in more than two additional centers (W Cn and H Cn ). Thus, to obtain the statistically converged coordinates of the center, the average of the multiple sets of center positions can be considered. First, we obtain the median of the x and y coordinates of the points constituting the target circle (W m , H m ). Subsequently, the center positions in the range of 0.9-1.1 times the derived medians (W C , H C ) are extracted. Let W C0 and H C0 be the averages of W C and H C , respectively.
The mean (Rad m ) and standard deviation of the circle radius (Rad s ) can be obtained by calculating the distance between the points constituting the edge and center of the circle, as expressed by Equations (16) and (17), respectively.
where W(n) and H(n) are the x and y coordinates of the nth point, comprising the boun-dary of the printed circular pattern, respectively, and N is the number of points constituting the circle. The radius of the printed circle pattern calculated at each pixel of the edge of the circle as well as the widening of the circle can be obtained as: where R 0 is the radius of the original design of the circle pattern.

Applications
The proposed method was used to measure the geometry of printed patterns and quantify their printing quality. Milliscale rectangles (width = 2 mm and height = 2 mm) and circular patterns (diameter = 1.7 mm) were printed to experimentally verify the superiority of the proposed algorithm. Patterns were printed using an industrial-scale roll-to-roll machine (AMP Korea Co., Ltd., Gyeonggi-do, Republic of Korea). Figure 5a,b shows the roll-to-roll machine and direct gravure printing process used in this study, respectively. In Figure 5a, the roll-to-roll machine comprises an unwinder, an in-feeder, the first and second printer, the first and second dryer, an out-feeder, and a rewinder; the width of the web is 100 mm. The range of tension and web speed were 1-196 N and 1-20 m/min, respectively. Figure 5c shows the ink transferring procedure of the direct gravure printing. Gravure printing is among the most suitable techniques for the mass production of printed electronic devices. The ink transfer in gravure printing can be classified into four phases: ink filling, doctoring, ink transfer, and ink setting [11,16]. During the ink filling phase, ink is provided to the engraved cell. The fractions of ink that are deposited on the surface of the printing roll are wiped out using a doctor blade in the doctoring phase. During the ink transferring phase, the ink in the engraved cell is transferred to the web by the nip roll. Finally, the ink transferred to the web is widened or agglomerated depending on the surface tension of ink and surface energy of substrate in the ink setting. As mentioned in our previous study, ink transfer in the gravure printing process is very complex, and even minor mismatches in the process conditions, such as the ink, web characteristics, and machine conditions, can significantly affect the quality of microscale patterns. Quantification of the geometry and quality of the printed pattern are essential for determining the process conditions using statistical optimization (e.g., design of experiments) and artificial intelligence (AI)-based techniques [22]. In our previous study, we determined the surface tension and viscosity of the ink as 37 mN/m and 10,000 cP, respectively, and the surface energy of the web as 50 mN/m to minimize the widening of the printed pattern [16,22]. Table 1 lists the properties of the ink, web, and machine used in the experiment.   Figure 6b,c,f, the red, green, blue, and cyan bold lines represent the top, bottom, left, and right edges of the pattern, respectively, whereas the dotted and dashed lines in Figure 6b,c represent the designed pattern and reference sides, respectively.  [24] with permission), (d) scanning electron microscopy (SEM) image, and (e) the contact angle of the ink solvent. In (a), the roll-to-roll machine comprises an unwinder, in-feeder, first and second printer, first and second dryer, out-feeder, and rewinder. In (d,e), the average particle size of the ink is 150 nm and the contact angle is 48.44°. The number of data points used to obtain the widening and edge waviness in the xaxis and y-axis (shown in Figure 6d) was 1968. Thus, the proposed method in Section 2.1 facilitated successful extraction of the edges of the pattern sides. Consequently, the widening and edge waviness of the pattern can be quantified, as shown in Figure 6d-f. The pattern was widened by approximately 0.13 mm (6.5% of the pattern width) in the x-axis, as shown in Figure 6d, owing to tailing [11,18] and the spreading of the pattern at the imperfect dots at the edges of the engraved pattern [23]. Further, the average, standard deviation, and a maximum deviation of the pattern width were calculated to be 0.0105, 0.0084, and 0.0514 mm, respectively, owing to the edge waviness. In Figure 6f, the standard deviations of the top, bottom, left, and right sides are 0.0138, 0.0069, 0.0153, and 0.0159 mm, respectively. Thus, the pattern's sides were widened and exhibited wide deviations, except for the bottom side. Considering the printing direction in Figure 6a and the results of our previous studies [23,24], the top side as well as the left and right sides indicate that the edge waviness is prevalent because of the tailing and imperfect dots of the engraved pattern, respectively.  The number of data points used to obtain the widening and edge waviness in the x-axis and y-axis was 1968. As evident, the average widening and maximum deviation of the pattern image were 6.5% and 2.57% of pattern width, respectively. Further, the dotted and dashed lines in (b,c) represent the designed pattern and reference sides, respectively. The number of data points used to obtain the widening and edge waviness in the x-axis and y-axis was 1968. As evident, the average widening and maximum deviation of the pattern image were 6.5% and 2.57% of pattern width, respectively.
The number of data points used to obtain the widening and edge waviness in the x-axis and y-axis (shown in Figure 6d) was 1968. Thus, the proposed method in Section 2.1 facilitated successful extraction of the edges of the pattern sides. Consequently, the widen-ing and edge waviness of the pattern can be quantified, as shown in Figure 6d-f. The pattern was widened by approximately 0.13 mm (6.5% of the pattern width) in the x-axis, as shown in Figure 6d, owing to tailing [11,18] and the spreading of the pattern at the imperfect dots at the edges of the engraved pattern [23]. Further, the average, standard deviation, and a maximum deviation of the pattern width were calculated to be 0.0105, 0.0084, and 0.0514 mm, respectively, owing to the edge waviness. In Figure 6f, the standard deviations of the top, bottom, left, and right sides are 0.0138, 0.0069, 0.0153, and 0.0159 mm, respectively. Thus, the pattern's sides were widened and exhibited wide deviations, except for the bottom side. Considering the printing direction in Figure 6a and the results of our previous studies [23,24], the top side as well as the left and right sides indicate that the edge waviness is prevalent because of the tailing and imperfect dots of the engraved pattern, respectively.   In (b,c,f), the red, green, blue, and cyan bold lines represent the top, bottom, left, and right edges of the pattern, respectively. Further, the dotted and dashed lines in (b,c) represent the designed pattern and reference sides, respectively. The number of data points used to obtain the widening and edge waviness in the x-axis and y-axis was 1968. As evident, the average widening and maximum deviation of the pattern image were 6.5% and 2.57% of pattern width, respectively. The number of data points used to obtain the widening and edge waviness in the xaxis and y-axis (as shown in Figure 7d) was 1356. The pattern was widened by approximately 0.005 mm (0.59% of the pattern radius). The average, standard deviation, and a The number of data points used to obtain the widening and edge waviness in the x-axis and y-axis (as shown in Figure 7d) was 1356. The pattern was widened by approximately 0.005 mm (0.59% of the pattern radius). The average, standard deviation, and a maximum deviation of the pattern radius were found to be 0.0099, 0.0067, and 0.0322 mm, respectively, owing to the edge waviness. Table 2 shows the performance of the proposed algorithm compared to previous studies that evaluated the geometry and quality of printed patterns. The results show that the geometry and quality of the shape patterns can be clearly and reliably quantified using the proposed algorithm. The proposed algorithm can be applied to complex patterns fabricated via additive manufacturing, such as those shown in Figure 3c,d in [19] and Figure 3a in [31], along with the coating and printing techniques used in this study, by combining the measurement methods for rectangle and circle patterns introduced in Sections 2.1 and 2.2. In addition, the algorithm can be partially applied to irregular patterns, such as Figure 4b,c in [32], by aligning the printed pattern with the corresponding design pattern and comparing the differences between the pixels comprising the printed and corresponding design patterns.

Conclusions
This study proposed an advanced algorithm to facilitate reliable quantification of the geometry, widening, and edge waviness of printed patterns using image processing. Through the utilization of the three core concepts of the proposed algorithm, statistical measures were derived to quantitatively assess the geometry, widening, and edge waviness of the patterns based on all pixels constituting the boundary of a target pattern. Using the algorithm, we found that the rectangle and circle patterns in our study exhibited an average widening of 3.55% with a maximum deviation of 1.58%, based on an average of 1662 data points. The results showed that the proposed algorithm effectively and reliably evaluated the geometry and quality of the printed patterns. This indicates that the algorithm has potential applications in real-time classification, pattern quality evaluation, process optimization using statistical and AI-based approaches, as well as the foundation of IEC standards for shape pattern dimensions and printability.