Method of counting the number of round bars
The method addresses the limitation of conventional counting methods by using height and diameter estimation to accurately count round rods and determine their diameter, irrespective of mounting surface position.
Patent Information
- Application Number
- JP2024058647
- Authority / Receiving Office
- JP · JP
- Patent Type
- Applications
- Current Assignee / Owner
- Filing Date
- 2024-04-01
- Publication Date
- 2025-10-14
AI Technical Summary
Conventional methods for counting round rods require the mounting surface to be within the measurement range of an optical displacement meter, limiting the measurement environment and accuracy.
The method involves acquiring height data of the outer periphery of aligned round rods at regular intervals, setting a reference position, identifying minimal positions as boundaries, and counting rods based on these positions, with an additional process to estimate diameter when unknown.
Accurately counts the number of round rods regardless of mounting surface position and estimates diameter, ensuring precise counting and diameter determination.
Smart Images

Figure 2025155139000001_ABST
Abstract
Description
[Technical Field]
[0001] The present invention relates to a method for counting the number of round rods, and more particularly to a method for counting the number of round rods arranged on a mounting table or the like. [Background technology]
[0002] This type of counting method is shown, for example, in Patent Document 1, in which an optical displacement meter is scanned across each rod parallel to the mounting surface of the rod, and the number of rods is counted by measuring the displacement of the surface of each rod. [Prior art documents] [Patent documents]
[0003] [Patent Document 1] Patent Publication No. 2017-111626 Summary of the Invention [Problem to be solved by the invention]
[0004] However, in the conventional method described above, a threshold is set based on the mounting surface of the rod body, and the start and end of displacement (height) measurement for each rod body is determined by that threshold. This means that the mounting surface must be within the measurement range of the optical displacement meter, which creates a problem of limiting the measurement environment. SUMMARY OF THE INVENTION The present invention is intended to solve such problems, and has as its object to provide a method for counting the number of round rods that can accurately count the number of round rods regardless of the position of the mounting surface. [Means for solving the problem]
[0005] The method for counting the number of round rods of the present invention acquires height (Z-axis direction) data of the outer periphery of the upper half of a plurality of aligned round rods at regular intervals in the alignment direction (X-axis direction), sets the highest position of the acquired height data as a reference position, and identifies positions on the positive and negative sides of the alignment direction where the height is minimal or smallest within a predetermined range determined from the diameter of the round rods with respect to the reference position as a boundary, and counts the number of round rods by defining the range from the minimal or smallest position on the negative side through the reference position to the minimal or smallest position on the positive side as the existence range of one round rod. The highest position of the remaining height data, excluding the height data within the existence range of the one rod body, is set as the next reference position, and the positions where the height is minimal or smallest on the positive and negative sides of the alignment direction within a specified range determined from the diameter of the rod body, with the next reference position as the boundary, are identified.The range from the minimal or smallest position on the negative side, through the next reference position, to the minimal or smallest position on the positive side is set as the existence range of the next rod body and is added to the number of rod bodies, and this process is repeated to calculate the number of aligned rod bodies.
[0006] According to the method for counting the number of round rods of the present invention, the number of round rods can be counted accurately regardless of the position of the mounting surface.
[0007] In the method for estimating the diameter of a round bar using the method for counting the number of round bars of the present invention, when the diameter of the round bar is unknown, a threshold diameter is given in place of the diameter and gradually changed within a predetermined range, while identifying the negative minimum or minimum position, the reference position, and the positive minimum or minimum position, and an estimated circle passing through these three positions is calculated, and an error area is calculated between the height position of the estimated circle and the height data between the negative minimum or minimum position and the positive minimum or minimum position, and the average diameter of the estimated circle when the error area is smallest is estimated to be the diameter of the round bar.
[0008] According to the method for estimating the diameter of a round rod of the present invention, even if the diameter of a round rod is unknown, the diameter of the round rod can be estimated using the method for counting the number of round rods, and the number of round rods can be counted by executing the method for counting the number of round rods again using the estimated diameter. [Effects of the Invention]
[0009] According to the method for counting the number of round rods of the present invention, the number of round rods can be counted accurately regardless of the position of the mounting surface. [Brief explanation of the drawings]
[0010] [Figure 1] FIG. 10 is a perspective view of round rods aligned on a mounting table. [Figure 2] FIG. 10 is a schematic cross-sectional view showing a measurement state of round rods aligned on a mounting table or the like. [Figure 3] 10 is a flowchart of a number counting process. [Figure 4] FIG. 10 is a diagram illustrating a local minimum value search in the first number counting process. [Figure 5] 10 is a flowchart of a local minimum search process. [Figure 6] FIG. 10 is a diagram illustrating the range of the first local minimum search. [Figure 7] FIG. 10 is a diagram illustrating the range of the second local minimum search. [Figure 8] FIG. 10 is a diagram illustrating a local minimum value search in the second number counting process. [Figure 9] 10 is a flowchart of a diameter estimation process. [Figure 10] FIG. 10 is a diagram showing an example of an error area when a threshold diameter is appropriate in the diameter estimation process. [Figure 11] FIG. 10 is a diagram showing an example of an error area when a threshold diameter in a diameter estimation process is inappropriate. [Figure 12] FIG. 10 is a diagram showing another example of the error area when the threshold diameter in the diameter estimation process is inappropriate. DETAILED DESCRIPTION OF THE INVENTION
[0011] The embodiments described below are merely examples, and various design improvements made by those skilled in the art without departing from the gist of the present invention are also included in the scope of the present invention.
[0012] Figure 1 shows an example of aligned round rods to be counted. Round rods 1 are placed across multiple support plates 2 that are spaced apart and inclined downward to one side, and are aligned adjacent to each other while being positioned in the width direction by stopper plates 3. Hereinafter, the alignment direction will be referred to as the X direction, and the height direction will be referred to as the Z direction.
[0013] The rod 1 aligned as described above is subjected to three-dimensional measurement to obtain measurement data by measuring the Z-direction data (Z value) of its upper half outer periphery (solid line portion in Figure 2) at regular intervals in the X-direction (X value). After obtaining the measurement data, the procedures in the following flowcharts are executed by a computer.
[0014] (Preprocessing for counting) FIG. 3 shows the procedure for counting the number of round rods 1 when their diameters are known. In step 101, the Z values of each measurement data are sorted in descending order to create an index list (Π:Π[1] to Π[Nmax]). Here, the index list indicates the correspondence between the search index n, which will be described later, and the index assigned to each measurement data according to the measurement order. For example, the measurement data with the largest Z value is assigned search index n=1, but if the measurement data is, for example, the fourth measurement, its index will be Π[1]=4. Note that Nmax is the total number of measurement data.
[0015] In the following step 102, the count number Bar and search index n are reset to 0 and 1, respectively. In step 103, it is confirmed that the search index n is equal to or less than the total number of measurement data Nmax, and the process proceeds to step 104, where the index Π[n] is set to the reference position index iRef. When n=1, as shown in FIG. 4, the index Π[1] of the measurement data with the largest Z value is set as the reference position index iRef|1. Here, |n corresponds to the value of n. Furthermore, Z[iref|1] is the Z value of the measurement data specified by the reference position index iRef|1, and X[iref|1] is the X value of the measurement data specified by the reference position index iRef|1.
[0016] (local minimum search routine) In step 105 of FIG. 3, if the reference position index iRef has not yet been searched, the process proceeds to step 106 and step 107, where the process (FIG. 5) for searching the local minimum indexes (iRht, iLft) on the right side (the side where the X value increases) and the left side (the side where the X value decreases) of the reference position index iRef is performed, respectively, as described below.
[0017] Figure 5 shows a flowchart of the search routine. This search routine is shared by both the right and left sides, and in step 201, Δm is set to +1 for right-side searches, and Δm is set to -1 for left-side searches. In step 202, the local minimum index iMin is initialized to iRef. In step 203, the search start position index iSta is set to iRef+Δm, and in step 204, the search count s is set to 1. In step 205, the search index m is set to the search start position index iSta.
[0018] In step 206, it is confirmed that the search index m is not 0 or has not reached the total numerical value Nmax of the measurement data, and in step 207, it is confirmed that the search has not been completed. In step 208, it is confirmed that the value of Δm(X[m+Δm]-X[m]) does not exceed the interval threshold ΔX of X, and the process proceeds to step 210. In step 210, it is confirmed that the value of Δm(X[m+Δm]-X[iSta]) is equal to or less than D / s (D is the diameter of the round bar), and the process proceeds to step 211, where Z[iMin], which is the Z value of the measurement data specified by the local minimum index iMin (initial value is iRef), is compared with Z[m], which is the Z value of the measurement data specified by the search index m.
[0019] If Z[iMin]≧Z[m] in step 211, then in step 212, search index m is set to local minimum index iMin, and the value of search index m is then incremented by Δm (step 213). That is, in the case of a right-side search, the value of search index m is incremented by 1, and in the case of a left-side search, the value of search index m is decremented by 1. By repeating the above steps, as shown by the arrows in Figure 4, a search is performed from the reference position index iRef|1 to the right and left at regular intervals, up to the positions indicated by the local minimum value indices iRht|1, iLft|1 where the Z value (height direction) is minimal.
[0020] If the condition of step 208 is not met and the interval threshold ΔX is exceeded, it is assumed that adjacent measurement data are far apart in the X direction, and further search is stopped, and the search index m at this time is set as the local minimum index iMin. In other words, in this case, the Z value of the measurement data is smallest, but not necessarily the smallest, and is specified as the local minimum index iMin.
[0021] Furthermore, if the condition of step 210 is not met, that is, if the value of Δm(X[m+Δm]-X[iSta]) becomes larger than D / s (D is the diameter of the rod, and s is 1 in this case), that is, if it exceeds the shaded range in Fig. 6, no further search is required and the process proceeds to step 214. If the index iSta of the search start position at this time is not the local minimum index iMin, iSta is set to iMin (step 215), the search count s is incremented (step 216), and the processes from step 205 onwards are performed again. In this process, since the value of D / s in step 210 becomes D / 2, the search for the local minimum value is limited to the range of X values of the measurement data D / 2, as shown by the shaded area in Fig. 7.
[0022] In the judgment of step 210, when the diameter of the rod is unknown (described later), the threshold diameter Dth is used as the rod diameter D. As the number of searches s increases, the search range becomes smaller, so that the measurement data specified by the local minimum index iMin can be reliably searched for.
[0023] In step 217, if a right search is performed, the value of the local minimum index iMin is set to iRht, and if a left search is performed, the value of the local minimum index iMin is set to iLht, and the process returns to the number counting process of FIG.
[0024] (Main process in counting process) 3, steps 108 and 109 confirm that the difference between the X value X[iRht] of the measurement data specified by the right-side local minimum index iRht and the X value X[iLht] of the measurement data specified by the left-side local minimum index iLht is equal to or greater than D / 2 or equal to or less than 2D, respectively, before proceeding to step 110. In step 110, it is determined that each measurement data specified by an index between the indexes iRht and iLht has been searched, and in the following step 111, the count number Bar is incremented and the current indexes iRef, iRht, and iLht are stored.
[0025] This is shown in Figure 8, where the measurement data positions where the height (Z value) is minimum on the positive side (right side) and negative side (left side) of the rod alignment direction X are identified (iRef|1, iRht|1), with the measurement data specified by the reference position index iref|1 as the boundary, and the number of rods Bar is added, with the range from the minimum position on the negative side, through the reference position, to the minimum position on the positive side being the existence range of one rod.
[0026] After step 111 is completed, search index n is incremented in step 112, index Π[2] is set to reference position iRef in step 104, and in the search routine of steps 106 and 107, as shown in Figure 8, a search is performed sequentially from index iRef|2 to the right and left at regular intervals until the measurement data where the Z value (height direction) is minimal, as indicated by local minimum indexes iRht|2 and iLft|2, is found, and the next number counting process is performed in steps 110 and 111.
[0027] This number counting process is repeated until the search index n exceeds the total number Nmax of measurement data in step 103 above.
[0028] 3, if the reference position index iRef has already been searched for in step 105, the process does not proceed to the next step 110 and subsequent steps, but instead increments the search index n in step 112. Also, if the difference between X[iRht] and X[iLht] is smaller than D / 2 or the difference between X[iRht] and X[iLht] is larger than 2D in step 108 or step 109, it is determined that valid number counting processing cannot be performed, and in this case too, the process does not proceed to the next step 110 and subsequent steps, but instead increments the search index n in step 112.
[0029] (Diameter estimation process) When the diameter of the rod is unknown, the diameter estimation process shown in FIG. 9 is performed. In step 301 of FIG. 9, an initial value +inf for the minimum error area Em is set. The value of +inf is appropriately determined through experiments, etc. In the following step 302, a minimum threshold diameter Dsta is set as the threshold diameter Dth. The minimum threshold diameter Dsta is set to the expected smallest diameter of the rod to be processed. In step 303, it is confirmed that the threshold diameter Dth is equal to or smaller than the maximum threshold diameter Dend, which is the expected maximum diameter of the rod. Then, in step 304, the rod counting process from step 101 onward shown in FIG. 3 is performed. That is, the rod diameter D is set to Dth, and the rod counting process and the local minimum value search process shown in FIG. 5 within this process are performed. Note that in this estimation process, the number of rods counted in step 111 during the rod counting process, Bar, is ignored.
[0030] After the number counting process in step 304 is completed, step 305 checks whether the number Nbar of measurement data used to detect the rods, i.e., the number of measurement data specified by the index that has been searched in step 110 of Fig. 3, is 80% or more of the total number Nmax. In other words, if the number Nbar of measurement data that has been searched is small, it is determined that the set threshold diameter Dth is still too small, and the process proceeds to step 311 to increase the threshold diameter Dth by ΔD.
[0031] On the other hand, if the threshold diameter Dth satisfies the condition of step 305, the process proceeds to step 306, where an estimated circle Cs passing through the three measurement data points specified by the indexes iRef, iRht, and iLht stored in step 111 of FIG. 3 is calculated, and then in the following step 307, the error area E between the estimated circle Cs and the measurement data curve between the indexes iRef and iLht is calculated.
[0032] Examples of the calculated error area are shown by the shaded areas in Figures 10 to 12. Figure 10 shows a case where the threshold diameter Dth is appropriate and the sizes of the estimated circles Cs|1 and Cs|2 are accordingly approximately appropriate, resulting in a small error area E. Figure 11 shows a case where the threshold diameter Dth is excessively large and the size of the estimated circle Cs|1 is accordingly excessively large, resulting in a large error area E. Figure 12 shows a case where the threshold diameter Dth is too small and the sizes of the estimated circles Cs|1 and Cs|2 are accordingly too small, resulting in a large error area E. Note that, when the estimated circles Cs|1 and Cs|2 overlap as shown in Figure 12, the area of the overlapping portion is also added to the error area E.
[0033] In step 308, it is confirmed whether the error area E calculated in step 307 is equal to or smaller than the minimum error area Em, and if it is equal to or smaller, the process proceeds to step 309, where the error area E is set to the minimum error area Em. Next, the average diameter of the estimated circles Cs|1, Cs|2, ... at this time is stored as the estimated diameter Ds (step 310), and the process proceeds to step 311. Note that if, in step 308, the error area E is larger than the minimum error area Em, the process proceeds to step 311 without performing steps 309 and onwards, where the threshold diameter Dth is increased by a certain amount.
[0034] In this way, steps 304 and subsequent steps are repeated until the threshold diameter Dth exceeds the maximum threshold diameter Dend, and the estimated diameter Ds of the rods is calculated. Then, the number of rods is counted using this estimated diameter Ds as the rod diameter D (see FIGS. 3 and 5) in the rod counting process. [Explanation of symbols]
[0035] 1...round rod, iRef...reference position index, iRht...right side (positive side) local minimum index, iLht...left side (negative side) local minimum index, Cs...estimated circle, Ds...estimated diameter.
Claims
1. Height (Z-axis direction) data for the upper periphery of a plurality of aligned rods is acquired at regular intervals in the alignment direction (X-axis direction), and the highest position among the acquired height data is set as the reference position. Positions where the height is minimal or minimum are identified on the positive and negative sides of the alignment direction within a predetermined range determined from the diameter of the rods, with the reference position as the boundary. The range from the minimal or minimum position on the negative side through the reference position to the minimal or minimum position on the positive side is defined as the existence range of one rod, and is added to the number of rods. A method for counting the number of round rods, characterized in that the highest position of the remaining height data, excluding a certain height data, is set as the next reference position, and the positions where the height is minimal or smallest on the positive and negative sides of the alignment direction within a predetermined range determined from the diameter of the round rods, with the next reference position as the boundary, are identified, and the range from the minimal or smallest position on the negative side through the next reference position to the minimal or smallest position on the positive side is set as the existence range of the next round rod, and this range is added to the number of the round rods, thereby calculating the number of aligned round rods.
2. 2. A method for estimating the diameter of a round bar using the method for counting the number of round bars according to claim 1, wherein, when the diameter of the round bar is unknown, a threshold diameter is given instead of the diameter, and this is gradually changed within a predetermined range while identifying the negative minimum or minimum position, the reference position, and the positive minimum or minimum position, and an estimated circle passing through these three positions is calculated, an error area is calculated between the height position of the estimated circle and the height data from the negative minimum or minimum position to the positive minimum or minimum position, and the average diameter of the estimated circle when the error area is smallest is estimated to be the diameter of the round bar.
Citation Information
Patent Citations
Counting system and counting method
JP2017111626A