CN110930407B  Suspension gap visual detection method based on image processing  Google Patents
Suspension gap visual detection method based on image processing Download PDFInfo
 Publication number
 CN110930407B CN110930407B CN202010082108.5A CN202010082108A CN110930407B CN 110930407 B CN110930407 B CN 110930407B CN 202010082108 A CN202010082108 A CN 202010082108A CN 110930407 B CN110930407 B CN 110930407B
 Authority
 CN
 China
 Prior art keywords
 image
 gap
 suspension
 region
 pixel
 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
 239000000725 suspensions Substances 0.000 title claims abstract description 133
 230000000007 visual effect Effects 0.000 title claims abstract description 18
 238000001514 detection method Methods 0.000 title claims abstract description 7
 238000004364 calculation methods Methods 0.000 claims description 13
 238000005192 partition Methods 0.000 claims description 12
 238000001914 filtration Methods 0.000 claims description 11
 230000000875 corresponding Effects 0.000 claims description 10
 238000005520 cutting process Methods 0.000 claims description 7
 230000011218 segmentation Effects 0.000 claims description 7
 239000000126 substances Substances 0.000 claims description 7
 230000002146 bilateral Effects 0.000 claims description 6
 238000000034 methods Methods 0.000 claims description 6
 238000005286 illumination Methods 0.000 claims description 4
 230000002708 enhancing Effects 0.000 claims description 3
 239000004576 sand Substances 0.000 claims description 2
 238000007689 inspection Methods 0.000 claims 6
 238000005339 levitation Methods 0.000 description 9
 238000006073 displacement reactions Methods 0.000 description 6
 238000005516 engineering processes Methods 0.000 description 6
 239000007787 solids Substances 0.000 description 5
 238000007667 floating Methods 0.000 description 4
 229910000831 Steel Inorganic materials 0.000 description 3
 238000006243 chemical reactions Methods 0.000 description 3
 238000010586 diagrams Methods 0.000 description 3
 230000000694 effects Effects 0.000 description 3
 239000010959 steel Substances 0.000 description 3
 239000003086 colorants Substances 0.000 description 2
 230000018109 developmental process Effects 0.000 description 2
 238000010191 image analysis Methods 0.000 description 2
 238000003709 image segmentation Methods 0.000 description 2
 239000011159 matrix materials Substances 0.000 description 2
 101710081353 andB Proteins 0.000 description 1
 230000004907 flux Effects 0.000 description 1
 230000005484 gravity Effects 0.000 description 1
 238000003711 image thresholding Methods 0.000 description 1
 239000010410 layers Substances 0.000 description 1
 239000002184 metals Substances 0.000 description 1
 238000007781 preprocessing Methods 0.000 description 1
 230000001737 promoting Effects 0.000 description 1
 238000005070 sampling Methods 0.000 description 1
 230000003746 surface roughness Effects 0.000 description 1
Classifications

 G—PHYSICS
 G06—COMPUTING; CALCULATING; COUNTING
 G06T—IMAGE DATA PROCESSING OR GENERATION, IN GENERAL
 G06T7/00—Image analysis
 G06T7/10—Segmentation; Edge detection
 G06T7/136—Segmentation; Edge detection involving thresholding

 G—PHYSICS
 G06—COMPUTING; CALCULATING; COUNTING
 G06T—IMAGE DATA PROCESSING OR GENERATION, IN GENERAL
 G06T7/00—Image analysis
 G06T7/0002—Inspection of images, e.g. flaw detection

 G—PHYSICS
 G01—MEASURING; TESTING
 G01B—MEASURING LENGTH, THICKNESS OR SIMILAR LINEAR DIMENSIONS; MEASURING ANGLES; MEASURING AREAS; MEASURING IRREGULARITIES OF SURFACES OR CONTOURS
 G01B11/00—Measuring arrangements characterised by the use of optical means
 G01B11/14—Measuring arrangements characterised by the use of optical means for measuring distance or clearance between spaced objects or spaced apertures

 G—PHYSICS
 G06—COMPUTING; CALCULATING; COUNTING
 G06T—IMAGE DATA PROCESSING OR GENERATION, IN GENERAL
 G06T7/00—Image analysis
 G06T7/10—Segmentation; Edge detection
 G06T7/11—Regionbased segmentation

 G—PHYSICS
 G06—COMPUTING; CALCULATING; COUNTING
 G06T—IMAGE DATA PROCESSING OR GENERATION, IN GENERAL
 G06T7/00—Image analysis
 G06T7/10—Segmentation; Edge detection
 G06T7/187—Segmentation; Edge detection involving region growing; involving region merging; involving connected component labelling

 G—PHYSICS
 G06—COMPUTING; CALCULATING; COUNTING
 G06T—IMAGE DATA PROCESSING OR GENERATION, IN GENERAL
 G06T7/00—Image analysis
 G06T7/70—Determining position or orientation of objects or cameras

 G—PHYSICS
 G06—COMPUTING; CALCULATING; COUNTING
 G06T—IMAGE DATA PROCESSING OR GENERATION, IN GENERAL
 G06T2207/00—Indexing scheme for image analysis or image enhancement
 G06T2207/10—Image acquisition modality
 G06T2207/10004—Still image; Photographic image

 G—PHYSICS
 G06—COMPUTING; CALCULATING; COUNTING
 G06T—IMAGE DATA PROCESSING OR GENERATION, IN GENERAL
 G06T2207/00—Indexing scheme for image analysis or image enhancement
 G06T2207/10—Image acquisition modality
 G06T2207/10024—Color image

 G—PHYSICS
 G06—COMPUTING; CALCULATING; COUNTING
 G06T—IMAGE DATA PROCESSING OR GENERATION, IN GENERAL
 G06T2207/00—Indexing scheme for image analysis or image enhancement
 G06T2207/20—Special algorithmic details
 G06T2207/20024—Filtering details
 G06T2207/20028—Bilateral filtering

 G—PHYSICS
 G06—COMPUTING; CALCULATING; COUNTING
 G06T—IMAGE DATA PROCESSING OR GENERATION, IN GENERAL
 G06T2207/00—Indexing scheme for image analysis or image enhancement
 G06T2207/20—Special algorithmic details
 G06T2207/20112—Image segmentation details
 G06T2207/20132—Image cropping
