CN117450887A - Method for measuring inner and outer diameters and wall thickness of transparent container based on vision micrometer - Google Patents

Method for measuring inner and outer diameters and wall thickness of transparent container based on vision micrometer Download PDF

Info

Publication number
CN117450887A
CN117450887A CN202311343091.4A CN202311343091A CN117450887A CN 117450887 A CN117450887 A CN 117450887A CN 202311343091 A CN202311343091 A CN 202311343091A CN 117450887 A CN117450887 A CN 117450887A
Authority
CN
China
Prior art keywords
image
wall
inner diameter
straight line
variance
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202311343091.4A
Other languages
Chinese (zh)
Inventor
邓红丽
李庆梅
周苗
阴同
姜学明
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Beijing Sdk Information Technology Co ltd
Beijing Daheng Image Vision Co ltd
Original Assignee
Beijing Sdk Information Technology Co ltd
Beijing Daheng Image Vision Co ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Beijing Sdk Information Technology Co ltd, Beijing Daheng Image Vision Co ltd filed Critical Beijing Sdk Information Technology Co ltd
Priority to CN202311343091.4A priority Critical patent/CN117450887A/en
Publication of CN117450887A publication Critical patent/CN117450887A/en
Pending legal-status Critical Current

Links

Classifications

    • GPHYSICS
    • G01MEASURING; TESTING
    • G01BMEASURING LENGTH, THICKNESS OR SIMILAR LINEAR DIMENSIONS; MEASURING ANGLES; MEASURING AREAS; MEASURING IRREGULARITIES OF SURFACES OR CONTOURS
    • G01B5/00Measuring arrangements characterised by the use of mechanical techniques
    • G01B5/02Measuring arrangements characterised by the use of mechanical techniques for measuring length, width or thickness
    • G01B5/06Measuring arrangements characterised by the use of mechanical techniques for measuring length, width or thickness for measuring thickness
    • GPHYSICS
    • G01MEASURING; TESTING
    • G01BMEASURING LENGTH, THICKNESS OR SIMILAR LINEAR DIMENSIONS; MEASURING ANGLES; MEASURING AREAS; MEASURING IRREGULARITIES OF SURFACES OR CONTOURS
    • G01B11/00Measuring arrangements characterised by the use of optical techniques
    • G01B11/02Measuring arrangements characterised by the use of optical techniques for measuring length, width or thickness
    • G01B11/06Measuring arrangements characterised by the use of optical techniques for measuring length, width or thickness for measuring thickness ; e.g. of sheet material
    • GPHYSICS
    • G01MEASURING; TESTING
    • G01BMEASURING LENGTH, THICKNESS OR SIMILAR LINEAR DIMENSIONS; MEASURING ANGLES; MEASURING AREAS; MEASURING IRREGULARITIES OF SURFACES OR CONTOURS
    • G01B11/00Measuring arrangements characterised by the use of optical techniques
    • G01B11/08Measuring arrangements characterised by the use of optical techniques for measuring diameters
    • GPHYSICS
    • G01MEASURING; TESTING
    • G01BMEASURING LENGTH, THICKNESS OR SIMILAR LINEAR DIMENSIONS; MEASURING ANGLES; MEASURING AREAS; MEASURING IRREGULARITIES OF SURFACES OR CONTOURS
    • G01B11/00Measuring arrangements characterised by the use of optical techniques
    • G01B11/08Measuring arrangements characterised by the use of optical techniques for measuring diameters
    • G01B11/12Measuring arrangements characterised by the use of optical techniques for measuring diameters internal diameters
    • GPHYSICS
    • G01MEASURING; TESTING
    • G01BMEASURING LENGTH, THICKNESS OR SIMILAR LINEAR DIMENSIONS; MEASURING ANGLES; MEASURING AREAS; MEASURING IRREGULARITIES OF SURFACES OR CONTOURS
    • G01B5/00Measuring arrangements characterised by the use of mechanical techniques
    • G01B5/08Measuring arrangements characterised by the use of mechanical techniques for measuring diameters
    • GPHYSICS
    • G01MEASURING; TESTING
    • G01BMEASURING LENGTH, THICKNESS OR SIMILAR LINEAR DIMENSIONS; MEASURING ANGLES; MEASURING AREAS; MEASURING IRREGULARITIES OF SURFACES OR CONTOURS
    • G01B5/00Measuring arrangements characterised by the use of mechanical techniques
    • G01B5/08Measuring arrangements characterised by the use of mechanical techniques for measuring diameters
    • G01B5/12Measuring arrangements characterised by the use of mechanical techniques for measuring diameters internal diameters
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02EREDUCTION OF GREENHOUSE GAS [GHG] EMISSIONS, RELATED TO ENERGY GENERATION, TRANSMISSION OR DISTRIBUTION
    • Y02E30/00Energy generation of nuclear origin
    • Y02E30/30Nuclear fission reactors

