CN108592948B - Automatic measurement method for bubble offset of pipe level - Google Patents
Automatic measurement method for bubble offset of pipe level Download PDFInfo
- Publication number
- CN108592948B CN108592948B CN201810417199.6A CN201810417199A CN108592948B CN 108592948 B CN108592948 B CN 108592948B CN 201810417199 A CN201810417199 A CN 201810417199A CN 108592948 B CN108592948 B CN 108592948B
- Authority
- CN
- China
- Prior art keywords
- bubble
- image
- area
- offset
- calculating
- 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.)
- Active
Links
Images
Classifications
-
- G—PHYSICS
- G01—MEASURING; TESTING
- G01C—MEASURING DISTANCES, LEVELS OR BEARINGS; SURVEYING; NAVIGATION; GYROSCOPIC INSTRUMENTS; PHOTOGRAMMETRY OR VIDEOGRAMMETRY
- G01C25/00—Manufacturing, calibrating, cleaning, or repairing instruments or devices referred to in the other groups of this subclass
-
- G—PHYSICS
- G01—MEASURING; TESTING
- G01C—MEASURING DISTANCES, LEVELS OR BEARINGS; SURVEYING; NAVIGATION; GYROSCOPIC INSTRUMENTS; PHOTOGRAMMETRY OR VIDEOGRAMMETRY
- G01C9/00—Measuring inclination, e.g. by clinometers, by levels
- G01C9/18—Measuring inclination, e.g. by clinometers, by levels by using liquids
- G01C9/24—Measuring inclination, e.g. by clinometers, by levels by using liquids in closed containers partially filled with liquid so as to leave a gas bubble
- G01C9/34—Measuring inclination, e.g. by clinometers, by levels by using liquids in closed containers partially filled with liquid so as to leave a gas bubble of the tubular type, i.e. for indicating the level in one direction only
-
- Y—GENERAL 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
- Y02—TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
- Y02E—REDUCTION OF GREENHOUSE GAS [GHG] EMISSIONS, RELATED TO ENERGY GENERATION, TRANSMISSION OR DISTRIBUTION
- Y02E30/00—Energy generation of nuclear origin
- Y02E30/30—Nuclear fission reactors
Landscapes
- Engineering & Computer Science (AREA)
- Physics & Mathematics (AREA)
- General Physics & Mathematics (AREA)
- Radar, Positioning & Navigation (AREA)
- Remote Sensing (AREA)
- Manufacturing & Machinery (AREA)
- Image Analysis (AREA)
- Length Measuring Devices By Optical Means (AREA)
Abstract
The invention discloses a method for automatically measuring the bubble offset of a pipe level, which comprises the following specific implementation contents: the method comprises the steps of operating a gray level image of an original tube level by adopting a mode of automatically determining an interested area to obtain an interested area image, judging the offset position of bubbles in the interested area image, and roughly calculating the offset of the bubbles if the bubbles enter a calculation offset fixed area and the center of a crescent area of the bubbles is far away from the center of the fixed area; and if the center of the crescent area of the bubble is closer to the center of the fixed area, accurately calculating the offset of the bubble, and finally measuring the offset of the bubble in the tube level according to an image calibration result. The method can effectively solve the problems of time and labor waste and large error when human eyes are used for identification by adopting a machine vision mode, adopts a method that the horizontal distance value between the center of the bubble and the center of a rectangle surrounded by two black lines represents the actual offset, and has the advantages of innovativeness, good robustness, simplicity, practicability and high precision.
Description
Technical Field
The invention relates to the technical field of machine vision measurement, in particular to an automatic measurement method for bubble offset of a pipe level.
Background
In many industrial manufacturing activities, flatness detection of the surface of the object to be measured is often required, and therefore, such precision measurement is usually performed by some measuring instruments (e.g. level gauges, etc.) with a tube level, and currently, the most widely used method is to determine whether the surface of the object to be measured is level by measuring the amount of air bubble offset in the tube level. At present, a plurality of measuring instruments with tube levels are arranged on the market for detecting the surface flatness of a measured object, and in order to ensure the measuring accuracy of the measuring instruments with the tube levels produced by a plurality of manufacturers, air bubbles in the tube levels are detected and calibrated before products leave a factory. In a general calibration method, a measuring instrument with a tube level is placed on a standard level test table, and whether or not the measuring instrument shipped from a factory is acceptable is determined based on the degree of misalignment of an air bubble in the tube level. The allowable error range of the measuring instruments with different accuracies in the detection is different. At present, the domestic detection method for the offset of the air bubble in the pipe level is commonly used:
(1) The offset of the air bubbles in the pipe level is identified by human eyes, whether the metering device is qualified or not is judged by the offset, and the product is corrected only by manually adjusting the pipe level.
(2) The bubble offset is measured based on a Canny edge detection and weighted least square method, although the method has strong robustness for poor-quality images, a fixed boundary area for calculating the bubble offset, which is found by the method, is not accurate enough, so that the finally calculated bubble offset has obvious errors.
(3) The method for measuring the bubble offset by using the local gray gradient average value curve and the sub-pixel precision positioning method has high extraction precision for the edge end point of the bubble outline, but because the bubble outline is influenced by the vibration of a motor in the process of actually measuring the bubble of the correcting pipe water level, the outline shape of the bubble is slightly changed when the bubble is adjusted, and therefore, if only the left end point and the right end point of the bubble are extracted to measure the offset in the continuous adjustment process, the measurement precision of the whole measurement process is seriously influenced.
Disclosure of Invention
Aiming at the defects of the prior art, the invention provides an automatic measurement method for the bubble offset of a pipe level, which adopts a mode of automatically determining an area of interest and adopts a rough measurement method when the center of a bubble just enters the center of a fixed area for calculating the bubble offset; when the center of the bubble is close to the center of the fixed area for calculating the offset of the bubble, an accurate measurement method is adopted; the measuring precision is improved, meanwhile, the device can be used for replacing human beings to correct a measuring instrument with a pipe level, and the problems that human eyes are identified, manual knocking is time-consuming and labor-consuming, and errors are large are solved.
The technical scheme adopted by the invention is that the automatic measurement method for the bubble offset of the pipe level is implemented according to the following steps:
step 1: reading an original gray image of the bubble of the tube level;
step 2: carrying out binarization and median filtering processing on the original gray level image;
and step 3: carrying out contour detection on the binary image subjected to median filtering, and calculating the ratio of the area of the region surrounded by each contour to the minimum circumscribed rectangle area of each contour and the length of the long side of the minimum circumscribed rectangle of each contour;
and 4, step 4: judging whether a fixed region for calculating the bubble offset exists in the image or not by limiting the ratio of the area of the region surrounded by each outline to the area of the minimum circumscribed rectangle of each outline and the length of the long side of the minimum circumscribed rectangle of each outline;
and 5: if a fixed area for calculating the bubble offset exists, the fixed area for calculating the bubble offset is subjected to external expansion to obtain an interested area;
and 6: calculating the inclination angle of the minimum circumscribed rectangle of the fixed region for calculating the bubble offset, and the ratio of the area of the region surrounded by the outline of the fixed region to the area of the minimum circumscribed rectangle of the outline of the fixed region, and judging the offset position of the bubble according to the inclination angle and the ratio;
and 7: if the bubbles enter the range of the fixed area for calculating the offset of the bubbles, calculating the horizontal physical distance between the center of the minimum circumscribed rectangle of the crescent area generated by the reflection of the bubbles and the center of the minimum circumscribed rectangle of the fixed area, and roughly measuring the offset of the bubbles;
and 8: and if the horizontal physical distance between the center of the minimum external rectangle of the crescent area and the center of the minimum external rectangle of the fixed area for calculating the bubble offset is very small, calculating the horizontal physical distance between the center of the external rectangle surrounding the maximum outline of the bubble perimeter and the center of the minimum external rectangle of the fixed area, and accurately measuring the offset of the bubble.
The method has the advantages that the distance of the center of the crescent area of the air bubble or the center of the whole area of the air bubble deviating from the center of the fixed area of the tube level is calculated according to different positions of the air bubble in the tube level through an image processing technology, so that the measurement of the air bubble offset of the tube level is realized. The method can effectively solve the problems of time and labor waste and large error when human eyes are used for identification, and the method of adopting the horizontal distance value between the bubble center and the center of the rectangle surrounded by the two black lines to replace the method of adopting the horizontal distance value between the left and right marginal points of the bubble outline and the center of the two black line outlines to calculate the actual offset.
Drawings
FIG. 1 is a flow chart of the steps of the method of the present invention;
FIG. 2 is an initial image obtained by the method of the present invention;
FIG. 3 is a binarized median filtered image obtained by the method of the present invention;
FIG. 4 is a profile inspection image obtained by the method of the present invention;
FIG. 5 is an actual bounding contour image of a fixed region obtained by the method of the present invention;
FIG. 6 is a circumscribed rectangular image of a fixed area obtained by the method of the present invention;
FIG. 7 is an image of a region of interest acquired by the method of the present invention;
FIG. 8 is a binary image of a region of interest obtained by the method of the present invention after eliminating a short 0-run;
FIG. 9 is a minimum circumscribed rectangular image of a crescent area marked with bubbles obtained by the method of the present invention;
FIG. 10 is a bubble binarization negation image obtained by the method of the invention;
FIG. 11 is a circumscribed rectangle image marked with the maximum perimeter of the bubble outline obtained by the method of the present invention.
Detailed Description
The invention is further described below with reference to the accompanying drawings.
As shown in fig. 1, the method of the present invention comprises the steps of:
step 1: reading original gray level image of bubble of tube level
Reading the original gray image of the bubble of the tube level to be measured for the bubble offset, and obtaining the result as shown in fig. 2
Step 2: carrying out binarization and median filtering processing on the original gray level image
Performing binarization segmentation processing on the original gray level image src by using an OTSU method to obtain a binarization image BI; carrying out median filtering on BI by adopting a 5X5 window to remove noise to obtain a filtered image I filt As shown in fig. 3.
And 3, step 3: carrying out contour detection on the binary image after median filtering, and calculating the ratio of the area of the region surrounded by each contour to the minimum circumscribed rectangle area of each contour and the length of the long edge of the minimum circumscribed rectangle of each contour
For filtered image I filt The contour detection is performed, and the obtained contour detection image is shown in fig. 4. Computing median filtered image I filt Of each contour C i Actual Area of enclosure Area of i Ratio R to the minimum circumscribed rectangular area i And length L of the long side of the minimum bounding rectangle i Wherein I =1,2, 3.. And N, N is the median filtered image I filt The number of the middle outlines.
And 4, step 4: and judging whether a fixed region for calculating the bubble offset exists in the image or not by limiting the ratio of the area of the region surrounded by each outline to the area of the minimum circumscribed rectangle of each outline and the length of the long side of the minimum circumscribed rectangle of each outline.
The ratio R of the area of the region surrounded by each contour obtained in the step 3 to the minimum circumscribed rectangle area of each contour i And the length L of the long side of the minimum circumscribed rectangle of each outline i Limiting when the ratio R is i Greater than a certain constant value T R And the length L of the long side i Within a certain fixed range [ L ] 1 ,L h ]When the internal pressure is within the range:
R i >T R and L is 1 ≤L i ≤L h (1)
It is determined as the median filtered image I filt There is a fixed region Rect for calculating the amount of displacement of the bubble, and the contour satisfying the formula (1) is set as the contour C of the fixed region Rect R Continuing to perform subsequent processing; otherwise, judging the image I to be a median filtered image I filt The contour of the fixed area for calculating the bubble offset does not exist, the information prompt of 'the bubble is not in the current image' is given, and the subsequent processing is not carried out any more.
And 5: if a fixed area for calculating the bubble offset exists, the fixed area for calculating the bubble offset is subjected to outward expansion to obtain an interested area
If the median value is filtered image I filt In which there is a fixation of the calculated bubble offsetArea outline C R Then, first, the contour C of the fixed region is obtained R Is a circumscribed rectangle R Max As shown in fig. 6. Then the rectangle R Max Extending a certain distance iOffset upwards, downwards, leftwards and rightwards to obtain a rectangle R N . Will rectangle R N Image I after median filtering filt Area image I contained in roi Median filtered image I as region of interest image filt Extracted from the image I of the region of interest roi As shown in fig. 7. Meanwhile, setting a region of interest image I roi The coordinate of the first pixel point at the top left corner in the original gray level image src is (TL) x ,TL y )。
Step 6: the inclination angle of the minimum circumscribed rectangle of the fixed region for calculating the bubble offset and the ratio of the area of the region surrounded by the outline of the fixed region to the area of the minimum circumscribed rectangle of the outline of the fixed region are obtained, and the offset position of the bubble is judged according to the inclination angle and the ratio
Calculating a fixed region contour C R And the minimum circumscribed rectangle MER and the constant area profile C R The ratio R of the Area actually enclosed to the minimum circumscribed rectangle Area of the Area actually enclosed judges the current position of the bubble, and if R is larger than a certain fixed value T RN If so, judging that the air bubble is outside the fixed area for calculating the air bubble offset; with the bubble outside, the tilt angle of the fixed area from which the amount of bubble displacement is calculated can be used. Judging which side the bubbles are on; if theta is greater than theta<45 degrees, the air bubble is on the left side outside the fixed area for calculating the air bubble offset, and an information prompt that the air bubble is on the left side of the fixed area is given; otherwise, the bubble is outside the fixed area of the calculated bubble offset, and the right side of the fixed area is provided with the information prompt that the bubble is at the right side of the fixed area.
And 7: if the air bubbles enter the fixed area range for calculating the air bubble offset, calculating the horizontal physical distance between the center of the minimum external rectangle of the crescent area and the center of the minimum external rectangle of the fixed area generated by reflecting light of the air bubbles, and roughly measuring the offset of the air bubbles
If the bubble begins to enter the fixed area Rect for calculating the bubble offset, firstly, a crescent area caused by the reflection of the bubble is searchedDomain R M (ii) a In a region of interest image I roi The 0 stroke is searched from left to right and from top to bottom, wherein the 0 stroke is a pixel segment formed by continuous pixels of which the pixel value of each row is 0; if the length RL of a certain 0 stroke satisfies the requirement of belonging to a certain interval Th 1 ,Th h ]When the method is as follows:
Th 1 ≤RL≤Th h (2)
the short 0 pass is eliminated, i.e., all black pixels in the pass are changed to white pixels. All short 0 strokes satisfying the formula (2) are eliminated to obtain an image bI roi As shown in fig. 8. In the image bI roi If the length W of the long side of the minimum bounding rectangle of the contour is detected f Satisfying equation (3), and such contours have only 1, it is determined that the crescent-shaped region R exists M :
W 1 <W f <W h (3)
Wherein, W 1 And W h The length of the long side of the rectangle which is minimum circumscribed by the outline in the interested image is taken as a lower limit value and an upper limit value.
Crescent-shaped region R if present M Profile C of M Then, the crescent-shaped region R is obtained M Minimum circumscribed rectangle M of m As shown in fig. 9, the minimum bounding rectangle M of the crescent-shaped region m Is set as M c ,M c In a region of interest image I roi The abscissa of (A) is set as MC x Then the center M of the minimum circumscribed rectangle of the crescent area c Abscissa M in original grayscale image src x Comprises the following steps:
M x =MC x +TL x (4)
wherein, TL x For an image I of a region of interest roi The abscissa of the first pixel point in the top left corner of the original grayscale image src.
Setting the center of the minimum circumscribed rectangle MER of the fixed region Rect for calculating the bubble offset as ME c ,ME c The abscissa in the original grayscale image src is ME x (ii) a By usingMinimum circumscribed rectangle center abscissa ME of fixed region for calculating bubble offset x An abscissa M of a center of a rectangle circumscribed to the crescent region outline in the original gray level image src x Difference value DeltaX between 1 To indicate the amount of displacement of the bubble in the image, in units of pixel:
△X 1 =ME x -M x (5)
if Δ X>0, the bubble is left; otherwise, the bubble is deflected to the right. Roughly calculating the physical bubble offset dR according to the image calibration result Res in mm/pixel 1 The unit is mm:
dR 1 =|△X 1 |×Res (6)
wherein |. DELTA.X 1 | represents Δ X 1 Absolute value of (d);
if Δ X 1 >0, giving an information prompt of 'the bubble is deviated from the left by XX mm'; otherwise, giving an information prompt of 'the air bubble is deviated from the right by XX mm', wherein XX is dR 1 The value of (c).
And 8: if the horizontal physical distance between the center of the minimum external rectangle of the crescent area and the center of the minimum external rectangle of the fixed area for calculating the bubble offset is smaller than 1mm, calculating the horizontal physical distance between the center of the external rectangle surrounding the maximum outline of the bubble perimeter and the center of the minimum external rectangle of the fixed area, and accurately measuring the offset of the bubble
If the minimum external rectangle center M of the crescent area c ME (minimum bounding rectangle center) of fixed region for calculating bubble offset c Is less than a threshold value dT, i.e. | dR 1 |<dT, then filtering the image I from the median filt Middle cut fixed area outline C R Is a circumscribed rectangle R Max The image of the corresponding area is inverted to obtain an inverted image I sub As shown in fig. 10; for image I sub Detecting the contour and extracting the contour C with the maximum perimeter B Contour C B Namely the bubble profile; calculating the bubble profile C B Is a circumscribed rectangle R B As shown in FIG. 11, the bubble outline circumscribes a rectangle R B Center MB of (1) c Has an abscissa of MB x The outline of the bubble circumscribes the center MB of the rectangle c Abscissa M in original grayscale image src b Comprises the following steps:
M b =MB x +TL N (7)
wherein, TL N As an image I sub The abscissa of the first pixel point in the top left corner of the original grayscale image src.
Fixed region circumscribed rectangle center abscissa ME for calculating bubble offset x Abscissa M of the center of a rectangle circumscribing the bubble outline in the original gray image src b Difference of (A) Δ X 2 To indicate the bubble offset, in units of pixel:
△X 2 =ME x -M b (8)
according to the image calibration result Res in mm/pixel), accurately calculating the physical bubble offset dR 2 In mm:
dR 2 =|△X 2 |×Res (9)
wherein |. DELTA.X 2 | represents Δ X 2 The absolute value of (c).
If dR is 2 >0, giving an information prompt of 'the air bubble is deviated from the left by XX mm'; otherwise, giving an information prompt of 'the air bubble is deviated from right XX mm'; wherein XX is dR 2 Absolute value of (d); when | dR 2 |<And at TP, judging that the air bubble is positioned at the center of the tube level, and giving a qualified information prompt, wherein TP is the maximum allowable error of the given air bubble offset.
Claims (8)
1. A method for automatically measuring the bubble offset of a pipe level is characterized by comprising the following steps:
step 1, reading an original gray image of a bubble of a pipe level;
step 2: carrying out binarization and median filtering processing on the original gray level image;
and step 3: carrying out contour detection on the binary image after median filtering, and calculating the ratio of the area of the region surrounded by each contour to the minimum circumscribed rectangle area of each contour and the length of the long side of the minimum circumscribed rectangle of each contour;
and 4, step 4: judging whether a fixed region for calculating the bubble offset exists in the image or not by limiting the ratio of the area of the region surrounded by each outline to the area of the minimum circumscribed rectangle of each outline and the length of the long side of the minimum circumscribed rectangle of each outline;
and 5: if a fixed area for calculating the bubble offset exists, carrying out external expansion on the fixed area for calculating the bubble offset to obtain an interested area;
step 6: calculating the inclination angle of the minimum circumscribed rectangle of the fixed region for calculating the bubble offset, and the ratio of the area of the region surrounded by the outline of the fixed region to the area of the minimum circumscribed rectangle of the outline of the fixed region, and judging the offset position of the bubble according to the inclination angle and the ratio;
and 7: if the bubbles enter the range of the fixed area for calculating the bubble offset, calculating the horizontal physical distance between the center of the minimum external rectangle of the crescent area generated by reflecting light of the bubbles and the center of the minimum external rectangle of the fixed area, and roughly measuring the offset of the bubbles;
and 8: and if the horizontal physical distance between the center of the minimum external rectangle of the crescent area and the center of the minimum external rectangle of the fixed area for calculating the bubble offset is very small, calculating the horizontal physical distance between the center of the external rectangle surrounding the maximum outline of the bubble perimeter and the center of the minimum external rectangle of the fixed area, and accurately measuring the offset of the bubble.
2. The method for automatically measuring the bubble offset of the pipe level according to claim 1, wherein the step 2 is specifically performed according to the following procedures:
carrying out binarization segmentation processing on the original gray level image src by adopting an OTSU method to obtain a binarization image BI; median filtering is carried out on the BI by adopting a 5 multiplied by 5 window to remove noise, and a filtered image I is obtained filt 。
3. The method for automatically measuring the bubble offset of the pipe level according to claim 1, wherein the step 3 is specifically performed according to the following steps:
for filtered image I filt Contour detection is carried out, and a median filtered image I is calculated filt Of each contour C i Actual Area of enclosure Area of i The ratio R of the minimum circumscribed rectangular area i And length L of the long side of the minimum bounding rectangle i Wherein I =1,2, 3.. And N, N is the median filtered image I filt The number of the middle outlines.
4. The method for automatically measuring the bubble offset of the pipe level according to claim 1, wherein the step 4 is specifically performed according to the following procedures:
the ratio C of the area surrounded by each contour obtained in the step 3 to the minimum circumscribed rectangle area of each contour i And length L of long side of minimum circumscribed rectangle of each outline i Limiting when the ratio C is i Greater than a certain constant value T R And the length L of the long side i Within a certain fixed range [ L 1 ,L h ]When the internal pressure is within the range:
R i >T R and L is 1 ≤L i ≤L h (1)
It is determined as the median filtered image I filt There is a fixed region Rect in which to calculate the bubble offset, and the contour satisfying the formula is set to the contour C of the fixed region Rect R Continuing to perform subsequent processing; otherwise, judging the image I after median filtering filt The contour of a fixed area for calculating the bubble offset does not exist, and the information prompt of 'the bubble is not in the current image' is given, so that the subsequent processing is not performed any more.
5. The method for automatically measuring the bubble offset of the pipe level according to claim 1, wherein the step 5 is specifically performed according to the following steps:
if the median value is filtered image I filt In which there is a fixed area contour C for calculating the amount of bubble offset R Then, first, the contour C of the fixed region is obtained R Is a circumscribed rectangle R Max Then, the rectangle R is put Max Extending a certain distance iOffset upwards, downwards, leftwards and rightwards to obtain a rectangle R N Will be rectangular R N Image I after median filtering filt Area image I contained in roi Median filtered image I as region of interest image filt Extracting; meanwhile, setting a region of interest image I roi The coordinate of the first pixel point at the top left corner in the original gray level image src is (TL) x ,TL y )。
6. The method for automatically measuring the bubble offset of the pipe level according to claim 1, wherein the step 6 is specifically performed according to the following steps:
calculating a fixed region contour C R And the minimum circumscribed rectangle MER and the constant area profile C R The ratio R of the Area actually surrounded to the minimum circumscribed rectangle Area of the Area is used for judging the current position of the bubble, and if R is larger than a certain fixed value T RN If so, judging that the air bubble is outside the fixed area for calculating the air bubble offset; when the air bubble is on the outer side, the air bubble on which side is positioned can be judged according to the inclination angle of the fixed area for calculating the offset of the air bubble; if theta is greater than theta<45 degrees, the air bubble is on the left side outside the fixed area for calculating the air bubble offset, and an information prompt that the air bubble is on the left side of the fixed area is given; otherwise, the bubble is outside the fixed area of the calculated bubble offset and is on the right side, and an information prompt that the bubble is on the right side of the fixed area is given.
7. The method for automatically measuring the bubble offset of the pipe level according to claim 1, wherein the step 7 is specifically performed according to the following steps:
if the bubble begins to enter the fixed area Rect for calculating the bubble offset, firstly, a crescent area R caused by bubble reflection is searched M (ii) a In a region of interest image I roi The 0 stroke is searched from left to right and from top to bottom, wherein the 0 stroke is a pixel segment formed by continuous pixels of which the pixel values of each row are 0; if a certain 0 lineThe length of the range RL satisfies the requirement of belonging to a certain interval Th 1 ,Th h ]When, namely:
Th 1 ≤RL≤Th h (2)
the short 0 stroke is eliminated, namely all black pixels in the stroke are changed into white pixels; all short 0 strokes satisfying the formula (2) are eliminated to obtain an image bI roi (ii) a In the image bI roi If the length W of the long side of the minimum bounding rectangle of the contour is detected f Satisfying equation (3), and such contours have only 1, it is determined that the crescent-shaped region R exists M :
W 1 <W f <W h (3)
Wherein, W f And W h The lower limit value and the upper limit value of the length of the long side of the outline minimum circumscribed rectangle in the interested image are set;
if there is a crescent shaped region R M Is (C) M Then, the crescent-shaped region R is obtained M Minimum circumscribed rectangle M of m The minimum external rectangle M of the crescent area m Is set as M c ,M c In a region of interest image I roi The abscissa of (A) is set as MC x Then the center M of the minimum circumscribed rectangle of the crescent area c Abscissa M in original grayscale image src x Comprises the following steps:
M x =MC x +TL x (4)
wherein, TL x For an image I of a region of interest roi The abscissa of the first pixel point at the top left corner in the original gray level image src;
setting the center of the minimum circumscribed rectangle MER of the fixed region Rect for calculating the bubble offset as ME c ,ME c The abscissa in the original grayscale image src is ME x (ii) a With minimum circumscribed rectangle center abscissa ME of fixed area for calculating bubble offset x An abscissa M of a center of a rectangle circumscribed to the crescent region outline in the original gray level image src x Difference value DeltaX between 1 To indicate the amount of displacement of the bubble in the image, in units of pixel:
△X 1 =ME x -M x (5)
If Δ X>0, the bubble is left; otherwise, the bubble is deflected to the right; roughly calculating the physical bubble offset dR according to the image calibration result Res in mm/pixel 1 In mm:
dR 1 =|△X 1 |×Res (6)
wherein |. DELTA.X 1 | represents Δ X 1 Absolute value of (d);
if Δ X 1 >0, giving an information prompt of 'the air bubble is deviated from the left by XX mm'; otherwise, giving an information prompt of 'the air bubble is deviated from right XX mm'; wherein XX is dR 1 The value of (c).
8. The method as claimed in claim 1, wherein the step 8 is performed according to the following steps:
if the minimum external rectangle center M of the crescent area c ME (minimum bounding rectangle center) of fixed region for calculating bubble offset c Is less than a threshold value dT, i.e. | dR 1 |<dT, then image I filtered from the median filt Middle cut fixed area outline C R Is a circumscribed rectangle R Max The image of the corresponding area is inverted to obtain an inverted image I sub (ii) a For image I sub Detecting the contour and extracting the contour C with the maximum perimeter B Contour C B Namely the bubble profile; calculating the bubble profile C B Is a circumscribed rectangle R B The outline of the bubble is circumscribed by a rectangle R B Center MB of c The abscissa of (a) is set as MB x The outline of the bubble circumscribes the center MB of the rectangle c Abscissa M in original grayscale image src b Comprises the following steps:
M b =MB x +TL N (7)
wherein, TL N Is an image I sub The first pixel point at the top left corner of the original gray image src sits transverselyMarking;
fixed region circumscribed rectangle center abscissa ME for calculating bubble offset x Abscissa M of the center of the rectangle circumscribing the bubble outline in the original grayscale image src b Difference of (A) Δ X 2 To represent the bubble offset, in pixel:
△X 2 =ME x -M b (8)
accurately calculating the physical bubble offset dR according to the image calibration result Res in mm/pixel 2 In mm:
dR 2 =|△X 2 |×Res (9)
wherein |. DELTA.X 2 | represents Δ X 2 Absolute value of (d);
if dR 2 >0, giving an information prompt of 'the air bubble is deviated from the left by XX mm'; otherwise, giving an information prompt of 'the air bubble is deviated from the right by XX mm', wherein XX is dR 2 Absolute value of (d); when | dR 2 |<And at TP, judging that the air bubble is positioned at the center of the tube level, and giving a qualified information prompt, wherein TP is the maximum allowable error of the given air bubble offset.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201810417199.6A CN108592948B (en) | 2018-04-28 | 2018-04-28 | Automatic measurement method for bubble offset of pipe level |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201810417199.6A CN108592948B (en) | 2018-04-28 | 2018-04-28 | Automatic measurement method for bubble offset of pipe level |
Publications (2)
Publication Number | Publication Date |
---|---|
CN108592948A CN108592948A (en) | 2018-09-28 |
CN108592948B true CN108592948B (en) | 2023-03-14 |
Family
ID=63620745
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201810417199.6A Active CN108592948B (en) | 2018-04-28 | 2018-04-28 | Automatic measurement method for bubble offset of pipe level |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN108592948B (en) |
Families Citing this family (7)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN109886911B (en) * | 2018-10-09 | 2020-12-18 | 中国计量大学 | Leveling bubble reticle defect detection method based on image processing technology |
CN109883396B (en) * | 2018-10-09 | 2020-11-24 | 中国计量大学 | Leveling bubble reticle width measuring method based on image processing technology |
CN109900302A (en) * | 2019-04-09 | 2019-06-18 | 中国计量大学 | A kind of more groove level tube bubbles error vision measuring method placed in the middle |
CN112254744A (en) * | 2020-10-23 | 2021-01-22 | 广州计量检测技术研究院 | Bubble level meter calibration method, system, device and storage medium |
CN113124898B (en) * | 2021-03-03 | 2022-12-23 | 上海大学 | Pipe level device position precision measuring method based on image processing |
CN114018289B (en) * | 2021-11-08 | 2022-06-10 | 河北省科学院应用数学研究所 | Level detection method and device |
CN116592835B (en) * | 2023-07-18 | 2023-10-27 | 聊城金恒智慧城市运营有限公司 | Intelligent construction leveling instrument and measuring method |
Citations (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN1402853A (en) * | 1999-12-02 | 2003-03-12 | 三菱电机株式会社 | Image retrieval system and image retrieval method |
CN102739951A (en) * | 2011-04-06 | 2012-10-17 | 富士施乐株式会社 | Image processing apparatus, image processing method, and program |
CN103206947A (en) * | 2012-01-16 | 2013-07-17 | 中国科学院声学研究所 | Tilt angle measurement method based on level bubble, and apparatus thereof |
CN106289325A (en) * | 2016-09-23 | 2017-01-04 | 浙江大学 | A kind of air-bubble level automatic checkout system |
CA3036332A1 (en) * | 2016-09-25 | 2018-03-29 | Israel Aerospace Industries Ltd. | Method of calibrating a computerized leveling offset meter |
-
2018
- 2018-04-28 CN CN201810417199.6A patent/CN108592948B/en active Active
Patent Citations (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN1402853A (en) * | 1999-12-02 | 2003-03-12 | 三菱电机株式会社 | Image retrieval system and image retrieval method |
CN102739951A (en) * | 2011-04-06 | 2012-10-17 | 富士施乐株式会社 | Image processing apparatus, image processing method, and program |
CN103206947A (en) * | 2012-01-16 | 2013-07-17 | 中国科学院声学研究所 | Tilt angle measurement method based on level bubble, and apparatus thereof |
CN106289325A (en) * | 2016-09-23 | 2017-01-04 | 浙江大学 | A kind of air-bubble level automatic checkout system |
CA3036332A1 (en) * | 2016-09-25 | 2018-03-29 | Israel Aerospace Industries Ltd. | Method of calibrating a computerized leveling offset meter |
Non-Patent Citations (1)
Title |
---|
一种基于图像处理的水平尺气泡偏移量检测系统;单晓杭,范超;《计算机应用与软件》;20171130;第34卷(第11期);全文 * |
Also Published As
Publication number | Publication date |
---|---|
CN108592948A (en) | 2018-09-28 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN108592948B (en) | Automatic measurement method for bubble offset of pipe level | |
CN108534802B (en) | Tube level bubble deviation measurement method based on image processing technology | |
CN108613630B (en) | Two-wire tube level bubble offset measurement method based on image processing technology | |
CN108876860B (en) | Image calibration method for measuring bubble offset of tube level | |
CN109003258B (en) | High-precision sub-pixel circular part measuring method | |
CN107798672B (en) | Method and system for measuring width of cut tobacco or cut stem and server with system | |
CN109190628A (en) | A kind of plate camber detection method based on machine vision | |
EP2500686A1 (en) | Device and method for inspecting tyre shape | |
CN115908411B (en) | Concrete curing quality analysis method based on visual detection | |
CN109409290B (en) | Thermometer verification reading automatic identification system and method | |
CN110838097A (en) | Conveyor belt offset measurement method based on machine vision | |
CN109883396B (en) | Leveling bubble reticle width measuring method based on image processing technology | |
CN111862055B (en) | Bubble turning cavity defect detection method based on image processing | |
CN116165216B (en) | Liquid crystal display micro scratch flaw 3D detection method, system and computing equipment | |
CN108895959A (en) | A kind of camera calibration plate angle point calculating method based on sub-pix | |
CN113643276A (en) | Textile texture defect automatic detection method based on statistical analysis | |
CN113160223A (en) | Contour determination method, contour determination device, detection device and storage medium | |
CN116468687A (en) | Scratch defect detection method and device, storage medium and electronic equipment | |
CN114078220B (en) | Tray identification method based on depth camera | |
CN111882569A (en) | Machine vision-based pointer type pressure gauge automatic calibrator indication value reading method | |
CN109141829B (en) | Target line definition calculation and industrial camera rear intercept detection method | |
CN113902894A (en) | Strip type level meter automatic reading identification method based on image processing | |
CN109886911B (en) | Leveling bubble reticle defect detection method based on image processing technology | |
CN117291893A (en) | Tire tread wear degree detection method based on 3D image | |
CN115761468A (en) | Water level detection system and method based on image segmentation and target detection technology |
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 | ||
GR01 | Patent grant | ||
GR01 | Patent grant |