Abstract
The invention discloses a suspension gap visual detection method based on image processing, which comprises the steps of firstly, obtaining an original highdefinition image of a suspension gap area, and processing to obtain a binary image of a suspension gap interesting area; then, the number of pixel points with the binarization result of 1 in the suspension gap interesting region binarization image is calculated to obtain the pixel area of the suspension gap interesting regions(ii) a Finally, the pixel area is determinedsCalibrating the actual gap distance, and calculating the actual gap distanced. The method has the advantages that the actual gap distance calculated according to the image pixel area of the suspension gap interesting region is high in measurement precision and strong in antiinterference capability, and can effectively remove asymmetric interference existing in the suspension gap interesting region and alarm and position the interference fault position; the actual suspension gap distance change is calculated through the suspension gap interesting region image pixel area change, the tracking is sensitive, the linearity is high, and the realtime performance and the accuracy can meet the requirements of a suspension ball control system.
Description
Technical Field
The invention relates to the technical field of magnetic suspension technology and image processing, in particular to a suspension gap highprecision visual detection method based on image processing.
Background
The suspension gap signal detection is an important ring for closedloop control of a magnetic suspension system, and the magnetic suspension system adjusts the electromagnetic force through realtime feedback of the gap signal so that a controlled object overcomes the gravity and is stabilized at a balance position. The accuracy and realtime performance of suspension gap signal detection directly affect the control performance of the magnetic suspension system. In the magnetic levitation ball system, the levitation gap actually refers to the distance from the top point of the levitation steel ball to the lower surface of the electromagnet, so the gap sensor is essentially a displacement sensor.
Common displacement sensors mainly include eddy current type, capacitance type, photoelectric type and pressure type. When the magnetic levitation ball system is in a levitation state, the steel ball and the electromagnet are not in any mechanical contact, and the magnetic levitation ball system belongs to noncontact displacement measurement, so that only a noncontact displacement sensor can be selected in a magnetic levitation application scene, and the pressure sensor belongs to a contact type displacement measurement sensor, so that the magnetic levitation ball system is not suitable for a levitation measurement system. Although the capacitive sensor has simple structure and low cost, the capacitive sensor needs higher power supply voltage and has larger nonlinear error. The eddy current sensor is widely applied to a suspension measurement system, but has many disadvantages and shortcomings, for example, the measurement accuracy is greatly influenced by temperature and the surface roughness of a measured object, temperature compensation and nonlinear correction are needed, the cost is high, and the output value of the eddy current sensor can be accessed to a control system only through A/D conversion. The photoelectric sensor measures the displacement of an object according to the amount of light flux blocked by the object to be measured, and has the biggest defects of easy interference and poor environmental adaptability.
The leadingedge research of computer vision is continuously making new breakthroughs, and the development and perfection of the digital image processing technology enable the digital image processing technology to be widely applied to the fields of national defense, scientific research, industry and the like, thereby promoting the social development progress. The visual ranging is carried out through the image processing technology and serves as an important research direction, and great effects are played in the fields of unmanned aerial vehicle obstacle avoidance, automatic driving, target detection and positioning, noncontact measurement and the like. The image processing visual ranging key researches the space position and the geometric dimension of an object, the measuring method is simple and reliable, the technical improvement space is large, and the future application scene can be wider along with the improvement of the computing capacity and the improvement of the hardware performance.
Disclosure of Invention
In view of the above problems, an object of the present invention is to provide a new method for performing high precision detection of a floating gap according to an image pixel area in a floating gap region based on an image processing technology, which achieves accurate measurement of the floating gap by visual ranging, has high linearity of a measurement result, and can directly access a control system without a/D conversion. The technical scheme is as follows:
a suspension gap visual detection method based on image processing comprises the following steps:
step 1: obtaining an original highdefinition image of a suspension gap region, and processing to obtain a binary image of the suspension gap regionofinterest;
step 2: obtaining the pixel area of the interested gap region by calculating the number of pixel points with the binarization result of 1 in the suspension gap interested region binarization images；
And step 3: area of pixelsAnd calibrating the actual gap distance, and calculating the actual gap distance:
step 31: obtaining the maximum working gap of the suspension ball system through image acquisition and processing according to the suspension working gap range of the suspension ball systemd _{ max }Timecorresponding suspension gap pixel area of region of interestAnd minimum working gapd _{ min }Pixel area of suspension gap interesting region corresponding to 0；
Step 32: by the formulaObtaining the calibration relation between the actual suspension gap distance and the pixel area, namely the actual gap distance corresponding to the unit pixel area,Pis a calibration coefficient;
step 33: obtaining the pixel area of the interested area of the suspension gap according to the image processingsBy the formulaCalculating the actual gap distanced。
Further, the step of processing to obtain a binarized image of the suspension gap region of interest is as follows:
step 11: carrying out suspension gap interested region image cutting operation on the original highdefinition image of the suspension gap region, wherein the upper boundary of the interested region is a straight line corresponding to the lower edge of the electromagnetl _{1}The lower boundary is the straight line of the diameter of the suspension ball in the horizontal directionl _{2}The left boundary is the left external tangent of the suspension ball in the vertical directionl _{3}The right boundary is the outer tangent line of the right side of the suspension ball in the vertical directionl _{4}Cutting according to the boundary range to obtain an interested area image;
step 12: carrying out graying operation on the original RGB mode color image of the suspension gap interesting region, and acquiring the gray value of each pixel point by adopting a weighted average method;
step 13: carrying out enhancement filtering operation on the gray level image, and obtaining an enhanced gray level image by adopting a bilateral filtering algorithm;
step 14: selecting an optimal threshold value by adopting a maximum interclass variance method according to an enhanced gray level image after image enhancement filteringTAnd performing optimal threshold segmentation binarization operation:
wherein the content of the first and second substances,f(i,j)is to enhance the gray scale image coordinates(i,j)The gray value of the pixel point is determined,g(i,j)the image is the image optimal threshold segmentation binarization result; according to the optimum threshold valueTAnd operating all pixel points of the enhanced gray level image, measuring that the binarization result of the background area is 1, namely white, and the binarization result of the foreground target area is 0, namely black, so as to obtain the suspension gap regionofinterest binarization image.
Further, the pixel area of the region of interest of the suspension gap is calculatedsThe process is as follows:
step 21: positioned to the upper vertex of the levitated ballT _{ 0 }Using the bilateral symmetry of the region to be measured to passT _{ 0 }Vertical center line of pointI _{0}Dividing the binary image of the suspension gap region of interest into four subarea images with equal width in the horizontal direction as a symmetry axisA _{1}、A _{2}、A _{3}AndA _{4}outside ofA _{1}AndA _{4}two partitions aboutI _{0}Symmetrical, middleA _{2}AndA _{3}two partitions aboutI _{0}Symmetry;
step 22: defining the number of pixel points with binarization result of 1 in the suspension gap regionofinterest binarized image as the pixel areasCalculating four divisional images respectivelyA _{1}、A _{2}、A _{3}AndA _{4}pixel area of、、And；
step 23: the pixel area is set to be calculated in the manner ofs= +，Is an outer sideA _{1}AndA _{4}the sum of the pixel areas of the two subregions is calculated as the initial value=，Is a middleA _{2}AndA _{3}the sum of the pixel areas of the two subregions is set in the way of calculating the initial value = ；
Step 24: setting an upper thresholdT _{ h1 }And a lower thresholdT _{ h2 }，0<T _{ h2 }<T _{ h1 }(ii) a Selecting and calculating according to the relationship between the pixel area difference value of the symmetric region and the upper and lower limit thresholdsAndthe manner of (a);
(a) for symmetric partitionsA _{1}AndA _{4}calculatingThe  result is merged with the upper thresholdT _{ h1 }And a lower thresholdT _{ h2 }Performing a hysteresis threshold comparison:
if does≥T _{ h1 }Then, obvious asymmetric interference exists in the image gap part of the partial suspension gap interesting region; if it is not≥The interference position appears inA _{4}Partition, at this time set = (ii) a Otherwise, the interference position appears inA _{1}Partition, at this time set = ；
If does≤T _{ h2 }Then the image of the interested area of the partial suspension gap has no obvious interference, and the setting is carried out at the moment=；
If it isT _{ h2 }<<T _{ h1 }At this time, the calculation method of the original pixel area is kept unchanged=；
(b) For symmetric partitionsA _{2}AndA _{3}calculatingThe  result is merged with the upper thresholdT _{ h1 }And a lower thresholdT _{ h2 }Performing a hysteresis threshold comparison:
if does≥T _{ h1 }Then, obvious asymmetric interference exists in the image gap part of the partial suspension gap interesting region; if it is not≥The interference position appears inA _{3}Partition, at this time set = (ii) a Otherwise, the position is disturbedAppear atA _{2}Partition, at this time set = ；
If does≤T _{ h2 }Then the image of the interested area of the partial suspension gap has no obvious interference, and the setting is carried out at the moment = ；
If it isT _{ h2 }<<T _{ h1 }At this time, the original pixel area calculation mode is kept unchanged: = 。
furthermore, when the suspension gap interesting area image gap part has obvious asymmetric interference, the system alarms the interference fault and positions the interference position:
step A: by formula calculation aboutI _{0}Differential image of twovalued image of symmetric left and right partsThe formula is as follows:
wherein the content of the first and second substances,d(i,j)is thatiLine ofjThe difference result of the pixel points at the column position is obtained if the size of the suspension gap regionofinterest binary image is equal toMLine ofNRow, theniThe value range is [ 2 ]1,M]，jHas a value range of [, ]1,N]；g(i,j)Is the coordinates of the pixel points of the binary image(i,j)The gray value of the pixel point is determined,g(i,j’)is the coordinates of the pixel points of the binary image(i,j’)Gray value of pixel point, pixel point coordinate(i,j)And(i,j’)aboutI _{0}Leftright symmetry;
and B: obtaining the outline of the interference position through an outline searching function according to the obtained difference image, further drawing a minimum circumscribed rectangle of the outline, and recording the geometric parameters of a circumscribed rectangle frame containing the area as interference position information;
and C: setting alarm thresholdsT _{ e }Calculating the minimum circumscribed rectangular area of the interference positionS _{ e }When is coming into contact withS _{ e }≥T _{ e }And then, the system alarms the interference fault and reports fault position information.
Furthermore, the edge of the target floating ball to be detected is characterized by an arc shape.
Further, the annular LED light source is arranged to provide appropriate illumination intensity.
Furthermore, the foreground object and the background with color contrast are arranged, so that the contrast between the measured background and the foreground object is more prominent, and the colors of the electromagnets in the foreground object are close to those of the suspension ball.
Furthermore, when the original highdefinition image of the suspension gap area is obtained, the industrial camera is fixedly installed, the lower boundary of the electromagnet is clearly imaged into a straight line by adjusting the position and the focal length of the camera, and the relative position of the industrial camera and the electromagnet is guaranteed to be unchanged in the visual measurement process.
The invention has the beneficial effects that: the suspension gap detection method based on the image processing technology is simple and reliable, is convenient to calibrate, has high measurement precision and strong antiinterference capability for calculating the actual gap distance according to the image pixel area of the suspension gap interesting region, can effectively remove asymmetric interference existing in the suspension gap interesting region and simultaneously alarms and positions the interference fault position; compared with the common eddy current sensor, the special metal bottom surface for the suspension ball is not required to be matched with the sensor, and the measurement is simple. The invention calculates the actual suspension gap distance change through the suspension gap interesting region image pixel area change, has sensitive tracking and high linearity, can be directly accessed into a control system without A/D conversion, and can meet the requirements of a suspension ball control system on instantaneity and accuracy.
Drawings
Fig. 1 is an image processing flowchart of an image processing unit.
FIG. 2 is a schematic diagram of a pixel area calculation method for a gap region of interest.
Fig. 3 is a flow chart of the calculation of the pixel area of the gap region of interest.
FIG. 4 is a schematic diagram of a pixel area and actual gap distance calibration method.
Fig. 5 is a schematic diagram of an example of the variation of pixel area with gap within a single pixel distance.
Fig. 6 is a graph of an example of pixel area versus gap for a single pixel distance.
Detailed Description
The invention is described in further detail below with reference to the figures and specific embodiments. The method comprises the steps of acquiring a highdefinition image of a suspension gap area in real time through a highspeed industrial camera, calculating the pixel area of the suspension gap area of interest according to a binarized image of the suspension gap area of interest after image processing to obtain a corresponding actual suspension gap distance, and realizing highprecision measurement of the suspension gap.
In order to reduce the difficulty of postimage processing and further improve the precision of gap measurement, the embodiment requires that a foreground target and a background with color contrast are selected, so that the contrast between the measured background and the foreground target is more prominent, and the colors of the electromagnets in the foreground target and the suspended ball are close to each other. Meanwhile, in order to improve the problem of uneven image illumination, the annular LED light source is preferably arranged to provide proper illumination intensity. The industrial camera is fixedly installed, the lower boundary of the electromagnet is clearly imaged into a straight line by adjusting the position and the focal length of the camera, and the relative position of the industrial camera and the electromagnet is guaranteed to be unchanged in the visual measurement process.
The method comprises the following specific steps:
step 1: the method comprises the steps of continuously acquiring an original highdefinition image of a suspension gap area in real time through a highspeed industrial camera, sending the original highdefinition image of the suspension gap area to an image processing unit in real time for image processing, and obtaining a binary image of the suspension gap area of interest after image area of interest cutting, image graying, image enhancement filtering, image optimal threshold segmentation binarization sequentially, wherein the image processing flow of the image processing unit is shown in an attached figure 1. The method comprises the following specific steps:
step 11: carrying out suspension gap interested region image cutting operation on the original highdefinition image of the suspension gap region, wherein the upper boundary of the interested region is a straight line corresponding to the lower edge of the electromagnetl _{1}The lower boundary is the straight line of the diameter of the suspension ball in the horizontal directionl _{2}The left boundary is the left external tangent of the suspension ball in the vertical directionl _{3}The right boundary is the outer tangent line of the right side of the suspension ball in the vertical directionl _{4}And cutting the region of interest according to the boundary range to obtain the region of interest image. The image cropping is a key step of image preprocessing, and the number of pixel points of subsequent image processing and operation is reduced by cropping the image, so that the image processing operation speed is increased. The regionofinterest image cropped in this embodiment is shown in the dotted line box of fig. 2 and 4.
Step 12: and carrying out graying operation on the suspension gap regionofinterest image to prepare for upper layer operations such as subsequent image segmentation and image analysis. The original highdefinition image is a threechannel color image in an RGB mode, and the gray value of each pixel point is obtained by adopting a weighted average method:
wherein the content of the first and second substances,f(i,j)is a gray scale image coordinate(i,j)The gray value of the pixel point is determined,R(i,j)、G(i,j)andB(i,j)is the gray value of each color channel of the original RGB mode color image.
Step 13: the image enhancement filtering is indispensable operation in image processing, aims to inhibit image noise on the premise of not damaging the image contour and the edge, directly influences the reliability of subsequent image analysis due to the good and bad effect of the image enhancement filtering, and obtains an enhanced gray image after the gray image is enhanced and filtered by adopting a bilateral filtering algorithm.
Step 14: the best threshold segmentation binarization operation is carried out on the enhanced gray level image, and the threshold processing is visual, simple to implement and high in calculation speed, so that the image segmentation is realized by adopting the image threshold processing. Selecting an optimal threshold value by adopting a maximum interclass variance method according to an enhanced gray level image after image enhancement filteringT。
The image thresholding operation can be functionally represented as:
wherein the content of the first and second substances,f(i,j)is to enhance the gray scale image coordinates(i,j)The gray value of the pixel point is determined,g(i,j)the image is the image optimal threshold segmentation binarization result; according to the optimum threshold valueTAnd operating all pixel points of the enhanced gray level image, measuring that the binarization result of the background area is 1, namely white, and the binarization result of the foreground target area is 0, namely black, so as to obtain the suspension gap regionofinterest binarization image.
Step 2: obtaining the pixel area of the interested gap region by calculating the number of pixel points with the binarization result of 1 in the suspension gap interested region binarization images。
As shown in fig. 2, the pixel area of the suspension gap region of interest is calculatedsThe method (the calculation flow chart is shown in the attached figure 3):
step 21: positioned to the upper vertex of the levitated ballT _{ 0 }Using the bilateral symmetry of the region to be measured to passT _{ 0 }Vertical center line of pointI _{0}Dividing the binary image of the suspension gap region of interest into four subarea images with equal width in the horizontal direction as a symmetry axisA _{1}、A _{2}、A _{3}AndA _{4}outside ofA _{1}AndA _{4}two partitions aboutI _{0}Symmetrical, middleA _{2}AndA _{3}two partitions aboutI _{0}Symmetry;
step 22: defining the number of pixel points with binarization result of 1 in the suspension gap regionofinterest binarized image as the pixel areasCalculating four divisional images respectivelyA _{1}、A _{2}、A _{3}AndA _{4}pixel area of、、And；
step 23: the pixel area is set to be calculated in the manner ofs= +，Is an outer sideA _{1}AndA _{4}the sum of the pixel areas of the two subregions is calculated as the initial value=，Is a middleA _{2}AndA _{3}the sum of the pixel areas of the two subregions is set in the way of calculating the initial value = ；
Step 24: setting an upper thresholdT _{ h1 }And a lower thresholdT _{ h2 }，0<T _{ h2 }<T _{ h1 }(ii) a Selecting and calculating according to the relationship between the pixel area difference value of the symmetric region and the upper and lower limit thresholdsAndthe manner of (a);
(a) for symmetric partitionsA _{1}AndA _{4}calculatingThe  result is merged with the upper thresholdT _{ h1 }And a lower thresholdT _{ h2 }Performing a hysteresis threshold comparison:
if does≥T _{ h1 }Then, obvious asymmetric interference exists in the image gap part of the partial suspension gap interesting region; if it is not≥The interference position appears inA _{4}Partition, at this time set = (ii) a Otherwise, the interference position appears inA _{1}Partition, at this time set = ；
If does≤T _{ h2 }Then the image of the interested area of the partial suspension gap has no obvious interference, and the setting is carried out at the moment=；
If it isT _{ h2 }<<T _{ h1 }At this time, the calculation method of the original pixel area is kept unchanged=；
(b) For symmetric partitionsA _{2}AndA _{3}calculatingThe  result is merged with the upper thresholdT _{ h1 }And a lower thresholdT _{ h2 }Performing a hysteresis threshold comparison:
if does≥T _{ h1 }Then, obvious asymmetric interference exists in the image gap part of the partial suspension gap interesting region; if it is not≥The interference position appears inA _{3}Partition, at this time set = (ii) a Otherwise, the position is disturbedAppear atA _{2}Partition, at this time set = ；
If does≤T _{ h2 }Then the image of the interested area of the partial suspension gap has no obvious interference, and the setting is carried out at the moment = ；
If it isT _{ h2 }<<T _{ h1 }At this time, the original pixel area calculation mode is kept unchanged: = 。
when the suspension gap interesting area image has obvious asymmetric interference, the system has the functions of interference fault alarm and interference position positioning, and the specific process is as follows:
step A: by formula calculation aboutI _{0}Difference image of twovalued image of symmetric left and right partsThe formula is as follows:
wherein the content of the first and second substances,d(i,j)is thatiLine ofjThe difference result of the pixel points at the column position is obtained if the size of the suspension gap regionofinterest binary image is equal toMLine ofNRow, theniThe value range is [ 2 ]1,M]，jHas a value range of [, ]1,N]；g(i,j)Is the coordinates of the pixel points of the binary image(i,j)The gray value of the pixel point is determined,g(i,j’)is the coordinates of the pixel points of the binary image(i,j’)Gray value of pixel point, pixel point coordinate(i,j)And(i,j’)aboutI _{0}And the left and the right are symmetrical.
And B: from the difference image obtained, by means of OpenCV libraryfindContoursThe function obtains the profile of the location of the disturbance and then passesboundingRectAnd the function acquires the range of the outline, draws the minimum circumscribed rectangle of the outline, and records the geometric parameters of the circumscribed rectangle frame containing the area as interference position information.
And C: setting alarm thresholdsT _{ e }Calculating the minimum circumscribed rectangular area of the interference positionS _{ e }When is coming into contact withS _{ e }≥T _{ e }And then, the system alarms the interference fault and reports fault position information.
And step 3: when gap vision measurement is carried out, the calibration of the pixel area and the actual gap distance is needed. The method for calibrating the pixel area and the actual gap distance is shown in figure 4. The calibration method comprises the following steps:
step 31: obtaining the maximum working gap of the suspension ball system through image acquisition and processing according to the suspension working gap range of the suspension ball systemd _{ max }Timecorresponding suspension gap pixel area of region of interestAnd minimum working gapd _{ min }Pixel area of suspension gap interesting region corresponding to 0。
Step 32: by the formulaObtaining the calibration relation between the actual suspension gap distance and the pixel area, namely the actual gap distance corresponding to the unit pixel area,Pis a calibration coefficient;
step 33: obtaining the pixel area of the interested area of the suspension gap according to the image processingsBy the formulaCalculating the actual gap distanced；The difference between the minimum working gap and the actual gap pixel area.
Particularly, the invention calculates the actual suspension gap distance change through the suspension gap interested region image pixel area change, and has sensitive tracking and high linearity. Theoretically, when the actual suspension gap distance change is reflected in the image to be less than one pixel distance, the method used by the invention counts that the pixel area of the image in the suspension gap area basically changes linearly.
The digital image is a dotmatrix image represented by a matrix, and each pixel can be divided into a square pixel grid without considering sampling errors. An example of the change of the pixel area with the gap distance in the single pixel distance is schematically shown in fig. 5, in which a solid line grid represents a pixel point, a dotted line is a center line of the pixel grid, and the area of the single pixel grid is defaulted to 1. The solid circles in this example are used to simulate a hover ball, and the position of the solid circles after each translation are plotted in fig. 5, each time the solid circles are translated upward from the lower boundary of the pixel grid by 1/10 pixel distances within a single pixel distance. In this example, the area of the pixel grid region above the solid line circle is the effective gap region, and the pixel area of the effective gap region after each upward translation is calculated by taking or rejecting the single pixel grid according to whether the area in the effective region is greater than or equal to 1/2, that is, the number of pixels in the effective gap region is calculated. The curve is plotted according to the pixel area variation as shown in fig. 6. It follows that within a single pixel distance, the pixel area is sensitive and substantially linear with gap variation.
Radius of suspension steel ball theoreticallyRIs 80 mm and the maximum distance of the suspension gapd _{max}Is 20 mm, and is processed by a formula when the resolution of 640 x 480 is adopted for image processingIt can be known that the detection precision of the suspension gap is less than 1μmThe invention can realize highprecision visual detection of the suspension gap.
Claims (7)
1. A suspension gap visual detection method based on image processing is characterized by comprising the following steps:
step 1: obtaining an original highdefinition image of a suspension gap region, and processing to obtain a binary image of the suspension gap regionofinterest;
step 2: obtaining the pixel area of the interested gap region by calculating the number of pixel points with the binarization result of 1 in the suspension gap interested region binarization images；
And step 3: area of pixelsAnd calibrating the actual gap distance, and calculating the actual gap distance:
step 31: obtaining the maximum working gap of the suspension ball system through image acquisition and processing according to the suspension working gap range of the suspension ball systemd _{ max }Timecorresponding suspension gap pixel area of region of interestAnd minimum working gapd _{ min }Pixel area of suspension gap interesting region corresponding to 0；
Step 32: by the formulaObtaining the calibration relation between the actual suspension gap distance and the pixel area, namely the actual gap distance corresponding to the unit pixel area,Pis a calibration coefficient;
step 33: obtaining the pixel area of the interested area of the suspension gap according to the image processingsBy the formulaCalculating the actual gap distanced；
Calculating the pixel area of the suspension gap region of interestsThe process is as follows:
step 21: positioned to the upper vertex of the levitated ballT _{ 0 }Using the bilateral symmetry of the region to be measured to passT _{ 0 }Vertical center line of pointI _{0}Dividing the binary image of the suspension gap region of interest into four subarea images with equal width in the horizontal direction as a symmetry axisA _{1}、A _{2}、A _{3}AndA _{4}outside ofA _{1}AndA _{4}two partitions aboutI _{0}Symmetrical, middleA _{2}AndA _{3}two partitions aboutI _{0}Symmetry;
step 22: defining the number of pixel points with binarization result of 1 in the suspension gap regionofinterest binarized image as the pixel areasCalculating four divisional images respectivelyA _{1}、A _{2}、A _{3}AndA _{4}pixel area of、、And；
step 23: the pixel area is set to be calculated in the manner ofs= +，Is an outer sideA _{1}AndA _{4}the sum of the pixel areas of the two subregions is calculated as the initial value=，Is a middleA _{2}AndA _{3}the sum of the pixel areas of the two subregions is set in the way of calculating the initial value = ；
Step 24: setting an upper thresholdT _{ h1 }And a lower thresholdT _{ h2 }，0<T _{ h2 }<T _{ h1 }(ii) a Selecting and calculating according to the relationship between the pixel area difference value of the symmetric region and the upper and lower limit thresholdsAndthe manner of (a);
(a) for symmetric partitionsA _{1}AndA _{4}calculatingThe  result is merged with the upper thresholdT _{ h1 }And a lower thresholdT _{ h2 }Performing a hysteresis threshold comparison:
if does≥T _{ h1 }Then, obvious asymmetric interference exists in the image gap part of the partial suspension gap interesting region; if it is not≥The interference position appears inA _{4}Partition, at this time set = (ii) a Otherwise, the interference position appears inA _{1}Partition, at this time set = ；
If does≤T _{ h2 }Then the image of the interested area of the partial suspension gap has no obvious interference, and the setting is carried out at the moment=；
If it isT _{ h2 }<<T _{ h1 }At this time, the calculation method of the original pixel area is kept unchanged=；
(b) For symmetric partitionsA _{2}AndA _{3}calculatingThe  result is merged with the upper thresholdT _{ h1 }And a lower thresholdT _{ h2 }Performing a hysteresis threshold comparison:
if does≥T _{ h1 }Then, obvious asymmetric interference exists in the image gap part of the partial suspension gap interesting region; if it is not≥The interference position appears inA _{3}Partition, at this time set = (ii) a Otherwise, the interference position appears inA _{2}Partition, at this time set = ；
If does≤T _{ h2 }Then the part suspends the gap region of interestThe domain image has no obvious interference, and the setting is carried out at the moment = ；
If it isT _{ h2 }<<T _{ h1 }At this time, the original pixel area calculation mode is kept unchanged: = 。
2. the image processingbased suspension gap visual inspection method according to claim 1, wherein the processing step of obtaining a binarized image of a suspension gap region of interest is as follows:
step 11: carrying out suspension gap interested region image cutting operation on the original highdefinition image of the suspension gap region, wherein the upper boundary of the interested region is a straight line corresponding to the lower edge of the electromagnetl _{1}The lower boundary is the straight line of the diameter of the suspension ball in the horizontal directionl _{2}The left boundary is the left external tangent of the suspension ball in the vertical directionl _{3}The right boundary is the outer tangent line of the right side of the suspension ball in the vertical directionl _{4}Cutting according to the boundary range to obtain an interested area image;
step 12: carrying out graying operation on the original RGB mode color image of the suspension gap interesting region, and acquiring the gray value of each pixel point by adopting a weighted average method;
step 13: carrying out enhancement filtering operation on the gray level image, and obtaining an enhanced gray level image by adopting a bilateral filtering algorithm;
step 14: selecting an optimal threshold value by adopting a maximum interclass variance method according to an enhanced gray level image after image enhancement filteringTAnd performing optimal threshold segmentation binarization operation:
wherein the content of the first and second substances,f(i,j)is to enhance the gray scale image coordinates(i,j)The gray value of the pixel point is determined,g(i,j)the image is the image optimal threshold segmentation binarization result; according to the optimum threshold valueTAnd operating all pixel points of the enhanced gray level image, measuring that the binarization result of the background area is 1, namely white, and the binarization result of the foreground target area is 0, namely black, so as to obtain the suspension gap regionofinterest binarization image.
3. The image processingbased suspension gap visual inspection method according to claim 1, characterized in that when there is significant asymmetric disturbance in the suspension gap interesting region image gap portion, the system alarms disturbance fault and locates disturbance position:
step A: by formula calculation aboutI _{0}The differential image of the two symmetric binary images of the left part and the right part has the following formula:
wherein the content of the first and second substances,d(i,j)is thatiLine ofjThe difference result of the pixel points at the column position is obtained if the size of the suspension gap regionofinterest binary image is equal toMLine ofNRow, theniThe value range is [ 2 ]1,M]，jHas a value range of [, ]1,N]；g(i,j)Is the coordinates of the pixel points of the binary image(i,j)The gray value of the pixel point is determined,g(i,j’)is the coordinates of the pixel points of the binary image(i,j’)Processing gray value of pixel point, pixel pointCoordinates of the object(i,j)And(i,j’)aboutI _{0}Leftright symmetry;
and B: obtaining the outline of the interference position through an outline searching function according to the obtained difference image, further drawing a minimum circumscribed rectangle of the outline, and recording the geometric parameters of a circumscribed rectangle frame containing the area as interference position information;
and C: setting alarm thresholdsT _{ e }Calculating the minimum circumscribed rectangular area of the interference positionS _{ e }When is coming into contact withS _{ e }≥T _{ e }And then, the system alarms the interference fault and reports fault position information.
4. The imageprocessingbased suspension gap visual inspection method according to claim 1, wherein the edge feature of the target suspension ball to be inspected is a circular arc.
5. The image processingbased suspension gap visual inspection method according to claim 1, characterized in that a ringshaped LED light source is arranged to provide a suitable illumination intensity.
6. The image processingbased suspension gap visual inspection method according to claim 1, characterized in that a foreground object and a background with color contrast are provided, so that the contrast between the measurement background and the foreground object is more prominent, and simultaneously, the electromagnets in the foreground object and the suspension ball are ensured to be similar in color.
7. The image processingbased suspension gap vision inspection method according to claim 1, wherein when an original highdefinition image of the suspension gap area is obtained, an industrial camera is fixedly installed, and the relative position of the industrial camera and the electromagnet is ensured to be unchanged in the vision measurement process by adjusting the position and the focal length of the camera to clearly image the lower boundary of the electromagnet into a straight line.
Priority Applications (1)
Application Number  Priority Date  Filing Date  Title 