Landscapes

  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Length Measuring Devices By Optical Means (AREA)

Abstract

The invention provides a method for measuring the inner diameter and the outer diameter as well as the wall thickness of a transparent container based on a visual micrometer, which comprises the following steps: step 1, obtaining an integral gray image of a transparent to-be-detected body, processing the integral gray image into a binarized image, fitting a first column coordinate with 1 binarized from outside to inside into a straight line for the left and right wall images, and calculating the minimum distance between two straight line sections as the outer diameter; step 2, correcting the image according to the straight line of the outer wall of the tube, performing threshold segmentation on the corrected image to obtain a corrected binarized image, and combining effective data in radial projection data of the tube to obtain the left and right edge positions and the inner diameter of the inner diameter; and 3, respectively calculating the wall thickness by using a Euclidean distance formula. The invention is based on a conventional measurement acquisition system, adopts a special image processing algorithm, and can also finish the accurate positioning of the inner wall while detecting the outer diameter, thereby accurately calculating the outer diameter, the inner diameter and the wall thickness of the section corresponding to the transparent body.

Description

Method for measuring inner and outer diameters and wall thickness of transparent container based on vision micrometer
Technical Field
The invention relates to the technical field of machine vision detection, in particular to a method for measuring the inner diameter and the outer diameter and the wall thickness of a transparent container based on a vision micrometer.
Background
In transparent and semitransparent cylinder detection of glass tubes, glass bottles and the like, quality control in the production process is a focus of manufacturers, and detected items comprise an outer diameter, a wall thickness and appearance quality, wherein the detection difficulty is high, namely wall thickness detection, and if the wall thickness is not within an acceptable error range, the subsequent production and filling of glass products can be affected.
Fig. 1 is a schematic diagram of a conventional device based on the detection method, a body 2 to be detected is positioned between a surface light source 3 and a telecentric acquisition system 1 to obtain an acquisition image shown in fig. 2, when the body to be detected is positioned in the center of the acquisition system, the black shadows of the left and right side walls of the transparent body to be detected are relatively symmetrical, when the body to be detected is offset in the visual field, the black shadows of the left and right side walls are inconsistent, in the current measurement application, the inner side of the black shadows is the inner wall of the body to be detected, the outer side of the black shadows is the outer wall, the distance between the two is the wall thickness, the positioning of the inner wall and the outer wall is rough, the positioning precision is low, and the result is inaccurate; when the object to be measured deviates from the center of the field of view, the measurement result is more inaccurate.
Disclosure of Invention
Specifically, the invention provides a method for measuring the inner diameter and the outer diameter of a transparent container based on a visual micrometer, which comprises the following steps:
step 1, obtaining an integral gray image of a transparent to-be-measured body, calculating variances of any adjacent pixels in the gray image, generating a variance image, fitting the left side tube outer wall PL and the right side tube outer wall PR of the to-be-measured body based on the variance image, and further calculating an outer diameter R;
step 2, obtaining an inner diameter edge and calculating an inner diameter r;
step 21, according to the fitted left side tube outer wall and right side tube outer wall, carrying out direction correction on the images to obtain corrected gray level images, and carrying out variance operation on any adjacent transverse images in the corrected gray level images to obtain corrected transverse variance images;
step 22, projecting the corrected gray level image in the longitudinal direction to obtain a gray level longitudinal projection image, and obtaining radial projection data of the tube;
step 23, performing threshold segmentation on the corrected transverse variance image to obtain a corrected binarized image, and performing straight line fitting by utilizing points of the corrected binarized image in effective data to obtain an inner diameter edge line position PLr and a same symmetry position PRr which are respectively used as left and right edge positions of the inner diameter;
step 24, calculating the minimum distance between the two straight line segments PLr and PRr as the result of the inner diameter r by using the Euclidean distance formula.
Further, the step 1 includes:
step 11, obtaining an integral gray level image of the transparent object to be detected, performing variance operation on any adjacent pixels in the gray level image in the transverse direction, and generating a binarized image T (i, j) based on the variance value:
wherein D (i, j) is a transverse variance image, and (i, j) is a pixel corresponding to a row coordinate i and a column coordinate j in the transverse variance image and the binarized image, and TH is a binarization threshold;
step 12, for the left side wall, searching each row from the leftmost side to the right of the image, recording the column coordinates j of the first T (i, j) =1 searched to obtain corresponding points, performing straight line fitting on the coordinates of all points, and calculating a fitted straight line segment PL as the outer wall of the left side tube;
step 13, searching from the rightmost side to the left of the image in each row, and calculating a position straight line segment PR of the outer wall of the right tube;
and step 14, calculating the minimum distance between the two straight line sections by using a Euclidean distance formula, and taking the minimum distance as a result of the outer diameter R.
Further, in step 11, the image gray scale array is described as G [ i, j ], where i represents a row coordinate and j represents a column coordinate;
performing checking denoising on the image in the parallel direction of the tube to generate a filtered image array M [ i, j ]:
wherein m represents the height of the filtered template, n represents the range of height independent variables from-m to m;
designing a sliding window to calculate a lateral variance image D (i, j):
wherein,is the average value of the pixel points in the sliding window, N represents the number of all the pixel points in the sliding window, and a and b are the row coordinates and the column coordinates of the pixels in the sliding window respectively;
threshold segmentation is performed on the lateral variance image D (i, j) to obtain a binarized image T (i, j).
Further, in step 21, the method further comprises the steps of:
firstly, calculating a rotation matrix H according to the extracted outer walls PL and PR of the pipe;
secondly, correcting the image gray scale array, the gray scale image and the outer wall PL and PR of the tube according to affine transformation;
and finally, carrying out variance operation on any transverse adjacent image in the gray level image after the correction, and obtaining a transverse variance image after the correction.
Further, in step 21, the rotation matrix H is expressed as:
x and y are row coordinates of the actual area of the whole pipe and the center of the pipe area as a point O according to the extracted pipe outer walls PL and PR; θ is the angle θ of the region in the vertical direction.
Further, in step 21, the image gray scale array after the correction according to affine transformation is: g' (i, j) =g (i, j) H, i representing row coordinates and j representing column coordinates;
the tube outer wall straight line PL after correction of the tube outer wall straight line PL' =pl×h;
the tube outer wall straight line PR is corrected by tube outer wall straight line PR' =pr×h.
Further, in step 21, the corrected lateral variance image is:
a, b are row coordinates and column coordinates of pixels in the sliding window, respectively, N represents the number of all pixels in the sliding window,is the average of the pixel points within the sliding window.
And further, the measurement acquisition system used in the method for measuring the inner diameter and the outer diameter of the transparent container based on the vision micrometer irradiates the sample to be measured by adopting parallel light rays, and acquires the gray level image of the sample to be measured through fixed imaging magnification.
The method for measuring the wall thickness of the transparent container based on the vision micrometer comprises the following steps:
calculating the left and right edge positions of the outer diameter and the left and right edge positions of the inner diameter of the to-be-measured body based on a method for measuring the inner diameter and the outer diameter of the transparent body container of the vision micrometer;
the left wall thickness dL and the right wall thickness dR are calculated based on the left and right edge positions of the outer diameter and the left and right edge positions of the inner diameter of the body to be measured, respectively, using the euclidean distance formula.
The beneficial effects achieved by the invention are as follows:
the invention is based on a conventional measurement acquisition system, adopts a special image processing algorithm, and can also finish the accurate positioning of the inner wall while detecting the outer diameter, thereby accurately calculating the outer diameter, the inner diameter and the wall thickness of the section corresponding to the transparent body. On the premise of not increasing the cost of the existing acquisition device, the calculation is more accurate.
The invention can find the accurate edges of the inner wall and the outer wall through a special algorithm, and is also suitable for accurately calculating the wall thickness of the body to be measured under the deflection in the visual field.
Drawings
FIG. 1 is a schematic diagram of a prior art and vision micrometer-based device for measuring the inner and outer diameters and wall thicknesses of a transparent container;
FIG. 2 is a schematic diagram of a prior art view of a visual micrometer-based device for measuring the inner and outer diameters and wall thickness of a transparent container;
FIG. 3 is a schematic diagram showing the distribution of light collected in the method for measuring the inner and outer diameters and wall thickness of a transparent container based on a vision micrometer according to an embodiment of the present invention;
FIG. 4 is an overall image and a partial enlarged view of a body to be measured in a method for measuring the inner and outer diameters and the wall thickness of a transparent container based on a vision micrometer according to an embodiment of the present invention;
FIG. 5 is a longitudinal projection view of gray scale in a method for measuring inner and outer diameters and wall thickness of a transparent container based on a vision micrometer according to an embodiment of the present invention;
FIG. 6 is a view of a sample to be measured in the center of a field of view in a method for measuring the inner and outer diameters and wall thickness of a transparent container based on a vision micrometer according to an embodiment of the present invention;
FIG. 7 is a schematic diagram of pixel values obtained by the prior art and the present invention when a sample to be measured is located in the center of a field of view in a method for measuring the inner and outer diameters and wall thickness of a transparent container based on a vision micrometer according to an embodiment of the present invention;
FIG. 8 is a diagram showing an image of a sample to be measured shifted to the upper side of a field of view in a method for measuring the inner and outer diameters and wall thickness of a transparent container based on a vision micrometer according to an embodiment of the present invention;
FIG. 9 is a schematic diagram of pixel values obtained by the prior art and the present invention when a sample to be measured is shifted to the upper side of a field of view in a method for measuring the inner and outer diameters and wall thickness of a transparent container based on a vision micrometer according to an embodiment of the present invention;
fig. 10 is a schematic diagram of actual measurement of a sample tube for a verification test in a method for measuring the inner and outer diameters and the wall thickness of a transparent container based on a vision micrometer according to an embodiment of the present invention;
FIG. 11 is a schematic diagram of an image and pixel number for verifying the outer diameter of a test sample tube in a method for measuring the inner diameter and the outer diameter of a transparent container based on a vision micrometer according to an embodiment of the present invention;
FIG. 12 is a schematic diagram of an image and pixel number of an inner diameter of a sample tube for verification test in a method for measuring an inner diameter and an outer diameter of a transparent container and a wall thickness based on a vision micrometer according to an embodiment of the present invention;
fig. 13 is a schematic diagram of an image and the number of pixels collected by a verification test sample 1 in a method for measuring the inner diameter and the outer diameter of a transparent container based on a vision micrometer according to an embodiment of the present invention;
fig. 14 is a schematic diagram of an image and the number of pixels collected by a verification test sample 2 in a method for measuring the inner and outer diameters and wall thickness of a transparent container based on a vision micrometer according to an embodiment of the present invention;
fig. 15 is a schematic diagram of an image and the number of pixels collected by the verification test sample 3 in the method for measuring the inner and outer diameters and the wall thickness of the transparent container based on the vision micrometer according to the embodiment of the invention.
Detailed Description
The technical scheme of the present invention will be described in more detail with reference to the accompanying drawings, and the present invention includes, but is not limited to, the following examples.
The method is based on a conventional measurement acquisition system, irradiates a sample to be measured by adopting parallel light rays, acquires a gray level image of the sample to be measured by adopting a fixed imaging magnification, and can also finish the accurate positioning of the inner wall while detecting the outer diameter by adopting a special image processing algorithm, thereby accurately calculating the outer diameter, the inner diameter and the wall thickness of the section corresponding to the transparent body. The measurement acquisition system has no perspective effect of near size and far size under conventional acquisition and has fixed imaging magnification.
As shown in figure 3, the light distribution of a transparent or semitransparent cylinder to be measured after penetrating through the wall of the measured body when light is incident is simulated, and the measured body is of a symmetrical structure, so that the 1b-6b light and the 1a-6a light are symmetrical, and the following description of 1a-6a is also applicable to 1b-6b. If the left side of the object to be detected is a telecentric acquisition system, the parallel light rays such as 1a-6a are all receivable light rays, and the incident light beam 1a '-6a' of the emergent light beam 1a-6a can be obtained through the principle of light path reversibility; wherein 1a '-3a' is a light beam penetrating through a single glass layer, and 4a '-6a' is a light beam penetrating through both sides; the outermost 1a' is the light ray of 1a after the glancing light ray penetrates through the transparent body, and the light ray is the light ray of the outer wall of the body to be detected; the reverse extension line of the 3a light is just the critical surface where the inner wall is located, the incident light is 3a ', and when the light beams of the 3a' of the right side light source are fewer, the obtained 3a light beams are very dark. In practical applications, the light source has a smaller divergence angle, and the light beams needing oblique incidence similar to the light beams of 2a ' -5a ' are relatively fewer, while the light beams with larger angles of 3a ' are particularly least, and a certain range of black bands are obtained on the image and are darkest at 3 a.
As shown in fig. 4 below, which is a whole image of a transparent object to be measured and a partial enlarged image of the right side wall, the black-white boundary line 212 in the theoretical presumption figure is the 3a ray as described above, and is the inner wall position; the gray level drop 211 of the rightmost edge with respect to the background is the outer wall position, and the distance between the two is the wall thickness of the position. The edges of the inner wall and the outer wall at different positions in the whole image have certain changes, the following special algorithm solves the encountered series of problems in practice, analyzes and extracts the collected edges of the inner wall and the outer wall on the whole image, and calculates the wall thickness stably and with high precision.
Specifically, the method for measuring the inner diameter and the outer diameter and the wall thickness of the transparent container based on the vision micrometer provided by the invention comprises the following steps:
step 1, obtaining an outer diameter edge and calculating an outer diameter R;
in the example of FIG. 4, step 11, the image gray scale array is depicted as G [ i, j ], where i represents the row coordinate and j represents the column coordinate;
performing checking denoising on the image in the parallel direction of the tube to generate a filtered image array M [ i, j ]:
wherein m represents the height of the filtered template, n represents the range of height independent variables from-m to m;
according to the characteristic of the tube edge image, namely the reflective area of the pure background light source outside the tube, the image gray scale is smoother, the image gray scale of the outer diameter edge of the tube is gradually reduced from the outer part to the inner part, and according to the rule, the transverse variance image D (i, j) is calculated according to the design size (3*3 or 5*3 sliding window template):
wherein the method comprises the steps ofThe pixel point is the average value of the pixel points in the sliding window, N represents the number of all the pixel points in the sliding window, and a and b are the row coordinates and the column coordinates of the pixels in the sliding window respectively;
performing simple threshold segmentation on the transverse variance image to obtain a binarized image T (i, j):
step 12, for the left side wall, each row searches from the outermost side to the inner side of the image, records the column coordinate j of the first encountered T (i, j) =1, and obtains L (i, j):
according to the least square principle, performing straight line fitting on all point coordinates of L (i, j) =1, and calculating a fitted straight line segment position PL as the position of the outer wall of the left tube; in this way, the detection accuracy can be brought to the sub-pixel level, i.e. similar to the measurement accuracy of a micrometer in a conventional measuring tool.
Step 13, in the same way as step 12, searching from the rightmost side to the left of the image in each row, and calculating a position straight line segment PR of the outer wall of the right tube;
and step 14, calculating the minimum distance between the two straight line sections by using a Euclidean distance formula, and taking the minimum distance as a result of the outer diameter R.
Step 2, obtaining an inner diameter edge and calculating an inner diameter r;
step 21, correcting the image according to the extracted straight lines PL and PR of the outer wall of the tube to obtain a corrected transverse variance image;
acquiring an actual Region of the whole pipe according to the extracted pipe outer wall straight lines PL and PR, and calculating the center of a pipe subarea as a point O, wherein row-column coordinates are x and y respectively, and the angle theta of the area along the vertical direction;
a rotation matrix H is calculated:
correcting the image G ' (i, j) =g (i, j) ×h according to affine transformation, and correcting the tube outer wall straight line PL ' =pl×h, PR ' =pr×h;
performing variance operation on the corrected image to obtain a corrected transverse variance image:
step 22, a gray-scale longitudinal projection graph is obtained, radial projection data P [ n ] of a tube are obtained, n is the image width, the image projection graph is shown in fig. 5, two wave troughs on the left side and the right side of the projection graph are selected to be provided with broken lines, and coordinate data in the broken lines are obtained to be effective data of the inner diameter position;
step 23, threshold segmentation is performed on the corrected transverse variance image to obtain a corrected binarized image T (i, j) selecting a binarized image T In (i, j) at P [ n ]]Within the interval valid data of (1) and T Performing linear fitting on the points (i, j) =1 for a plurality of times to obtain an inner diameter edge line position PLr and a same symmetry position PRr which are respectively used as left and right edge positions of the inner diameter;
step 24, calculating the minimum distance between the two straight line segments PLr and PRr as the result of the inner diameter r by using the Euclidean distance formula.
Step 3, calculating the wall thickness d;
finally, calculating the left wall thickness dL and the right wall thickness dR respectively by using the Euclidean distance formula, wherein dL is formed by two straight line sections PL And PLr, dr is calculated from the minimum distance of the two straight line segments PR and PRr.
In one embodiment, the sample wall thickness is about 1145 microns in the example, with a corresponding pixel of about 46.8 pixels. The upper and lower wall thicknesses will vary slightly, about + -3 pixels.
Under the conventional test that the sample is located in the center of the visual field, as shown in fig. 6, for the measured values of the upper wall thickness and the lower wall thickness of the sample, 1-1 and 1-2 are respectively partial graphs of the upper wall and the lower wall in fig. 7, the pixels between the innermost black edge and the outermost black edge of the original method are adopted as the wall thickness of the position, the obtained upper wall thickness and the lower wall thickness are 67 pixels and 69 pixels, the corresponding wall thickness value is about 1664 micrometers, the corresponding wall thickness of the pixel value obtained by the patent is about 1101 micrometers, the relative deviation of the accuracy of the patent is reduced from 45% to about 4% compared with the actual value of 1145 micrometers.
Under conventional testing in which the sample is displaced from the upper side of the field of view to the upper side of the field of view, as shown in fig. 8 to 9, the upper wall is wider in shadow than the lower wall due to the upward displacement of the sample relative to the field of view, the upper and lower wall pixels obtained by the original method are 81 pixels and 64 pixels respectively, the corresponding wall thickness values are 1982 micrometers and 1566 micrometers, and the deviation from the true value 1145 micrometers is 73% and 37% respectively; the pixel values obtained by the patent are 45 pixels and 46 pixels respectively, and the corresponding wall thickness values are about 1101 micrometers and 1126 micrometers, so that the relative deviation is reduced to about 4%. And relatively stable wall thickness measurements can still be obtained with the present method under deflection in the field of view.
Meanwhile, in order to prove that the measuring method adopted by the scheme is accurate, a plurality of samples are selected to obtain the wall thickness value and the outer diameter value of the samples, and the method is verified.
As shown in fig. 10, for a certain sample tube, a vernier caliper is adopted for multiple tests, and the thickness value is obtained by taking an average value to be about 1.145mm; the transparent tube was tested for an outer diameter of 16.075mm.
As shown in fig. 11, the telecentric acquisition system has no perspective effect of near size and far size under conventional acquisition, has fixed imaging magnification, the acquisition precision in the experiment is 24.5 micrometers per pixel, and the theoretical calculation 16.075/0.0245 corresponds to 656 pixels of the outer diameter of the sample.
The number of pixels between the outermost contours in the actual acquired image is 656 pixels, and the value can be obtained by common image viewing software.
As shown in fig. 12, the theoretical calculation results in a pixel count of 1.145/0.0245=46.7 pixels by actually making the wall thickness 1.145 mm. The 47 th pixel position is calculated from the outermost edge into the sample, namely the position corresponding to the inner wall, and the position has fixed image characteristic information, so that the deviation of the sample in the field of view is not influenced.
In addition, as shown in fig. 13-15, the values obtained after the real values and the collected image analysis processing are shown in table 1 for various samples, and the collected image processing analysis values are similar to the measured values for three samples with different outer diameters and thicknesses, and a slight deviation is that the actual measurement position and the image analysis position have the difference in the processing range of the sample process, and the difference is allowable in + -3 pixels.
TABLE 1
Type(s) Sample 1 Sample 2 Sample 3
True measured outside diameter value/mm 16.075 25.66 29.78
True measured thickness value/mm 1.145 0.73 1.23
Collecting the outer diameter pixel value of a picture 656 1039 1216
Collecting picture outer diameter value/mm 16.08 25.46 29.79
Collecting picture thickness pixel value 47 29 50
Acquisition of picture thickness value/mm 1.15 0.71 1.225
Note that:
the real measured value is an average value obtained by adopting a vernier caliper to measure for a plurality of times;
the size value of the acquired picture is the pixel value corresponding to the acquired picture type multiplied by the acquisition resolution. The fixed acquisition module has a fixed acquisition resolution.
The present invention is not limited to the above embodiments, and those skilled in the art can implement the present invention in various other embodiments according to the examples and the disclosure of the drawings, so that the design of the present invention is simply changed or modified while adopting the design structure and concept of the present invention, and the present invention falls within the scope of protection.

