CN116266349A - Magnetic levitation module bolt loosening detection method based on threshold separation Hough search - Google Patents
Magnetic levitation module bolt loosening detection method based on threshold separation Hough search Download PDFInfo
- Publication number
- CN116266349A CN116266349A CN202111544378.4A CN202111544378A CN116266349A CN 116266349 A CN116266349 A CN 116266349A CN 202111544378 A CN202111544378 A CN 202111544378A CN 116266349 A CN116266349 A CN 116266349A
- Authority
- CN
- China
- Prior art keywords
- bolt
- image
- top surface
- bolt hole
- value
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Pending
Links
- 238000001514 detection method Methods 0.000 title claims abstract description 49
- 238000000926 separation method Methods 0.000 title claims abstract description 23
- 238000005339 levitation Methods 0.000 title claims abstract description 22
- 238000000034 method Methods 0.000 claims abstract description 42
- 238000009499 grossing Methods 0.000 claims abstract description 28
- 239000003550 marker Substances 0.000 claims abstract description 19
- 238000013507 mapping Methods 0.000 claims abstract description 18
- 230000009467 reduction Effects 0.000 claims abstract description 10
- 230000003044 adaptive effect Effects 0.000 claims description 32
- 238000012545 processing Methods 0.000 claims description 11
- 230000008569 process Effects 0.000 claims description 6
- 239000011159 matrix material Substances 0.000 claims description 4
- 230000001629 suppression Effects 0.000 claims description 4
- 238000000605 extraction Methods 0.000 description 19
- 238000010586 diagram Methods 0.000 description 6
- 230000002349 favourable effect Effects 0.000 description 4
- 238000001914 filtration Methods 0.000 description 4
- 235000012434 pretzels Nutrition 0.000 description 3
- 235000002566 Capsicum Nutrition 0.000 description 2
- 239000006002 Pepper Substances 0.000 description 2
- 241000722363 Piper Species 0.000 description 2
- 235000016761 Piper aduncum Nutrition 0.000 description 2
- 235000017804 Piper guineense Nutrition 0.000 description 2
- 235000008184 Piper nigrum Nutrition 0.000 description 2
- 230000009286 beneficial effect Effects 0.000 description 2
- 238000010276 construction Methods 0.000 description 2
- 238000007689 inspection Methods 0.000 description 2
- 238000012986 modification Methods 0.000 description 2
- 230000004048 modification Effects 0.000 description 2
- 238000003672 processing method Methods 0.000 description 2
- 150000003839 salts Chemical class 0.000 description 2
- 230000009466 transformation Effects 0.000 description 2
- 230000005540 biological transmission Effects 0.000 description 1
- 238000004422 calculation algorithm Methods 0.000 description 1
- 238000004364 calculation method Methods 0.000 description 1
- 238000011161 development Methods 0.000 description 1
- 230000000694 effects Effects 0.000 description 1
- 238000005516 engineering process Methods 0.000 description 1
- 230000007613 environmental effect Effects 0.000 description 1
- 230000014509 gene expression Effects 0.000 description 1
- 230000006872 improvement Effects 0.000 description 1
- 238000012423 maintenance Methods 0.000 description 1
- 238000012544 monitoring process Methods 0.000 description 1
- 238000004806 packaging method and process Methods 0.000 description 1
- 238000011946 reduction process Methods 0.000 description 1
- 238000012360 testing method Methods 0.000 description 1
- 238000011426 transformation method Methods 0.000 description 1
Images
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06T—IMAGE DATA PROCESSING OR GENERATION, IN GENERAL
- G06T7/00—Image analysis
- G06T7/0002—Inspection of images, e.g. flaw detection
- G06T7/0004—Industrial image inspection
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06T—IMAGE DATA PROCESSING OR GENERATION, IN GENERAL
- G06T5/00—Image enhancement or restoration
- G06T5/70—Denoising; Smoothing
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06T—IMAGE DATA PROCESSING OR GENERATION, IN GENERAL
- G06T7/00—Image analysis
- G06T7/10—Segmentation; Edge detection
- G06T7/12—Edge-based segmentation
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR 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 OR 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/20032—Median filtering
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06T—IMAGE DATA PROCESSING OR GENERATION, IN GENERAL
- G06T2207/00—Indexing scheme for image analysis or image enhancement
- G06T2207/30—Subject of image; Context of image processing
- G06T2207/30108—Industrial image inspection
- G06T2207/30164—Workpiece; Machine component
Landscapes
- Engineering & Computer Science (AREA)
- Physics & Mathematics (AREA)
- General Physics & Mathematics (AREA)
- Theoretical Computer Science (AREA)
- Computer Vision & Pattern Recognition (AREA)
- Quality & Reliability (AREA)
- Image Analysis (AREA)
Abstract
The invention discloses a magnetic levitation module bolt loosening detection method based on a threshold separation Hough search. Wherein the method comprises the following steps: acquiring a bolt image; noise reduction is carried out on the bolt image to obtain a noise-reduced image, and smoothing is carried out on the noise-reduced image to obtain a smoothed image; performing marker line self-adaptive threshold separation on the smoothed image to obtain a bolt top surface binarization image and a bolt hole binarization image; extracting the marked line edge of the bolt top surface from the bolt top surface binarization image and extracting the marked line edge of the bolt hole from the bolt hole binarization image by using a Canny operator method; performing marking line searching and marking line parameter determination by utilizing edge Hough mapping and Hough space searching respectively aiming at the marking line edge of the top surface of the bolt and the marking line edge of the bolt hole, wherein the marking line parameters comprise marking line parameters of the top surface of the bolt and marking line parameters of the bolt hole; and obtaining a bolt loosening detection result according to the bolt top surface marking line parameter and the bolt hole marking line parameter.
Description
Technical Field
The invention relates to the technical field of magnetic levitation module bolt loosening detection, in particular to a magnetic levitation module bolt loosening detection method based on threshold separation Hough search.
Background
The magnetic levitation module is one of key equipment of a magnetic levitation transportation system and is a main source of levitation and power of the magnetic levitation equipment, so that the normal working state of the magnetic levitation module is an important guarantee for the normal working and operation safety of the magnetic levitation equipment. The main fault factor of the magnetic levitation module is that besides the working state of the internal packaging magnetic field generating equipment, the loosening of bolts caused by the vibration of the module can cause the creeping of the module blocks, further influence the distribution of the magnetic field and finally cause serious operation accidents, so that the loosening detection of the module fixing bolts is also one of important guarantee means for maintaining the normal operation of the module.
In practical application, the most direct mode for detecting bolt looseness is to directly measure the pretightening force of a bolt by adding a pressure sensing gasket to a bolt hole, and a method for analyzing the tightness state of the bolt through a part vibration signal is also available, and more image-based bolt detection methods are proposed in recent years along with the development of machine vision and image processing technologies.
However, although the pretightening force parameter can be obtained directly by increasing the pretightening force of the bolt by the pressure sensitive gasket, the complexity of a monitoring system and a construction process is increased, the construction cost is increased, and the spot inspection mode is usually utilized for reducing the cost, so that the spot inspection is very easy to cause. The method for analyzing the tightness state of the bolts by using the vibration signals improves the precision and efficiency, but still needs to set a vibration sensor near each bolt or in a fixed area range, and has the problems of low detection speed, long detection period, high detection cost, increased maintenance cost, increased system risk and the like. The existing bolt detection method based on the image mainly depends on the accuracy of a calculation logic support detection result designed by an algorithm, is easy to be interfered by environmental conditions, has low detection accuracy, and can accurately determine whether the state of the bolt is normal or not by taking accurate positioning information as a support.
Disclosure of Invention
The invention provides a magnetic levitation module bolt loosening detection method based on a threshold separation Hough search, which can solve the technical problems in the prior art.
The invention provides a magnetic levitation module bolt loosening detection method based on threshold separation Hough search, which comprises the following steps:
acquiring a bolt image;
carrying out noise reduction treatment on the bolt image to obtain a noise-reduced image, and carrying out smoothing treatment on the noise-reduced image to obtain a smoothed image;
performing marker line self-adaptive threshold separation on the smoothed image to obtain a bolt top surface binarization image and a bolt hole binarization image;
extracting the marked line edge of the bolt top surface from the bolt top surface binarization image by using a Canny operator method, and extracting the marked line edge of the bolt hole from the bolt hole binarization image;
carrying out marked line search and marked line parameter determination by utilizing edge Hough mapping and Hough space search respectively aiming at the marked line edge of the top surface of the bolt and the marked line edge of the bolt hole, wherein the marked line parameters comprise the marked line parameter of the top surface of the bolt and the marked line parameter of the bolt hole;
and obtaining a bolt loosening detection result according to the bolt top surface marking line parameter and the bolt hole marking line parameter.
Preferably, the noise reduction processing on the bolt image to obtain a noise reduced image includes:
s200, converting the bolt image into a gray level image, and presetting the size of a filter window to be w x w and the sliding step length S of the window;
s202, placing the preset filter window at the leftmost upper end of the gray level graph, aligning a central element of the preset filter window with the pixels at the left upper corner of the gray level graph, sorting the pixel values of all the pixel points in the preset filter window, if the gray median value of the pixel points in the preset filter window is equal to the maximum pixel value or the minimum pixel value, increasing w by 2 and returning to S200, and if the gray median value of the pixel points in the preset filter window is between the maximum pixel value and the minimum pixel value, turning to S204;
s204, reserving original pixel values of pixels with gray values not equal to the maximum pixel value and the minimum pixel value in the preset filter window, and setting the pixel value of the pixels with gray values equal to the maximum pixel value or the minimum pixel value as a gray median value in the preset filter window;
s206, sliding the preset filter window to the right with the sliding step length S, if the central element of the preset filter window exceeds the rightmost pixel of the gray level map, returning the central element of the preset filter window to the leftmost end of the gray level map, sliding downwards with the sliding step length S, and repeating S202-S206 until the whole gray level map is traversed to obtain a noise-reduced image.
Preferably, performing smoothing processing on the noise-reduced image to obtain a smoothed image includes:
and carrying out two-dimensional Gaussian smoothing on the noise-reduced image to obtain a smoothed image.
Preferably, a two-dimensional Gaussian smoothing filter is adopted to carry out two-dimensional Gaussian smoothing, and the two-dimensional Gaussian smoothing filter is as follows:
wherein x= [ X1, X2] represents the position of the element in the gaussian filter window, X1 and X2 represent the row and column coordinates of the element, μ represents the two-dimensional gaussian distribution mean, and Σ represents the two-dimensional gaussian distribution covariance matrix, respectively.
Preferably, performing marker line adaptive threshold separation on the smoothed image to obtain a bolt top surface binarized image and a bolt hole binarized image includes:
calculating the gray average value of the smoothed image;
calculating an adaptive upper threshold and an adaptive lower threshold according to the gray average value;
and respectively carrying out binarization processing on the gray level image by using the self-adaptive upper threshold value and the self-adaptive lower threshold value to obtain a bolt top surface binarization image and a bolt hole binarization image.
Preferably, the gray average of the smoothed image is calculated by:
wherein PGA represents a gray-scale average value, H and W represent the height and width of the smoothed image, and P (H, W) represents the gray-scale value of the H-th row and W-th column element in the smoothed image.
Preferably, the adaptive upper threshold and the adaptive lower threshold are calculated from the gray average by:
wherein, the UCT represents the adaptive upper threshold and the DCT represents the adaptive lower threshold.
Preferably, extracting the marked line edge of the bolt top surface in the bolt top surface binarized image and extracting the marked line edge of the bolt hole in the bolt hole binarized image includes:
performing edge strong gradient search on the bolt top surface binarization image and the bolt hole binarization image to obtain strong gradients of all pixel points in the bolt top surface binarization image and strong gradients of all pixel points in the bolt hole binarization image;
eliminating boundary errors by using a non-maximum suppression method;
determining an upper boundary of a first threshold value and a lower boundary of the first threshold value according to the maximum value of the absolute values of the strong gradients in the strong gradients of all the pixel points in the bolt top surface binarization image, and determining an upper boundary of a second threshold value and a lower boundary of the second threshold value according to the maximum value of the absolute values of the strong gradients in the strong gradients of all the pixel points in the bolt hole binarization image;
extracting the marked line edge of the bolt top surface in the bolt top surface binarization image according to the absolute value of the strong gradient of all the pixel points in the bolt top surface binarization image, the upper limit of the first threshold value and the lower limit of the first threshold value, and extracting the marked line edge of the bolt hole in the bolt hole binarization image according to the absolute value of the strong gradient of all the pixel points in the bolt top surface binarization image, the upper limit of the second threshold value and the lower limit of the second threshold value.
Preferably, performing the marker line search and marker line parameter determination using the edge hough map and the hough space search for the marker line edge of the bolt top surface and the marker line edge of the bolt hole, respectively, includes:
converting the marked line edges of the top surfaces of the bolts and the marked line edges of the bolt holes into curves in a Hough space by utilizing edge Hough mapping;
searching the intersection point with the largest number of intersecting curves in the Hough space as a marked line boundary point;
and obtaining the marking line parameters according to the marking line boundary points.
Through the technical scheme, the bolt top surface and the bolt hole marking line in the image can be separated by utilizing the self-adaptive threshold method, the marking line in the image, other edges of the bolt hole, the bolt top surface and the like are obtained by combining Canny operator edge extraction, the bolt top surface and the bolt near marking line parameters are searched in the mapping space through Hough transformation, and finally a bolt loosening detection result (for example, the bolt loosening degree) is obtained through the two marking line parameters (for example, the difference of the two marking line parameters). The processing method based on the self-adaptive threshold effectively separates the bolt top surface and the bolt hole position mark line, is favorable for improving the precision of bolt loosening angle detection, and the method of combining Hough mapping space search by the Canny operator edge extraction can accurately feed back the mark line inclination angle parameter, so that the problem of inaccurate loosening angle detection caused by identifying the bolt surface and the bolt hole is avoided, and the detection precision of the bolt loosening angle is favorable for being improved.
Drawings
The accompanying drawings, which are included to provide a further understanding of embodiments of the invention and are incorporated in and constitute a part of this specification, illustrate embodiments of the invention and together with the description serve to explain the principles of the invention. It is evident that the drawings in the following description are only some embodiments of the present invention and that other drawings may be obtained from these drawings without inventive effort for a person of ordinary skill in the art.
Fig. 1 shows a flowchart of a method for detecting loosening of a bolt of a magnetic levitation module based on a threshold separation hough search according to an embodiment of the invention;
FIG. 2 shows an exemplary diagram of bolts and marking lines according to an embodiment of the present invention;
FIG. 3 shows a schematic view of a bolt image, a noisy image, and an adaptively filtered image according to an embodiment of the invention;
FIG. 4 is a schematic diagram showing the image Gaussian smoothing before and after and the corresponding edge extraction results according to an embodiment of the invention;
FIGS. 5A-5B illustrate adaptive threshold signature line separation results according to embodiments of the present invention;
FIGS. 6A-6B illustrate Canny operator edge extraction results in accordance with embodiments of the present invention;
fig. 7A-7D show schematic diagrams of marking line hough mapping and search results at bolt tops and bolt holes according to embodiments of the invention.
Detailed Description
It should be noted that, in the case of no conflict, the embodiments and features in the embodiments may be combined with each other. The following description of the embodiments of the present invention will be made clearly and completely with reference to the accompanying drawings, in which it is apparent that the embodiments described are only some embodiments of the present invention, but not all embodiments. The following description of at least one exemplary embodiment is merely exemplary in nature and is in no way intended to limit the invention, its application, or uses. All other embodiments, which can be made by those skilled in the art based on the embodiments of the invention without making any inventive effort, are intended to be within the scope of the invention.
It is noted that the terminology used herein is for the purpose of describing particular embodiments only and is not intended to be limiting of example embodiments in accordance with the present application. As used herein, the singular is also intended to include the plural unless the context clearly indicates otherwise, and furthermore, it is to be understood that the terms "comprises" and/or "comprising" when used in this specification are taken to specify the presence of stated features, steps, operations, devices, components, and/or combinations thereof.
The relative arrangement of the components and steps, numerical expressions and numerical values set forth in these embodiments do not limit the scope of the present invention unless it is specifically stated otherwise. Meanwhile, it should be understood that the sizes of the respective parts shown in the drawings are not drawn in actual scale for convenience of description. Techniques, methods, and apparatus known to one of ordinary skill in the relevant art may not be discussed in detail, but should be considered part of the specification where appropriate. In all examples shown and discussed herein, any specific values should be construed as merely illustrative, and not a limitation. Thus, other examples of the exemplary embodiments may have different values. It should be noted that: like reference numerals and letters denote like items in the following figures, and thus once an item is defined in one figure, no further discussion thereof is necessary in subsequent figures.
Fig. 1 shows a flowchart of a method for detecting loosening of a bolt of a magnetic levitation module based on a threshold separation hough search according to an embodiment of the invention.
As shown in fig. 1, an embodiment of the present invention provides a method for detecting loosening of a bolt of a magnetic levitation module based on a threshold separation hough search, where the method includes:
s100, acquiring a bolt image;
s102, carrying out noise reduction treatment on the bolt image to obtain a noise-reduced image, and carrying out smoothing treatment on the noise-reduced image to obtain a smoothed image;
s104, performing marker line self-adaptive threshold separation on the smoothed image to obtain a bolt top surface binarization image and a bolt hole binarization image;
s106, extracting the marked line edge of the bolt top surface from the bolt top surface binarization image and extracting the marked line edge of the bolt hole from the bolt hole binarization image by using a Canny operator method;
s108, carrying out marking line search and marking line parameter determination by utilizing edge Hough mapping and Hough space search respectively aiming at the marking line edge of the top surface of the bolt and the marking line edge of the bolt hole, wherein the marking line parameters comprise marking line parameters of the top surface of the bolt and marking line parameters of the bolt hole;
s110, obtaining a bolt loosening detection result according to the bolt top surface marking line parameter and the bolt hole marking line parameter.
For example, the bolt top surface marking line parameter includes a bolt top surface marking line inclination angle, and the bolt hole marking line parameter includes a bolt hole marking line inclination angle. After the marking line parameters are obtained, if the inclination angle of the marking line on the top surface of the bolt and the inclination angle of the marking line of the bolt hole are changed, the bolt loosening detection result is determined to be that the bolt is loosened, otherwise, the bolt loosening detection result is determined to be that the bolt is not loosened (when the bolt is not loosened, the marking line on the top surface of the bolt and the marking line on the bolt hole are on the same straight line). Further, the specific loosening angle of the bolt can be determined by the difference between the bolt top face mark line inclination angle and the bolt hole mark line inclination angle.
Through the technical scheme, the bolt top surface and the bolt hole marking line in the image can be separated by utilizing the self-adaptive threshold method, the marking line in the image, other edges of the bolt hole, the bolt top surface and the like are obtained by combining Canny operator edge extraction, the bolt top surface and the bolt near marking line parameters are searched in the mapping space through Hough transformation, and finally a bolt loosening detection result (for example, the bolt loosening degree) is obtained through the two marking line parameters (for example, the difference of the two marking line parameters). The processing method based on the self-adaptive threshold effectively separates the bolt top surface and the bolt hole position mark line, is favorable for improving the precision of bolt loosening angle detection, and the method of combining Hough mapping space search by the Canny operator edge extraction can accurately feed back the mark line inclination angle parameter, so that the problem of inaccurate loosening angle detection caused by identifying the bolt surface and the bolt hole is avoided, and the detection precision of the bolt loosening angle is favorable for being improved.
According to an embodiment of the present invention, performing noise reduction processing on the bolt image to obtain a noise-reduced image includes:
s200, converting the bolt image into a gray level image, and presetting the size of a filter window to be w x w and the sliding step length S of the window;
s202, placing the preset filter window at the leftmost upper end of the gray level graph, aligning a central element of the preset filter window with the pixels at the left upper corner of the gray level graph, sorting the pixel values of all the pixel points in the preset filter window, if the gray median value of the pixel points in the preset filter window is equal to the maximum pixel value or the minimum pixel value, increasing w by 2 and returning to S200, and if the gray median value of the pixel points in the preset filter window is between the maximum pixel value and the minimum pixel value, turning to S204;
s204, reserving original pixel values of pixels with gray values not equal to the maximum pixel value and the minimum pixel value in the preset filter window, and setting the pixel value of the pixels with gray values equal to the maximum pixel value or the minimum pixel value as a gray median value in the preset filter window;
s206, sliding the preset filter window to the right with the sliding step length S, if the central element of the preset filter window exceeds the rightmost pixel of the gray level map, returning the central element of the preset filter window to the leftmost end of the gray level map, sliding downwards with the sliding step length S (sliding downwards for S pixels as a whole), and repeating S202-S206 until the whole gray level map is traversed to obtain a noise-reduced image.
Wherein, if the center element of the preset filtering window has slid to the rightmost lower end of the image, the filtering process is ended.
That is, the image noise reduction in the present invention reduces image distortion caused by salt and pepper noise generated in the image transmission process by using the adaptive median filter.
According to an embodiment of the present invention, performing smoothing processing on the image after noise reduction to obtain a smoothed image includes:
and carrying out two-dimensional Gaussian smoothing on the noise-reduced image to obtain a smoothed image.
Thus, the problem of false edges of the image due to uneven light and shade can be suppressed by smoothing the image.
According to one embodiment of the invention, a two-dimensional Gaussian smoothing filter is adopted to carry out two-dimensional Gaussian smoothing processing, and the two-dimensional Gaussian smoothing filter is as follows:
wherein x= [ X1, X2] represents the position of the element in the gaussian filter window, X1 and X2 represent the row and column coordinates of the element, μ represents the two-dimensional gaussian distribution mean, and Σ represents the two-dimensional gaussian distribution covariance matrix, respectively.
For example, the size of the gaussian filter window may be the same as the size of the preset filter window in the noise reduction process, and the gaussian convolution smoothing process is performed on the image by adopting the adaptive median filter window sliding manner.
In the present invention, the two-dimensional gaussian distribution mean μ can be expressed as: mu= [0,0]The two-dimensional gaussian distribution covariance matrix Σ can be expressed as:
according to one embodiment of the present invention, performing a marker line adaptive threshold separation on the smoothed image to obtain a bolt top surface binarized image and a bolt hole binarized image includes:
calculating the gray average value of the smoothed image;
calculating an adaptive upper threshold and an adaptive lower threshold according to the gray average value;
and respectively carrying out binarization processing on the gray level image (original gray level image) by utilizing the self-adaptive upper threshold value and the self-adaptive lower threshold value to obtain a bolt top surface binarization image and a bolt hole binarization image.
Thus, the marking line of the top surface of the bolt can be distinguished from the marking line of the bolt hole preliminarily.
According to one embodiment of the invention, the gray-scale average of the smoothed image is calculated by:
wherein PGA represents a gray-scale average value, H and W represent the height and width of the smoothed image in pixels, and P (H, W) represents the gray-scale value of the H-th row and W-th column element in the smoothed image.
According to one embodiment of the invention, the adaptive upper threshold and the adaptive lower threshold are calculated from the gray-level mean by:
wherein, the UCT represents the adaptive upper threshold and the DCT represents the adaptive lower threshold.
That is, the gray average value and the average values of 1 and 0 can be taken as the adaptive upper and lower thresholds, respectively.
According to one embodiment of the invention, the binarization process is performed using the adaptive upper threshold by:
wherein P is U (h, w) represents a thresholding result using an adaptive upper threshold.
According to one embodiment of the invention, the binarization process is performed using the adaptive lower threshold by:
wherein P is D (h, w) represents a thresholding result using an adaptive lower threshold.
The images are subjected to binarization processing through the self-adaptive upper threshold value and the self-adaptive lower threshold value, so that the bolt top surface images and the bolt hole images can be separated, and the self-adaptive separation of marking lines at different positions is realized.
According to one embodiment of the present invention, extracting the marked line edge of the bolt top surface in the bolt top surface binarized image and extracting the marked line edge of the bolt hole in the bolt hole binarized image includes:
performing edge strong gradient search on the bolt top surface binarization image and the bolt hole binarization image to obtain strong gradients of all pixel points in the bolt top surface binarization image and strong gradients of all pixel points in the bolt hole binarization image;
eliminating boundary errors by using a non-maximum suppression method;
for example, the non-maximum suppression method may include: after the strong gradient is obtained for all the pixel points in the image, if the strong gradient of the pixel point is larger than the strong gradient of the two adjacent pixel points in the strong gradient direction, the point is reserved, otherwise, the point is set to be zero.
Determining an upper boundary of a first threshold value and a lower boundary of the first threshold value according to the maximum value of the absolute values of the strong gradients in the strong gradients of all the pixel points in the bolt top surface binarization image, and determining an upper boundary of a second threshold value and a lower boundary of the second threshold value according to the maximum value of the absolute values of the strong gradients in the strong gradients of all the pixel points in the bolt hole binarization image;
extracting the marked line edge of the bolt top surface in the bolt top surface binarization image according to the absolute value of the strong gradient of all the pixel points in the bolt top surface binarization image, the upper limit of the first threshold value and the lower limit of the first threshold value, and extracting the marked line edge of the bolt hole in the bolt hole binarization image according to the absolute value of the strong gradient of all the pixel points in the bolt top surface binarization image, the upper limit of the second threshold value and the lower limit of the second threshold value.
Specifically, a pixel having a strong gradient absolute value higher than the upper limit of the corresponding threshold value is referred to as a strong boundary point, which is a determined boundary point. Pixels with strong gradients having absolute values below the corresponding threshold lower bound are referred to as non-boundary points, and pixels with strong gradients between the corresponding threshold upper bound and the corresponding threshold lower bound are referred to as weak boundary points. The non-boundary point is directly set to zero, if the weak boundary point exists in eight adjacent pixel points, the weak boundary point is also defined as a determined boundary point, otherwise, the weak boundary point is determined as the non-boundary point. The determined boundary points in the final image constitute the edge extraction result of the image, in other words, the edge extraction result of the image is composed of the determined boundary points in the image.
In the image edge extraction, the false boundary false detection condition can be effectively restrained by using the Canny operator to carry out edge extraction.
The edge strong gradient search is carried out on the binarized image (comprising the bolt top surface binarized image and the bolt hole binarized image) to obtain the strong gradients of all pixel points in the binarized image through the following steps:
SG(h,w)=max([|SG 0° (h,w)|,|SG 90° (h,w)|,|SG 45° (h,w)|,|SG 135° (h,w)|]),
wherein SG (SG) 0° (h, w) represents longitudinal gradient, SG 90° (h, w) represents the lateral gradient, SG 45° (h, w) represents a 45 DEG directional gradient, SG 125° (h, w) denotes a 135 ° directional gradient, and SG (h, w) denotes a strong gradient of the pixel point.
That is, gradients in the above four directions are found for all pixels in the full image, where the determination of the absolute value that is the largest is the strong gradient for that pixel.
According to one embodiment of the present invention, taking the first threshold value as an example, the upper bound of the first threshold value and the lower bound of the first threshold value are determined by:
EDC U =0.75×max(SG(h,w)),h=1,2,...,H;w=1,2,...,W,
EDC D =0.25×max(SG(h,w)),h=1,2,...,H;w=1,2,...,W,
wherein EDC U For the upper bound of the first threshold, EDC D Is the lower bound of the first threshold.
The first threshold is similar to the second threshold, and the present invention is not confused by examples and is not described herein.
According to one embodiment of the present invention, performing a marker line search and marker line parameter determination using an edge hough map and a hough space search for a marker line edge of a bolt top surface and a marker line edge of a bolt hole, respectively, includes:
converting the marked line edges of the top surfaces of the bolts and the marked line edges of the bolt holes into curves in a Hough space by utilizing edge Hough mapping;
searching the intersection point with the largest number of intersecting curves in the Hough space as a marked line boundary point;
and obtaining the marking line parameters according to the marking line boundary points.
That is, after the extraction results of the bolt top surface and the bolt hole image edge are obtained respectively, the edge points in the image are mapped into the Hough space by using the Hough transformation method, and the parameters of the marking line are searched in the Hough space.
For example, edge points (determined boundary points) in an image are mapped to a hough space according to a hough transform method by:
ρ=wcosθ+hsinθ,
where ρ represents the distance between the straight line defining the boundary point (W, H) in the image and the origin of the image, the origin of the image is set as the pixel point with the position (W, H/2) in the image, and θ is the angle (mark line inclination angle) between the straight line in the image and the positive direction of the x-axis of the image. The coordinates of all the determined boundary points in the image can be converted into curves in the Hough space by using Hough mapping, and the curves corresponding to the determined boundary points in the same straight line in the Hough space are all intersected at one point.
And searching the intersection point with the largest number of intersection curves in the Hough space, wherein the determined boundary point in the corresponding image is the marked line boundary point, and taking out the (theta, rho) of the intersection point in the Hough space is the straight line parameter (marked line parameter) of the marked line in the image.
After the linear parameters of the bolt top surface marking line and the bolt hole marking line are obtained, the theta parameters in the parameters are compared, and then the bolt loosening detection result can be obtained.
The bolt looseness detection method according to the present invention will be described below with reference to examples.
Taking a magnetic levitation module of a certain magnetic levitation test platform as an example, the setting mode of the bolt position image and the marking line is shown in fig. 2. The solid line section in the figure shows two setting mode examples of the marking line, the relative position of the marking line and the bolt is not required to be kept fixed, the marking line on the bolt and the marking line at the bolt hole of the module are only required to be ensured to be on the same straight line, and meanwhile, two end points of the marking line section on the bolt fall on any pair of edges of the hexagon on the top surface of the bolt, as shown by the broken line in the figure.
Taking a bolt diagram as an example, adding salt and pepper noise with different intensities into the diagram to simulate the distortion condition of a shot image, and the result diagram after self-adaptive median filtering in the invention is shown in fig. 3. In fig. 3, a is an original image, b is a noisy image (pretzel noise density 0.05), c is a noisy image (pretzel noise density 0.1), d is a noisy image (pretzel noise density 0.5), e is a gray image, and f-h is an adaptive median filtered image.
As can be seen from fig. 3, the noise effect in the image after adaptive median filtering is significantly reduced, which is beneficial to the subsequent edge extraction process. The image after noise reduction is smoothed according to the Gaussian smoothing method in the invention to remove the pseudo boundary in the image, and the extraction results of the image before and after smoothing and the corresponding edges are shown in fig. 4. In fig. 4, a and b are the image before gaussian smoothing and the edge extraction result, and c and d are the image after gaussian smoothing and the edge extraction result, respectively.
As can be seen from fig. 4, the image before gaussian smoothing has many disordered pseudo-boundaries after extracting the edges, which affect the detection result, and the pseudo-boundaries in the image edge extraction result after gaussian smoothing are significantly reduced.
And carrying out self-adaptive threshold separation on the Gaussian smoothed image, distinguishing the marking lines at the bolt hole and the bolt hole, and ensuring the detection accuracy of the subsequent marking lines. The results of using the adaptive threshold signature line separation method described in the present invention are shown in fig. 5. In fig. 5, fig. 5A is a bolt top mark line separation result, and fig. 5B is a bolt hole mark line separation result.
As can be seen from FIG. 5, the images of the marking lines at the bolt and the bolt hole are more clearly distinguished in the two figures, so that the subsequent detection of the parameters of the marking lines respectively is facilitated. The separated bolt and bolt hole mark line is used for extracting the edge by a Canny operator method, and the result is shown in fig. 6. In fig. 6, fig. 6A is a bolt top mark line edge extraction result, and fig. 6B is a bolt hole mark line edge extraction result.
The result of extracting the top of the bolt and the edge of the bolt hole is respectively used for carrying out mark line searching and parameter determining according to the Hough mapping and Hough space searching method in the invention, and the result is shown in figure 7. In fig. 7, fig. 7A and 7B are bolt top mark line mapping and search results, respectively, and fig. 7C and 7D are bolt hole mark line mapping and search results, respectively.
As can be seen from fig. 7, the mark lines at the top of the bolt and the bolt hole can be accurately detected in the original image by the hough mapping and space searching method in the invention. And obtaining the marking line parameters at the bolt hole and the bolt hole according to the Hough space corresponding search result. The bolt top mark line theta is-2 degrees, the bolt hole mark line theta is 7 degrees, the difference between the two mark lines is 9 degrees, and a detection result, namely the bolt loosening angle is 9 degrees, can be given under the condition that the two mark lines are aligned in an initial state. Therefore, the effectiveness of the bolt loosening detection method for the magnetic levitation module is verified through the method, and the actual bolt loosening detection requirement is met.
From the above embodiment, it can be seen that the self-adaptive threshold method is used to separate the images of the marking lines at the bolt and the bolt hole, which is beneficial to improving the accuracy of extracting the marking lines and judging the loosening angle of the bolt. Meanwhile, a marking line parameter detection method of edge extraction, hough mapping and Hough space searching is constructed, and accurate judgment of marking line parameters of positions of bolts and bolt holes is achieved. Finally, accurate detection of bolt loosening conditions is realized through parameter comparison of the marked lines and reference of the marked line conditions with the initial marked lines. By using the detection method disclosed by the invention, the timeliness of detection can be improved on the basis of ensuring an accurate bolt loosening detection result, the detection efficiency is effectively improved compared with the existing bolt loosening detection method based on a pressure sensor and image recognition, meanwhile, the complexity of the detection method is reduced, the time delay of the detection result is limited, and the requirements of high precision and high instantaneity of the actual bolt loosening detection of the magnetic levitation module are met.
In the description of the present invention, it should be understood that the azimuth or positional relationships indicated by the azimuth terms such as "front, rear, upper, lower, left, right", "lateral, vertical, horizontal", and "top, bottom", etc., are generally based on the azimuth or positional relationships shown in the drawings, merely to facilitate description of the present invention and simplify the description, and these azimuth terms do not indicate and imply that the apparatus or elements referred to must have a specific azimuth or be constructed and operated in a specific azimuth, and thus should not be construed as limiting the scope of protection of the present invention; the orientation word "inner and outer" refers to inner and outer relative to the contour of the respective component itself.
Spatially relative terms, such as "above … …," "above … …," "upper surface at … …," "above," and the like, may be used herein for ease of description to describe one device or feature's spatial location relative to another device or feature as illustrated in the figures. It will be understood that the spatially relative terms are intended to encompass different orientations in use or operation in addition to the orientation depicted in the figures. For example, if the device in the figures is turned over, elements described as "above" or "over" other devices or structures would then be oriented "below" or "beneath" the other devices or structures. Thus, the exemplary term "above … …" may include both orientations of "above … …" and "below … …". The device may also be positioned in other different ways (rotated 90 degrees or at other orientations) and the spatially relative descriptors used herein interpreted accordingly.
In addition, the terms "first", "second", etc. are used to define the components, and are only for convenience of distinguishing the corresponding components, and the terms have no special meaning unless otherwise stated, and therefore should not be construed as limiting the scope of the present invention.
The above description is only of the preferred embodiments of the present invention and is not intended to limit the present invention, but various modifications and variations can be made to the present invention by those skilled in the art. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present invention should be included in the protection scope of the present invention.
Claims (9)
1. A magnetic levitation module bolt loosening detection method based on threshold separation Hough search is characterized by comprising the following steps:
acquiring a bolt image;
carrying out noise reduction treatment on the bolt image to obtain a noise-reduced image, and carrying out smoothing treatment on the noise-reduced image to obtain a smoothed image;
performing marker line self-adaptive threshold separation on the smoothed image to obtain a bolt top surface binarization image and a bolt hole binarization image;
extracting the marked line edge of the bolt top surface from the bolt top surface binarization image by using a Canny operator method, and extracting the marked line edge of the bolt hole from the bolt hole binarization image;
carrying out marked line search and marked line parameter determination by utilizing edge Hough mapping and Hough space search respectively aiming at the marked line edge of the top surface of the bolt and the marked line edge of the bolt hole, wherein the marked line parameters comprise the marked line parameter of the top surface of the bolt and the marked line parameter of the bolt hole;
and obtaining a bolt loosening detection result according to the bolt top surface marking line parameter and the bolt hole marking line parameter.
2. The method of claim 1, wherein performing noise reduction processing on the bolt image to obtain a noise reduced image comprises:
s200, converting the bolt image into a gray level image, and presetting the size of a filter window to be w x w and the sliding step length S of the window;
s202, placing the preset filter window at the leftmost upper end of the gray level graph, aligning a central element of the preset filter window with the pixels at the left upper corner of the gray level graph, sorting the pixel values of all the pixel points in the preset filter window, if the gray median value of the pixel points in the preset filter window is equal to the maximum pixel value or the minimum pixel value, increasing w by 2 and returning to S200, and if the gray median value of the pixel points in the preset filter window is between the maximum pixel value and the minimum pixel value, turning to S204;
s204, reserving original pixel values of pixels with gray values not equal to the maximum pixel value and the minimum pixel value in the preset filter window, and setting the pixel value of the pixels with gray values equal to the maximum pixel value or the minimum pixel value as a gray median value in the preset filter window;
s206, sliding the preset filter window to the right with the sliding step length S, if the central element of the preset filter window exceeds the rightmost pixel of the gray level map, returning the central element of the preset filter window to the leftmost end of the gray level map, sliding downwards with the sliding step length S, and repeating S202-S206 until the whole gray level map is traversed to obtain a noise-reduced image.
3. The method of claim 2, wherein smoothing the denoised image to obtain a smoothed image comprises:
and carrying out two-dimensional Gaussian smoothing on the noise-reduced image to obtain a smoothed image.
4. A method according to claim 3, characterized in that a two-dimensional gaussian smoothing process is performed using a two-dimensional gaussian smoothing filter, the two-dimensional gaussian smoothing filter being:
wherein x= [ X1, X2] represents the position of the element in the gaussian filter window, X1 and X2 represent the row and column coordinates of the element, μ represents the two-dimensional gaussian distribution mean, and Σ represents the two-dimensional gaussian distribution covariance matrix, respectively.
5. The method of claim 4, wherein performing a marker line adaptive thresholding separation on the smoothed image to obtain a bolt top face binarized image and a bolt hole binarized image comprises:
calculating the gray average value of the smoothed image;
calculating an adaptive upper threshold and an adaptive lower threshold according to the gray average value;
and respectively carrying out binarization processing on the gray level image by using the self-adaptive upper threshold value and the self-adaptive lower threshold value to obtain a bolt top surface binarization image and a bolt hole binarization image.
6. The method of claim 5, wherein the gray-scale average of the smoothed image is calculated by:
wherein PGA represents a gray-scale average value, H and W represent the height and width of the smoothed image, and P (H, W) represents the gray-scale value of the H-th row and W-th column element in the smoothed image.
8. The method of claim 7, wherein extracting the marked line edge of the bolt top surface in the bolt top surface binarized image and extracting the marked line edge of the bolt hole in the bolt hole binarized image comprises:
performing edge strong gradient search on the bolt top surface binarization image and the bolt hole binarization image to obtain strong gradients of all pixel points in the bolt top surface binarization image and strong gradients of all pixel points in the bolt hole binarization image;
eliminating boundary errors by using a non-maximum suppression method;
determining an upper boundary of a first threshold value and a lower boundary of the first threshold value according to the maximum value of the absolute values of the strong gradients in the strong gradients of all the pixel points in the bolt top surface binarization image, and determining an upper boundary of a second threshold value and a lower boundary of the second threshold value according to the maximum value of the absolute values of the strong gradients in the strong gradients of all the pixel points in the bolt hole binarization image;
extracting the marked line edge of the bolt top surface in the bolt top surface binarization image according to the absolute value of the strong gradient of all the pixel points in the bolt top surface binarization image, the upper limit of the first threshold value and the lower limit of the first threshold value, and extracting the marked line edge of the bolt hole in the bolt hole binarization image according to the absolute value of the strong gradient of all the pixel points in the bolt top surface binarization image, the upper limit of the second threshold value and the lower limit of the second threshold value.
9. The method of claim 8, wherein performing a marker line search and marker line parameter determination using an edge hough map and a hough space search for a marker line edge of a bolt face and a marker line edge of a bolt hole, respectively, comprises:
converting the marked line edges of the top surfaces of the bolts and the marked line edges of the bolt holes into curves in a Hough space by utilizing edge Hough mapping;
searching the intersection point with the largest number of intersecting curves in the Hough space as a marked line boundary point;
and obtaining the marking line parameters according to the marking line boundary points.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202111544378.4A CN116266349A (en) | 2021-12-16 | 2021-12-16 | Magnetic levitation module bolt loosening detection method based on threshold separation Hough search |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202111544378.4A CN116266349A (en) | 2021-12-16 | 2021-12-16 | Magnetic levitation module bolt loosening detection method based on threshold separation Hough search |
Publications (1)
Publication Number | Publication Date |
---|---|
CN116266349A true CN116266349A (en) | 2023-06-20 |
Family
ID=86742770
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202111544378.4A Pending CN116266349A (en) | 2021-12-16 | 2021-12-16 | Magnetic levitation module bolt loosening detection method based on threshold separation Hough search |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN116266349A (en) |
Cited By (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN119291875A (en) * | 2024-12-06 | 2025-01-10 | 苏州猎奇智能设备股份有限公司 | Silicon photonic FA alignment device and alignment method thereof |
-
2021
- 2021-12-16 CN CN202111544378.4A patent/CN116266349A/en active Pending
Cited By (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN119291875A (en) * | 2024-12-06 | 2025-01-10 | 苏州猎奇智能设备股份有限公司 | Silicon photonic FA alignment device and alignment method thereof |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN112419297B (en) | Bolt loosening detection method, device, equipment and storage medium | |
CN107330376B (en) | Lane line identification method and system | |
CN107145905B (en) | Image Recognition Detection Method for Elevator Fastening Nut Looseness | |
CN106951879B (en) | Multi-feature fusion vehicle detection method based on camera and millimeter wave radar | |
US7362883B2 (en) | Lane marker recognition method | |
CN104916163B (en) | Parking space detection method | |
US10997434B2 (en) | Lane marker recognition | |
CN108182383B (en) | Vehicle window detection method and device | |
Kortli et al. | A novel illumination-invariant lane detection system | |
US8983126B2 (en) | Method and system for detecting vehicle position by employing polarization image | |
CN103984961A (en) | Image detection method for detecting foreign matter at bottom of vehicle | |
CN109815822B (en) | Patrol diagram part target identification method based on generalized Hough transformation | |
CN106097329A (en) | A kind of container profile localization method based on rim detection | |
EP2492868A1 (en) | Far-infrared pedestrian detection device | |
US10726277B2 (en) | Lane line detection method | |
CN117593290A (en) | Bolt loosening detection method and equipment for train 360-degree dynamic image monitoring system | |
CN109886935A (en) | A kind of road face foreign matter detecting method based on deep learning | |
CN102194102A (en) | Method and device for classifying a traffic sign | |
CN115984806B (en) | Dynamic detection system for road marking damage | |
CN106803066B (en) | Vehicle yaw angle determination method based on Hough transformation | |
CN116266349A (en) | Magnetic levitation module bolt loosening detection method based on threshold separation Hough search | |
CN112464949A (en) | Method for eliminating influence of liquid level line on instrument pointer identification | |
CN110348307B (en) | Path edge identification method and system for crane metal structure climbing robot | |
Zong et al. | Traffic light detection based on multi-feature segmentation and online selecting scheme | |
CN110223332A (en) | A kind of Bridge Crack scaling method |
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 |