CN202010082108.5A CN110930407B (en)  20200207  20200207  Suspension gap visual detection method based on image processing 
Applications Claiming Priority (2)
Application Number  Priority Date  Filing Date  Title 

CN202010082108.5A CN110930407B (en)  20200207  20200207  Suspension gap visual detection method based on image processing 
LU101668A LU101668B1 (en)  20200207  20200309  Visual measurement method of levitation gap based on image processing 
Publications (2)
Publication Number  Publication Date 

CN110930407A CN110930407A (en)  20200327 
CN110930407B true CN110930407B (en)  20200515 
Family
ID=69854691
Family Applications (1)
Application Number  Title  Priority Date  Filing Date 

CN202010082108.5A Active CN110930407B (en)  20200207  20200207  Suspension gap visual detection method based on image processing 
Country Status (2)
Country  Link 

CN (1)  CN110930407B (en) 
LU (1)  LU101668B1 (en) 
Families Citing this family (1)
Publication number  Priority date  Publication date  Assignee  Title 

CN112734780A (en) *  20201225  20210430  哈尔滨市科佳通用机电股份有限公司  Method for identifying deformation fault of pull ring of derailment automatic braking pull ring device 
Citations (7)
Publication number  Priority date  Publication date  Assignee  Title 

CN101403610A (en) *  20081106  20090408  陕西科技大学  System and method for measuring leather area based on digital image method 
CN105510195A (en) *  20151207  20160420  华侨大学  Online detection method for particle size and shape of stacked aggregate 
CN107154050A (en) *  20170503  20170912  魏玉震  A kind of automatic obtaining method of the stone material geometric parameter based on machine vision 
CN107717631A (en) *  20171031  20180223  中国科学院合肥物质科学研究院  A kind of HSC Milling Tools wear automatic monitoring method 
CN108801151A (en) *  20180529  20181113  云南富龙高速公路建设指挥部  Pavement crack detection device based on smart mobile phone and detection method 
CN109559314A (en) *  20190118  20190402  西南交通大学  A kind of electromagnetic suspension ball system and its image processing method based on machine vision 
CN110458785A (en) *  20190816  20191115  西南交通大学  A kind of magnetic levitation ball levitation gap detection method based on image sensing 
Family Cites Families (3)
Publication number  Priority date  Publication date  Assignee  Title 