Claims (9)

1. The method for measuring the inner diameter and the outer diameter of the transparent container based on the vision micrometer is characterized by comprising the following steps of:
step 1, obtaining an integral gray image of a transparent to-be-measured body, calculating variances of any adjacent pixels in the gray image, generating a variance image, fitting the left side tube outer wall PL and the right side tube outer wall PR of the to-be-measured body based on the variance image, and further calculating an outer diameter R;
step 2, obtaining an inner diameter edge and calculating an inner diameter r;
step 21, according to the fitted left side tube outer wall and right side tube outer wall, carrying out direction correction on the images to obtain corrected gray level images, and carrying out variance operation on any adjacent transverse images in the corrected gray level images to obtain corrected transverse variance images;
step 22, projecting the corrected gray level image in the longitudinal direction to obtain a gray level longitudinal projection image, and obtaining radial projection data of the tube;
step 23, performing threshold segmentation on the corrected transverse variance image to obtain a corrected binarized image, and performing straight line fitting by utilizing points of the corrected binarized image in effective data to obtain an inner diameter edge line position PLr and a same symmetry position PRr which are respectively used as left and right edge positions of the inner diameter;
step 24, calculating the minimum distance between the two straight line segments PLr and PRr as the result of the inner diameter r by using the Euclidean distance formula.
2. The method for measuring the internal and external diameters of a transparent container based on a vision micrometer according to claim 1, wherein the step 1 comprises:
step 11, obtaining an integral gray level image of the transparent object to be detected, performing variance operation on any adjacent pixels in the gray level image in the transverse direction, and generating a binarized image T (i, j) based on the variance value:
wherein D (i, j) is a transverse variance image, and (i, j) is a pixel corresponding to a row coordinate i and a column coordinate j in the transverse variance image and the binarized image, and TH is a binarization threshold;
step 12, for the left side wall, searching each row from the leftmost side to the right of the image, recording the column coordinates j of the first T (i, j) =1 searched to obtain corresponding points, performing straight line fitting on the coordinates of all points, and calculating a fitted straight line segment PL as the outer wall of the left side tube;
step 13, searching from the rightmost side to the left of the image in each row, and calculating a position straight line segment PR of the outer wall of the right tube;
and step 14, calculating the minimum distance between the two straight line sections by using a Euclidean distance formula, and taking the minimum distance as a result of the outer diameter R.
3. The method of claim 2, wherein in step 11, the image gray scale array is described as G [ i, j ], wherein i represents row coordinates and j represents column coordinates;
performing checking denoising on the image in the parallel direction of the tube to generate a filtered image array M [ i, j ]:
wherein m represents the height of the filtered template, n represents the range of height independent variables from-m to m;
designing a sliding window to calculate a lateral variance image D (i, j):
wherein,is the average value of the pixel points in the sliding window, N represents the number of all the pixel points in the sliding window, and a and b are the row coordinates and the column coordinates of the pixels in the sliding window respectively;
threshold segmentation is performed on the lateral variance image D (i, j) to obtain a binarized image T (i, j).
4. The method for measuring the internal and external diameters of a transparent container based on a vision micrometer according to claim 2, further comprising the steps of, in step 21:
firstly, calculating a rotation matrix H according to the extracted outer walls PL and PR of the pipe;
secondly, correcting the image gray scale array, the gray scale image and the outer wall PL and PR of the tube according to affine transformation;
and finally, carrying out variance operation on any transverse adjacent image in the gray level image after the correction, and obtaining a transverse variance image after the correction.
5. A method of measuring the inside and outside diameter of a transparent container based on a visual micrometer according to claim 3, wherein in step 21, the rotation matrix H is expressed as:
x and y are row coordinates of the actual area of the whole pipe and the center of the pipe area as a point O according to the extracted pipe outer walls PL and PR; θ is the angle θ of the region in the vertical direction.
6. The method for measuring internal and external diameters of a transparent container based on a vision micrometer according to claim 4, wherein in step 21, the image gray scale array corrected according to affine transformation is: g' (i, j) =g (i, j) H, i representing row coordinates and j representing column coordinates;
the tube outer wall straight line PL after correction of the tube outer wall straight line PL' =pl×h;
the tube outer wall straight line PR is corrected by tube outer wall straight line PR' =pr×h.
7. The method for measuring internal and external diameters of a transparent container based on a visual micrometer according to claim 6, wherein in step 21, the corrected lateral variance image is:
a, b are row coordinates and column coordinates of pixels in the sliding window, respectively, N represents the number of all pixels in the sliding window,is the average of the pixel points within the sliding window.
8. The method for measuring the inner diameter and the outer diameter of the transparent container based on the vision micrometer according to claim 1, wherein a measurement acquisition system used in the method for measuring the inner diameter and the outer diameter of the transparent container based on the vision micrometer irradiates a sample to be measured by adopting parallel rays, and a gray level image of the sample to be measured is acquired through a fixed imaging magnification.
9. The method for measuring the wall thickness of the transparent container based on the vision micrometer is characterized by comprising the following steps of:
calculating the left and right edge positions of the outer diameter and the left and right edge positions of the inner diameter of a to-be-measured body by adopting the method for measuring the inner diameter and the outer diameter of the transparent body container based on the vision micrometer according to any one of claims 1 to 8;
the left wall thickness dL and the right wall thickness dR are calculated based on the left and right edge positions of the outer diameter and the left and right edge positions of the inner diameter of the body to be measured, respectively, using the euclidean distance formula.
CN202311343091.4A 2023-10-17 2023-10-17 Method for measuring inner and outer diameters and wall thickness of transparent container based on vision micrometer Pending CN117450887A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202311343091.4A CN117450887A (en) 2023-10-17 2023-10-17 Method for measuring inner and outer diameters and wall thickness of transparent container based on vision micrometer

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202311343091.4A CN117450887A (en) 2023-10-17 2023-10-17 Method for measuring inner and outer diameters and wall thickness of transparent container based on vision micrometer