CN101957178B (en) *  20090717  20120523  上海同岩土木工程科技有限公司  Method and device for measuring tunnel lining cracks 
CN102680480A (en) *  20120503  20120919  中南大学  Intelligent detecting method for cracks of concrete structures 
CN110264459A (en) *  20190624  20190920  江苏开放大学（江苏城市职业学院）  A kind of interstices of soil characteristics information extraction method 

2020
 20200207 CN CN202010082108.5A patent/CN110930407B/en active Active
 20200309 LU LU101668A patent/LU101668B1/en active IP Right Grant
Patent Citations (7)
Publication number  Priority date  Publication date  Assignee  Title 

CN101403610A (en) *  20081106  20090408  陕西科技大学  System and method for measuring leather area based on digital image method 
CN105510195A (en) *  20151207  20160420  华侨大学  Online detection method for particle size and shape of stacked aggregate 
CN107154050A (en) *  20170503  20170912  魏玉震  A kind of automatic obtaining method of the stone material geometric parameter based on machine vision 
CN107717631A (en) *  20171031  20180223  中国科学院合肥物质科学研究院  A kind of HSC Milling Tools wear automatic monitoring method 
CN108801151A (en) *  20180529  20181113  云南富龙高速公路建设指挥部  Pavement crack detection device based on smart mobile phone and detection method 
CN109559314A (en) *  20190118  20190402  西南交通大学  A kind of electromagnetic suspension ball system and its image processing method based on machine vision 
CN110458785A (en) *  20190816  20191115  西南交通大学  A kind of magnetic levitation ball levitation gap detection method based on image sensing 
NonPatent Citations (3)
Title 

基于数字图像处理的轨道梁裂缝检测技术;杜清超 等;《四川建筑》;20190828;第39卷(第4期);9597 * 
开放式微细切削数控系统研究;黄逊彬;《中国优秀硕士学位论文全文数据库 工程科技I辑》;20130415;正文第5.25.3节，图5.5 * 
汽油机火花塞间隙图像法测量;李晓斌;《山西农业大学学报（自然科学版）》;20151115;第35卷(第6期);664667 * 
Also Published As
Publication number  Publication date 

LU101668B1 (en)  20200709 
CN110930407A (en)  20200327 
Similar Documents
Publication  Publication Date  Title 

CN110268190B (en)  Underground pipe gallery leakage detection method based on static infrared thermography processing  
CN103345755B (en)  A kind of Chessboard angular point subpixel extraction based on Harris operator  
CN110930407B (en)  Suspension gap visual detection method based on image processing  
KR100382577B1 (en)  Wheel measuring apparatus  
CN110458785B (en)  Magnetic levitation ball levitation gap detection method based on image sensing  
CN109490316B (en)  Surface defect detection algorithm based on machine vision  
CN107203973B (en)  Subpixel positioning method for center line laser of threedimensional laser scanning system  
CN106780483B (en)  More continuous casting billet end face visual identifying systems and centre coordinate acquiring method  
CN106599760B (en)  Method for calculating running area of inspection robot of transformer substation  
CN108007388A (en)  A kind of turntable angle high precision online measuring method based on machine vision  
CN103293168B (en)  Fruit surface defect detection method based on visual saliency  
CN108759973A (en)  A kind of water level measurement method  
CN105005985B (en)  Backlight image micron order edge detection method  
CN107506739B (en)  Night forward vehicle detection and distance measurement method  
CN111998910A (en)  Visual measurement method and system for water level of multistage water gauge  
CN111640158A (en)  Endtoend camera based on corresponding mask and laser radar external reference calibration method  
Yimin et al.  A novel approach to subpixel corner detection of the grid in camera calibration  
CN109489566A (en)  Lithium battery diaphragm material cuts checking method for width, detection system and device  
CN109448059B (en)  Rapid Xcorner subpixel detection method  
Xue et al.  Research of vehicle monocular measurement system based on computer vision  
CN110954005B (en)  Mediumlow speed maglev train suspension gap detection method based on image processing  
Jing et al.  Research on Visual Measurement for Levitation Gap in Maglev System  
Hu et al.  Pit defect detection on steel shell end face based on machine vision  
CN108846363A (en)  A kind of subregion vehicle bottom shadow detection method based on divergence expression scanning  
Zhao et al.  Research on Stalk Crops Internodes and Buds Identification based on Computer Vision 
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 