Publications (1)

Publication Number Publication Date
CN117450887A true CN117450887A (en) 2024-01-26

Family

ID=89590145

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202311343091.4A Pending CN117450887A (en) 2023-10-17 2023-10-17 Method for measuring inner and outer diameters and wall thickness of transparent container based on vision micrometer

Country Status (1)

Country Link
CN (1) CN117450887A (en)

Similar Documents

Publication Publication Date Title
CN108764257B (en) Multi-view pointer instrument identification method
US8428335B2 (en) Combining feature boundaries
US20190197340A1 (en) Object surface deformation feature extraction method based on line scanning three-dimensional point cloud
Liu et al. An improved online dimensional measurement method of large hot cylindrical forging
US20150228063A1 (en) Pattern Inspecting and Measuring Device and Program
CN108613630B (en) Two-wire tube level bubble offset measurement method based on image processing technology
CN103615980B (en) Method and system for measuring parameters of round holes in plate
US10102631B2 (en) Edge detection bias correction value calculation method, edge detection bias correction method, and edge detection bias correcting program
JP5288297B2 (en) Method for measuring the end shape of a threaded tube
CN109751964B (en) High-precision non-contact pipe diameter measuring method and device
CN114549835A (en) Pointer instrument correction identification method and device based on deep learning
CN106643549A (en) Machine vision-based tile size detection method
CN105092616B (en) Industry CT detects medium and small minutia dimension measurement method
CN110211178B (en) Pointer instrument identification method using projection calculation
CN102798349A (en) Three-dimensional surface extraction method based on equal-gray line search
CN105160754A (en) Coin surface quality detection apparatus and coin surface quality detection method based on height measurement
CN116503316A (en) Chip defect measurement method and system based on image processing
CN110084807A (en) A kind of detection method that seam inspection egative film image is faked
CN106441162A (en) Cylindrical object verticality noncontact detection device and method
CN113888641A (en) Stumpage breast diameter measurement method based on machine vision and deep learning
CN111815580B (en) Image edge recognition method and small module gear module detection method
JP4597509B2 (en) Pattern inspection apparatus and pattern inspection method
CN117450887A (en) Method for measuring inner and outer diameters and wall thickness of transparent container based on vision micrometer
CN106645168A (en) Detection method for surface concave-convex defect of boom cylinder of crane
CN115289997B (en) Binocular camera three-dimensional contour scanner and application method thereof

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination