Guide rail guidance stroke measurement device and method based on machine vision technology
Through the multi -spectrical image processing and image enhancement model based on machine vision technology, combined with the geometric data of the guide rail, the high -precision measurement of the elevator guide rail is realized, and the problem of low measurement accuracy and reliability in the existing technology is solved.
Patent Information
- Application Number
- CN202411554964.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-04
- Publication Date
- 2025-01-24
- Estimated Expiration
- 2044-11-04
AI Technical Summary
It is difficult for the prior art to fully acquire the geometric parameters and surface details of elevator guide rails, resulting in low measurement accuracy and reliability.
Adopting the measurement method of guide rail guidance stroke based on machine vision technology, by obtaining multi -spectrical surface images, extracting texture characteristics, marginal characteristics, and corners, combined with horizontal cross -section shape data and surface depth data to build image enhancement models, generate enhanced images , Africate guide rail two -dimensional contour curve and calculate its length.
Achieve high precision measurement of elevator guide rails, enhance the comprehensiveness and reliability of measurement, and improve measurement efficiency and consistency.
Smart Images

Figure CN119063635B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of guide rail measurement technology, and more specifically, to a guide rail guided stroke measurement device and method based on machine vision technology. Background Art
[0002] With the rapid development of the elevator industry, the safety and reliability of elevators have attracted much attention. The elevator guide rail is one of the core components of the elevator, and its installation quality directly affects the smoothness and safety of the elevator's operation. Therefore, it is very important to accurately measure the elevator guide rail.
[0003] A Chinese patent with the authorization announcement number CN116659419B discloses a device and method for measuring the parameters of an elevator guide rail. The device acquires the point cloud data of the guide rail by combining an unmanned aerial vehicle, a laser plummet and a structured light scanning module, and then processes it through a data reconstruction module to achieve non-contact measurement of the guide rail parameters. This method is convenient and efficient, but the requirements for the illumination of the shaft are low, and the measurement accuracy needs to be further improved. Another Chinese patent with the authorization announcement number CN103852034B proposes a method for detecting the verticality of an elevator guide rail. The method uses an image acquisition device to capture an image of the guide rail and calculates the deviation value of the verticality of the guide rail through an image processing algorithm. This avoids the subjectivity of manual measurement and improves the measurement efficiency and reliability, but lacks analysis of detailed features such as the surface texture and edges of the guide rail, and the comprehensiveness of the measurement is insufficient.
[0004] In summary, most existing technologies use a single measurement method, which makes it difficult to fully obtain the geometric parameters and surface detail features of the guide rail, resulting in low measurement accuracy and reliability. Summary of the invention
[0005] In order to overcome the above-mentioned defects of the prior art, the present invention provides a guide rail guided stroke measuring device and method based on machine vision technology.
[0006] To achieve the above object, the present invention provides the following technical solutions:
[0007] The guide rail travel measurement method based on machine vision technology includes:
[0008] Acquire a multispectral surface image of the elevator guide rail, and obtain a first guide rail image, a second guide rail image, and a third guide rail image according to the multispectral surface image; perform adaptive illumination compensation on the first guide rail image, the second guide rail image, and the third guide rail image to obtain a fourth guide rail image, a fifth guide rail image, and a sixth guide rail image;
[0009] Extracting texture features, edge features, and corner point features of the fourth guide rail image, the fifth guide rail image, and the sixth guide rail image to obtain an image feature set, collecting cross-sectional shape data and surface depth data of the elevator guide rail, and constructing an elevator guide rail image enhancement model, and generating an enhanced seventh guide rail image through the image feature set, the cross-sectional shape data, the surface depth data, and the elevator guide rail image enhancement model;
[0010] A fourth feature point set is obtained based on the seventh guide rail image, cross-sectional shape data and surface depth data, a two-dimensional contour curve of the guide rail is fitted based on the fourth feature point set, and the length of the two-dimensional contour curve of the guide rail is calculated.
[0011] Further, the multispectral surface image of the elevator guide rail includes visible light images, near infrared images and mid-infrared images of different wavebands;
[0012] The method of performing adaptive illumination compensation on the first guide rail image, the second guide rail image and the third guide rail image to obtain the fourth guide rail image, the fifth guide rail image and the sixth guide rail image comprises: obtaining brightness distribution parameters of the first guide rail image, the second guide rail image and the third guide rail image, and determining illumination compensation coefficients and camera exposure parameters according to the brightness distribution parameters; and performing adaptive illumination compensation on the first guide rail image, the second guide rail image and the third guide rail image using the determined illumination compensation coefficients and camera exposure parameters.
[0013] Further, determining the illumination compensation coefficient and the camera exposure parameter according to the brightness distribution parameter includes:
[0014] Set the target grayscale mean value M and the target grayscale standard deviation to E, and calculate the illumination compensation coefficient C based on the actual grayscale mean value and the actual grayscale standard deviation of the image;
[0015] According to the actual grayscale mean m1 and the actual grayscale standard deviation σ1 of the first guide rail image, the visible light compensation coefficient C1 is obtained; if C1>1, the exposure time of the visible light camera is increased; if C1<1, the exposure time of the visible light camera is reduced;
[0016] According to the actual grayscale mean m2 and the actual grayscale standard deviation σ2 of the second guide rail image, the short-wave infrared compensation coefficient C2 is obtained; if C2>1, the exposure gain of the short-wave infrared camera is increased; if C2<1, the exposure gain of the short-wave infrared camera is reduced;
[0017] According to the actual grayscale mean m3 and the actual grayscale standard deviation σ3 of the third guide rail image, the long-wave infrared compensation coefficient C3 is obtained; if C3>1, the detection limit of the thermal imager is reduced and the sensitivity is improved; if C3<1, the detection limit of the thermal imager is increased and the sensitivity is reduced.
[0018] Furthermore, the elevator guide rail image enhancement model adopts an encoding-decoding network, which includes an encoding part and a decoding part; the encoding-decoding network uses a convolution kernel with a multi-scale receptive field in each layer;
[0019] The generating of the enhanced seventh guide rail image by using the image feature set, the cross-sectional shape data, the surface depth data and the elevator guide rail image enhancement model comprises:
[0020] Inputting the image feature set, the cross-sectional shape data, and the surface depth data into the elevator guide rail image enhancement model, gradually reducing the feature map size in the image feature set in the encoding part of the elevator guide rail image enhancement model, and extracting deep semantic features of the fourth guide rail image, the fifth guide rail image, and the sixth guide rail image;
[0021] Perform convolution operation on the cross-sectional shape data and surface depth data to extract the geometric structure features and surface undulation features of the elevator guide rail;
[0022] In the middle layer of the elevator guide rail image enhancement model, deep semantic features, geometric structure features and surface relief features are fused to generate a fused feature map;
[0023] In the decoding part, the fused feature map is restored, the image details are reconstructed, and the enhanced seventh guide track image is generated.
[0024] Further, obtaining a fourth feature point set based on the seventh guide rail image, the cross-sectional shape data and the surface depth data includes:
[0025] Binarization is performed on the seventh guide rail image to obtain a binary guide rail image, and starting from the upper left corner of the binary guide rail image, the guide rail edge pixels are scanned clockwise, and the coordinates of the edge points are recorded to obtain a first feature point set;
[0026] Obtain ultrasonic contour feature points according to the cross-sectional shape data of the guide rail; obtain laser distance feature points according to the surface depth data of the guide rail; perform coordinate transformation on the ultrasonic contour feature points and the laser distance feature points, unify them into a local coordinate system with the center of the guide rail as the origin, and obtain a second feature point set;
[0027] The first feature point set and the second feature point set are merged to obtain a third feature point set;
[0028] The third feature point set is subjected to coordinate transformation to obtain three-dimensional point cloud data of the guide rail; and the fourth feature point set is obtained according to the three-dimensional point cloud data of the guide rail.
[0029] Further, fitting the two-dimensional contour curve of the guide rail based on the fourth feature point set includes:
[0030] Extracting n key contour points from the fourth feature point set, the key contour points including the end points, inflection points and curvature extreme points of the guide rail;
[0031] Map n key contour points to a two-dimensional plane to construct a two-dimensional key contour point set;
[0032] Fitting the two-dimensional key contour point set to generate a two-dimensional contour curve of the guide rail; the two-dimensional contour curve includes n-1 curve segments, and the spline function of the n-1 curve segments is { , key contour points and The spline function of the curve segment between is ,in .
[0033] Further, the calculating the length of the two-dimensional contour curve of the guide rail includes:
[0034] Discretize the two-dimensional contour curve of the guide rail to obtain an ordered sequence of discrete points ,in Represents the total number of discrete points in the two-dimensional contour curve, represents the coordinates of the first discrete point, Indicates The coordinates of discrete points;
[0035] Calculate the distances between adjacent discrete points in the discrete point sequence, accumulate all distances, and obtain the total length of the two-dimensional contour curve; the calculation formula for the total length of the two-dimensional contour curve introduces a nonlinear oscillation term ,in represents the horizontal coordinate of the jth discrete point, represents the ordinate of the jth discrete point, represents the horizontal coordinate of the j+1th discrete point, Represents the ordinate of the j+1th discrete point, 1≤j≤ , Indicates taking and The larger of these two values.
[0036] A guide rail guidance stroke measurement device based on machine vision technology, which is used to implement the above-mentioned guide rail guidance stroke measurement method based on machine vision technology, and the device includes:
[0037] Image acquisition module: used to acquire a multispectral surface image of the elevator guide rail, and obtain a first guide rail image, a second guide rail image and a third guide rail image according to the multispectral surface image;
[0038] An illumination compensation module: used to perform adaptive illumination compensation on the first guide rail image, the second guide rail image and the third guide rail image to obtain a fourth guide rail image, a fifth guide rail image and a sixth guide rail image;
[0039] Image enhancement module: used to extract texture features, edge features and corner point features of the fourth guide rail image, the fifth guide rail image and the sixth guide rail image, obtain an image feature set, collect cross-sectional shape data and surface depth data of the elevator guide rail, build an elevator guide rail image enhancement model, and generate an enhanced seventh guide rail image through the image feature set, cross-sectional shape data, surface depth data and the elevator guide rail image enhancement model;
[0040] Guide rail length calculation module: used to obtain the fourth feature point set based on the seventh guide rail image, cross-sectional shape data and surface depth data, fit the guide rail two-dimensional contour curve based on the fourth feature point set, and calculate the length of the guide rail two-dimensional contour curve.
[0041] An electronic device includes a memory, a central processing unit, and a computer program stored in the memory and executable on the processor. When the processor executes the computer program, the steps in the guide rail guided stroke measurement method based on machine vision technology are implemented.
[0042] A computer-readable storage medium having a computer program stored thereon, wherein the computer program, when executed, implements the steps in the guide rail guided stroke measurement method based on machine vision technology.
[0043] Compared with the prior art, the present invention has the following beneficial effects:
[0044] By acquiring multispectral surface images of elevator guide rails, including visible light, near-infrared and mid-infrared images, the surface details and internal structural information of the guide rails can be fully captured; this multispectral imaging technology can reduce the details that may be missed by single-spectrum imaging and provide more accurate surface features and structural information.
[0045] Under different lighting conditions, adaptive lighting compensation technology can be used to perform lighting compensation on the first guide rail image, the second guide rail image and the third guide rail image to obtain images with uniform brightness; this helps to eliminate measurement errors caused by uneven lighting, improve image quality, and thus improve measurement accuracy.
[0046] The image enhancement model using the encoding-decoding network can effectively extract the deep semantic features, geometric structure features, and surface undulation features of the image; through the convolution kernel with multi-scale receptive field, it can better capture the details and global information of the image and generate clearer and more delicate enhanced images.
[0047] Through binarization processing, edge detection and feature point extraction technology, the feature point set of the guide rail can be accurately obtained. Combined with the cross-sectional shape data and surface depth data of the guide rail, a high-precision feature point set can be obtained, providing reliable data support for the fitting of the guide rail contour curve and length calculation.
[0048] The device of the present invention comprises an image acquisition module, an illumination compensation module, an image enhancement module and a guide rail length calculation module, and can realize fully automated operation from image acquisition and processing to length calculation, thereby reducing the need for manual intervention and improving the efficiency and consistency of the measurement process; the modular design of the device makes it have good scalability and flexibility; the various modules can be flexibly adjusted and combined according to specific application requirements to realize different measurement functions and performance requirements.
[0049] Through efficient image processing algorithms and enhanced models, a large amount of image data can be quickly processed, and enhanced images and feature point sets of the guide rails can be generated in real time, which greatly shortens the measurement time and improves the measurement efficiency.
[0050] By utilizing the fusion technology of visible light, near-infrared and mid-infrared images, the influence of factors such as ambient light interference and guide rail surface reflection on the measurement results can be minimized, thereby improving the stability and reliability of the measurement.
[0051] Through the extraction and matching technology of multiple features (texture features, edge features, corner point features), it is possible to effectively cope with the complex texture and shape changes on the guide rail surface and ensure the accuracy and stability of feature point matching.
[0052] The present invention is not only suitable for the precise measurement of elevator guide rails, but can also be applied to other fields that require high-precision guide rail measurement, such as mechanical processing, rail transportation, etc. Its powerful image processing capabilities and efficient measurement methods can adapt to different application scenarios and requirements. BRIEF DESCRIPTION OF THE DRAWINGS
[0053] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.
[0054] Figure 1 It is a principle flow chart of the guide rail guidance stroke measurement method based on machine vision technology in the present invention;
[0055] Figure 2 A flow chart of a method for generating an enhanced seventh guide rail image in a guide rail guide stroke measurement method based on machine vision technology of the present invention;
[0056] Figure 3 It is a flow chart of a method for obtaining a fourth feature point set according to the three-dimensional point cloud data of the guide rail in the guide rail guidance stroke measurement method based on machine vision technology of the present invention;
[0057] Figure 4 It is a flow chart of a method for fitting a two-dimensional contour curve of a guide rail based on a fourth feature point set in a guide rail guided stroke measurement method based on machine vision technology of the present invention;
[0058] Figure 5 A flow chart of a method for calculating the length of a two-dimensional contour curve of a guide rail in a guide rail guide stroke measurement method based on machine vision technology of the present invention;
[0059] Figure 6 It is a functional module diagram of the guide rail guidance stroke measurement device based on machine vision technology in the present invention;
[0060] Figure 7 A schematic diagram of the structure of an electronic device provided in one embodiment of the present application;
[0061] Figure 8 A schematic diagram of the computer-readable storage medium structure provided for one embodiment of the present application. DETAILED DESCRIPTION
[0062] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0063] Example 1
[0064] See also Figure 1 As shown, this embodiment provides a guide rail guidance stroke measurement method based on machine vision technology, including:
[0065] Step S1000, obtaining a multispectral surface image of an elevator guide rail, wherein the multispectral surface image includes visible light images, near infrared images, and mid-infrared images of different wavebands; obtaining a first guide rail image, a second guide rail image, and a third guide rail image according to the visible light image, the near infrared image, and the mid-infrared image;
[0066] Further, step S1000 includes:
[0067] Step S1100, obtaining a multispectral surface image of an elevator guide rail, wherein the multispectral surface image includes visible light images, near infrared images, and mid-infrared images of different wavebands;
[0068] Specifically, a visible light camera is used to obtain a visible light image of the rail surface with a wavelength range of 380nm-780nm; a short-wave infrared camera is used to obtain a near-infrared image of the rail surface with a wavelength range of 780nm-1100nm; and a long-wave infrared camera is used to obtain a mid-infrared image of the rail surface with a wavelength range of 3μm-5μm. Visible light images provide true color information of the rail surface, which conforms to the observation habits of the human eye and can intuitively reflect the surface state; near-infrared images are more sensitive to the details of the rail surface and can reveal tiny defects that are difficult to detect with the naked eye; mid-infrared images can reflect the thermal radiation distribution on the rail surface, which helps to detect internal cracks, delamination and other defects. Images in three different bands complement each other, depicting the surface features of the rail from multiple angles, overcoming the limitations of single-spectrum imaging. Multispectral imaging makes full use of the information of the electromagnetic spectrum, which can comprehensively and three-dimensionally reflect the state of the rail, and is crucial for subsequent defect detection and parameter measurement. Through the fusion analysis of images in different bands, multi-scale and multi-level characterization of the guide rail surface can be achieved, which makes it possible to fully understand the health status of the guide rail.
[0069] Step S1200, preprocessing the acquired multispectral surface image to obtain a first guide rail image, a second guide rail image and a third guide rail image;
[0070] Specifically, the acquired multispectral surface images are preprocessed in a necessary way. The purpose of preprocessing is to eliminate the noise and distortion introduced by the imaging process, improve the image quality, and lay the foundation for subsequent feature extraction and analysis. For visible light images, they are first converted into grayscale images, the brightness information is extracted, and the color space is simplified. Then, the dynamic range of the pixel grayscale value is stretched through histogram equalization to enhance the image contrast and obtain the first guide rail image. For near-infrared images, median filtering is used to remove high-frequency noise points. The median filter selects the median of the neighboring pixels to replace the current pixel through the sliding window, which can effectively suppress the salt and pepper noise. Then, the gamma transform is used to adjust the image grayscale and optimize the brightness distribution to obtain the second guide rail image. For mid-infrared images, the non-uniformity of the thermal imager will cause fixed pattern noise, which needs to be suppressed by the non-uniform correction algorithm. In addition, the Laplace operator is applied to the image to enhance the edge of the hot spot and the background, highlight the outline of the defect, and obtain the third guide rail image. Image preprocessing eliminates the adverse effects of imaging equipment and environmental factors, standardizes the image data format, and creates favorable conditions for subsequent processing. High-quality pre-processed images have the advantages of high signal-to-noise ratio, balanced grayscale distribution, and clear edges, which further highlight the key information of the rail surface. Preprocessing simplifies image data, reduces computational complexity, and shortens processing time. At the same time, improved image quality helps to improve the accuracy and reliability of subsequent analysis. Although preprocessing is only the first step in the entire measurement process, it is an indispensable and important link.
[0071] Step S2000, obtaining brightness distribution parameters of the first guide rail image, the second guide rail image, and the third guide rail image, and determining the illumination compensation coefficient and the camera exposure parameter according to the brightness distribution parameters; using the determined illumination compensation coefficient and the camera exposure parameter, performing adaptive illumination compensation on the first guide rail image, the second guide rail image, and the third guide rail image to obtain compensated fourth guide rail image, fifth guide rail image, and sixth guide rail image;
[0072] Furthermore, step S2000 includes:
[0073] Step S2100, obtaining brightness distribution parameters of the first guide rail image, the second guide rail image and the third guide rail image; the brightness distribution parameters of the first guide rail image include the actual grayscale mean m1 and the actual grayscale standard deviation σ1 of the first guide rail image, the brightness distribution parameters of the second guide rail image include the actual grayscale mean m2 and the actual grayscale standard deviation σ2 of the second guide rail image, and the brightness distribution parameters of the third guide rail image include the actual grayscale mean m3 and the actual grayscale standard deviation σ3 of the third guide rail image;
[0074] Specifically, by analyzing the brightness distribution of the three rail images, we can understand the illumination status during imaging. The grayscale mean reflects the overall brightness level, and the standard deviation reflects the degree of brightness dispersion. The larger the mean, the brighter the image as a whole; the larger the standard deviation, the stronger the contrast between light and dark in the image. By calculating the grayscale mean and standard deviation of the image, we can quantitatively describe the brightness distribution characteristics of the image in different bands. Comparing the brightness distribution parameters of different images helps to discover the changing trend of illumination. The brightness distribution parameters are an important basis for adaptive illumination compensation and affect the selection of compensation coefficients. Analyzing the brightness distribution can also examine the consistency of imaging. Excessive parameter differences indicate significant changes in imaging conditions. Obtaining accurate brightness distribution parameters is the primary prerequisite for achieving adaptive illumination compensation.
[0075] Step 2200, determining the illumination compensation coefficient and the camera exposure parameter according to the brightness distribution parameter;
[0076] Further, step S2200 includes:
[0077] Step S2210, setting the target grayscale mean M and the target grayscale standard deviation to E, and calculating the illumination compensation coefficient C in combination with the actual grayscale mean and the actual grayscale standard deviation of the image;
[0078] The calculation of the illumination compensation coefficient C comprises:
[0079]
[0080] in:
[0081] : represents the illumination compensation coefficient;
[0082] : is the sensitivity factor, which controls the compensation strength, and its value range is from 0 to 1. The larger α is, the stronger the compensation is;
[0083] : is the nonlinear adjustment factor 1;
[0084] : is the nonlinear adjustment factor 2;
[0085] : is the target grayscale mean;
[0086] : is the actual grayscale mean;
[0087] : is the target grayscale standard deviation;
[0088] : is the actual grayscale standard deviation;
[0089] β and γ introduce nonlinear adjustment. When β>1, the influence of brightness difference is amplified; when β<1, the influence of brightness difference is reduced. Similarly, γ adjusts the nonlinear degree of contrast difference. The values of β and γ can be determined according to experiments or experience to obtain the ideal compensation effect. M and E are preset constants, representing the desired image brightness and contrast, which can be set according to the specific application. m and σ are obtained by calculating the grayscale mean and standard deviation of the current image, reflecting the real-time lighting conditions. The formula adopts the form of an exponential function. When the actual brightness is lower than the target value and the contrast is insufficient, the exponential term is greater than 1, the illumination compensation coefficient C>1, and the image brightness is increased; conversely, when the actual brightness is higher than the target value and the contrast is too large, the exponential term is less than 1, the illumination compensation coefficient C<1, and the image brightness is suppressed. Compared with the linear model, the exponential function can achieve a smoother and continuous compensation effect and avoid sudden changes in brightness. The introduction of β and γ gives greater flexibility to illumination compensation. By adjusting β and γ, the degree of influence of brightness difference and contrast difference on the compensation coefficient can be nonlinearly controlled. Appropriate β and γ help strike a balance between brightness restoration and noise suppression, achieving a natural and soft compensation effect.
[0090] The preferred range of values for β and γ is usually determined through experiments and experience to ensure that ideal illumination compensation effects are obtained under different imaging conditions. The following is a detailed description of the process of determining these two parameters:
[0091] The preferred range of β: 0.5 to 2.0;
[0092] When β > 1, the effect of brightness difference is amplified, and insufficient brightness can be compensated more obviously;
[0093] When β < 1, the effect of brightness differences is reduced, making the compensation smoother and avoiding overcompensation.
[0094] The value range of 0.5 to 2.0 can find a balance between amplifying and reducing brightness differences, which is suitable for most application scenarios.
[0095] The preferred range of γ: 0.5 to 2.0;
[0096] When γ > 1, the effect of contrast differences is amplified, contributing to more significant compensation in high-contrast scenes;
[0097] When γ < 1, the effect of contrast differences is reduced, making the compensation softer and avoiding excessive contrast enhancement.
[0098] The value range of 0.5 to 2.0 can find a balance between amplifying and reducing contrast differences, which is suitable for different contrast conditions.
[0099] Experimental determination process of parameters:
[0100] Initial setup:
[0101] Choose a set of initial values, such as β = 1.0, γ = 1.0, as a baseline.
[0102] Experimental data collection:
[0103] Collect a large amount of image data under different lighting conditions, including different brightness and contrast levels, to ensure that the parameters are applicable to a variety of practical situations.
[0104] Experimental evaluation criteria:
[0105] Define evaluation criteria, such as image brightness uniformity, contrast distribution, noise level, etc., which should be able to quantify the lighting compensation effect.
[0106] Parameter adjustment and optimization:
[0107] Process the image using the initial parameters and observe and record the compensation effect.
[0108] Adjust β and γ gradually and observe the compensation effect after each adjustment. For example, you can try different values of β between 0.5 and 2.0 and different values of γ between 0.5 and 2.0.
[0109] After each adjustment, the images were evaluated using pre-defined evaluation criteria.
[0110] Parameter selection:
[0111] Based on the evaluation results, select the β and γ values that optimize image brightness and contrast. These values should strike a balance between brightness uniformity, contrast distribution, and noise level.
[0112] Verification and Application:
[0113] Verify the selected parameters in more real-world scenarios to ensure their wide applicability.
[0114] Depending on the needs of the actual application, further fine-tuning of parameters may be required.
[0115] For example, suppose that 100 images under different lighting conditions are collected in the experiment, and the initial parameters are set to β = 1.0 and γ = 1.0. By adjusting the values of β and γ between 0.5 and 2.0, the compensation effects under different parameters are gradually tested and recorded. Finally, it is found that when β = 1.5 and γ = 1.2, the brightness uniformity and contrast distribution of the image are optimal, and the noise level is also within an acceptable range. Therefore, β and γ are set to 1.5 and 1.2 respectively as the preferred parameters.
[0116] Step S2220, obtaining a visible light compensation coefficient C1 according to the actual grayscale mean m1 and the actual grayscale standard deviation σ1 of the first guide rail image; if C1>1, increasing the exposure time of the visible light camera; if C1<1, reducing the exposure time of the visible light camera;
[0117] Step S2230, obtaining a short-wave infrared compensation coefficient C2 according to the actual grayscale mean m2 and the actual grayscale standard deviation σ2 of the second guide rail image; if C2>1, increasing the exposure gain of the short-wave infrared camera; if C2<1, decreasing the exposure gain of the short-wave infrared camera;
[0118] Step S2240, according to the actual grayscale mean m3 and the actual grayscale standard deviation σ3 of the third guide rail image, obtain the long-wave infrared compensation coefficient C3; if C3>1, then reduce the detection limit of the thermal imager and improve the sensitivity; if C3<1, then increase the detection limit of the thermal imager and reduce the sensitivity;
[0119] Specifically, the calculation formula of the illumination compensation coefficient is used as a quantitative indicator to compare the image brightness distribution parameters with the ideal brightness threshold, and the adjustment direction and amplitude of the illumination compensation coefficient and the camera exposure parameters are determined accordingly. By substituting the actual grayscale mean and standard deviation into the formula, the illumination compensation coefficients of the three bands of visible light, short-wave infrared and long-wave infrared can be calculated in a targeted manner. When the compensation coefficient is greater than 1, it means that the actual brightness is lower than the target value and the image brightness needs to be increased. For visible light cameras, the amount of light entering is increased by extending the exposure time; for short-wave infrared cameras, weak signals are amplified by increasing the exposure gain; for long-wave infrared thermal imagers, more low-temperature targets are captured by lowering the detection limit. Conversely, when the compensation coefficient is less than 1, it means that the actual brightness is higher than the target value and the image brightness needs to be suppressed. Accordingly, visible light cameras should shorten the exposure time to avoid overexposure; short-wave cameras should reduce the gain to reduce noise; thermal imagers should increase the detection limit to avoid thermal image saturation.
[0120] By quantitatively calculating the illumination compensation coefficient and dynamically adjusting the camera exposure parameters accordingly, more accurate and continuous adaptive illumination compensation can be achieved. The calculation of the compensation coefficient fully considers the two characteristics of the mean and standard deviation of the image brightness, and can fully reflect the changes in the illumination conditions. The compensation coefficient is directly associated with the exposure parameter adjustment to form a complete closed-loop control system, which can adaptively correct the illumination effect online without manual intervention. At the same time, the illumination compensation coefficient, as a post-processing parameter, can also be used to guide the image enhancement algorithm to further optimize the image brightness and contrast at the software level. The larger the compensation coefficient, the greater the image enhancement; the smaller the compensation coefficient, the smaller the image enhancement. By combining the imaging parameter adjustment with the post-processing algorithm, it is possible to dynamically adapt to illumination changes in a larger range and obtain high-quality images with uniform brightness and rich layers. Step S2200 uses the illumination compensation coefficient calculation formula as a bridge to organically combine the image brightness distribution parameters with the adjustment of the camera exposure parameters to form a quantitative adaptive illumination compensation strategy. This strategy dynamically calculates the compensation coefficient and synchronously adjusts the imaging parameters and post-processing parameters accordingly. It can achieve adaptive compensation for illumination changes at both the hardware and software levels, thereby obtaining high-quality images with constant brightness and clear details.
[0121] Step S2300, using the determined illumination compensation coefficient and camera exposure parameters, adaptive illumination compensation is performed on the first guide rail image, the second guide rail image and the third guide rail image to obtain a fourth guide rail image, a fifth guide rail image and a sixth guide rail image; the adaptive illumination compensation calculation formula includes a logarithmic transformation part and a spatial adaptive modulation part;
[0122] Specifically, the three guide rail images are adaptively compensated using the illumination compensation coefficient and camera exposure parameters determined in the previous step. The compensation process is divided into two parts: front-end imaging parameter adjustment and back-end image enhancement. Front-end imaging parameter adjustment suppresses illumination disturbances at the source of image formation by optimizing the camera's exposure time, gain, etc.; back-end image enhancement uses digital image processing methods to correct image brightness after imaging. The two compensation methods are combined to minimize the impact of illumination changes in both acquisition and processing. The compensated fourth, fifth, and sixth guide rail images have uniform brightness and a moderate dynamic range, which can mine more texture details on the guide rail surface. Stable image brightness is conducive to simplifying subsequent processing algorithms and reducing illumination robustness requirements. Adaptive illumination compensation improves imaging quality, expands the environmental adaptability of machine vision systems, and provides a strong guarantee for guide rail measurement.
[0123] Step S2000 systematically studies the impact of ambient light changes on image quality and proposes an adaptive compensation strategy. By analyzing the grayscale statistical parameters of images in different bands, the light fluctuations can be grasped in real time. On this basis, starting from the two aspects of imaging parameters and image enhancement, a closed-loop compensation mechanism combining hardware and software is constructed. The imaging end dynamically optimizes the camera exposure time, gain, etc. according to the lighting conditions; the image enhancement end automatically adjusts the lighting compensation coefficient to smooth the brightness distribution. The two methods complement each other, effectively suppressing light disturbances and keeping the image consistent in brightness. Adaptive compensation expands the dynamic range of the imaging system, improves the lighting robustness, and obtains high-quality images with uniform brightness and rich layers. High-quality images simplify subsequent analysis algorithms, reduce dependence on preprocessing, and provide a reliable data basis for guide rail measurement.
[0124] The calculation formula of the adaptive illumination compensation includes:
[0125]
[0126] in:
[0127] : is the image after illumination compensation at the pixel coordinate (x, y);
[0128] : is the original image at the pixel coordinate (x, y);
[0129] : is the illumination compensation coefficient;
[0130] : is the amplitude adjustment factor;
[0131] : is the spatial frequency at the pixel coordinate (x, y), which indicates the fluctuation speed of the sine function in the image;
[0132] SI: image size;
[0133] : Logarithmic transformation part;
[0134] : Spatial adaptive modulation part;
[0135] Logarithmic transformation part To achieve illumination compensation, When , the image brightness is increased; when The introduction of logarithmic function makes the brightness adjustment smoother, avoiding overexposure or underexposure, while stretching the low grayscale area and compressing the high grayscale area to enhance the image layering. Spatial adaptive modulation is introduced to dynamically adjust the compensation intensity according to the pixel position. Spatial frequency refers to the frequency of signal changes of an image in the spatial domain. Controls the frequency of the sine function, The larger it is, the smaller the spatial scale of brightness adjustment is. is the amplitude adjustment factor, which controls the intensity of sinusoidal modulation, and SI is the image size, which is used to normalize the coordinates.
[0136] Through spatial adaptive modulation, the compensation formula can apply different degrees of brightness adjustment to different areas of the image according to different pixel positions, which is more flexible and precise; the periodicity of the sine function ensures the continuity and smoothness of the brightness adjustment and avoids block artifacts. The frequency f and amplitude B can be adaptively selected according to the image content and illumination distribution characteristics to obtain the best compensation effect. f can be determined by analyzing the frequency domain characteristics of the image or the spatial scale of the illumination distribution, and B can be adaptively adjusted by evaluating the brightness statistical parameters of the local area of the image.
[0137] In summary, the adaptive illumination compensation formula combines logarithmic transformation and spatial adaptive modulation, which can improve the overall brightness of the image while applying refined brightness adjustments according to different pixel positions to obtain a natural and balanced compensation effect. Logarithmic transformation enhances the image layering, and spatial adaptive modulation improves the flexibility and precision of compensation. The two complement each other and jointly improve the compensation performance.
[0138] Step S3000, extracting multi-scale, multi-directional texture features, edge features, and corner features of the fourth guide rail image, the fifth guide rail image, and the sixth guide rail image to obtain an image feature set, collecting cross-sectional shape data and surface depth data of the elevator guide rail, and constructing an elevator guide rail image enhancement model, and generating an enhanced seventh guide rail image through the image feature set, the cross-sectional shape data, the surface depth data, and the elevator guide rail image enhancement model;
[0139] Furthermore, step S3000 includes:
[0140] Step S3100, extracting multi-scale, multi-directional texture features, edge features, and corner point features of the fourth guide rail image, the fifth guide rail image, and the sixth guide rail image to obtain an image feature set;
[0141] Step S3200, collecting cross-sectional shape data and surface depth data of the elevator guide rail, constructing an elevator guide rail image enhancement model, and generating an enhanced seventh guide rail image through the image feature set, the cross-sectional shape data, the surface depth data and the elevator guide rail image enhancement model;
[0142] Furthermore, if Figure 2 As shown, step S3200 includes:
[0143] Step S3210, collecting cross-sectional shape data and surface depth data of the elevator guide rail, and constructing an elevator guide rail image enhancement model, wherein the elevator guide rail image enhancement model adopts an encoding-decoding network, wherein the encoding-decoding network includes an encoding part and a decoding part; the encoding-decoding network uses a convolution kernel with a multi-scale receptive field in each layer;
[0144] Step S3220, using an ultrasonic sensor to collect cross-sectional shape data of the guide rail, and using a laser sensor to collect surface depth data of the guide rail;
[0145] Step S3230, inputting the image feature set, the cross-sectional shape data, and the surface depth data into the elevator guide rail image enhancement model, gradually reducing the feature map size in the image feature set in the encoding part of the elevator guide rail image enhancement model, and extracting deep semantic features of the fourth guide rail image, the fifth guide rail image, and the sixth guide rail image;
[0146] Step S3240, performing a convolution operation on the cross-sectional shape data and the surface depth data to extract geometric structure features and surface relief features of the elevator guide rail;
[0147] Step S3250, fusing deep semantic features, geometric structure features, and surface relief features in the middle layer of the elevator guide rail image enhancement model to generate a fused feature map;
[0148] Step S3260, restoring the fused feature map in the decoding part, reconstructing the image details, and generating an enhanced seventh guide track image;
[0149] Specifically, a deep learning-based elevator guide rail image enhancement model is built for the guide rail surface image. The fourth, fifth, and sixth guide rail images are used as inputs and high-quality real guide rail images are used as labels. Through end-to-end supervised training, complex image degradation mapping is learned and an enhanced seventh guide rail image is generated. The deep learning model adopts an encoding-decoding network architecture, in which the encoding part gradually reduces the feature map size and extracts deep semantic features, and the decoding part gradually restores the feature map size and reconstructs image details. Each layer of the network uses convolution kernels with multi-scale receptive fields to extract local and global multi-scale texture information. The introduction of a residual learning strategy enables the network to focus on learning the difference between degraded images and real images, accelerate convergence, and improve the peak signal-to-noise ratio and visual quality of the restored image.
[0150] Each layer of the encoding-decoding network uses convolution kernels with multi-scale receptive fields, which can capture image features of different scales and improve the richness and accuracy of feature extraction; the encoding part of the encoding-decoding structure compresses image features layer by layer and extracts deep features; the decoding part restores the image layer by layer and reconstructs the image details. This structure can effectively handle complex image enhancement tasks; using the powerful feature extraction and representation capabilities of deep learning models, the image enhancement effect can be significantly improved, especially when dealing with complex and nonlinear features; the encoding part gradually reduces the size of the feature map in the image feature set, which can extract the deep semantic features of the image and enhance the image's detail information and semantic expression capabilities; through the encoding process, different features of the image can be captured at different levels, providing richer feature representation; the extraction of deep semantic features helps subsequent image reconstruction and enhancement, improving image quality and visual effects.
[0151] The combination of ultrasonic sensors and laser sensors can provide the cross-sectional shape and surface depth information of the guide rail, characterize the characteristics of the guide rail from multiple angles and dimensions, fuse the cross-sectional shape data and surface depth data of the guide rail collected by ultrasonic and laser sensors in the deep network, and obtain detailed surface information of the guide rail through multiple sensors, which is helpful for detecting and analyzing the tiny defects and structural features of the guide rail. The cross-sectional shape data and surface depth data are fused with the surface image features in the middle layer of the network, so that the network can combine multi-modal information such as surface image, contour, depth, etc. to enhance the accuracy of image restoration. The fusion of multi-source data at different semantic levels within the network is achieved by feature splicing or feature weighting. The fused feature map contains complementary information of image texture and guide rail geometry, which can guide the network to better restore the true appearance of the guide rail. The convolution operation can extract the geometric structure features of the elevator rails, thereby accurately reflecting the shape and structure of the rails. By processing the surface depth data through the convolution operation, the subtle undulations and changes of the rail surface can be captured, helping to identify surface defects and irregular parts. The convolution operation has efficient feature extraction capabilities and can quickly process large-scale sensor data to improve the efficiency of feature extraction and analysis. By fusing deep semantic features, geometric structure features, and surface undulation features in the middle layer, multiple features can be used in combination to improve the integrity and accuracy of feature representation; the fused feature map contains more dimensional information, which helps to generate more expressive and detailed images; the fusion of multiple features can enhance the model's ability to recognize different types of defects and features, and improve the robustness and adaptability of the model.
[0152] Multi-source data fusion enhances the generalization performance of deep learning models. Single-modality image restoration faces challenges such as unstable imaging quality and loss of detailed texture. The introduction of multi-source data such as ultrasound and laser can make up for the shortcomings of single image information and constrain image quality from multiple dimensions such as guide rail cross-section and depth. This enables the network to make full use of the complementary advantages of multiple sensors, solve the influence of adverse factors such as lighting, occlusion, and blur, and generate high-quality guide rail images with uniform brightness, clear texture, and sharp edges.
[0153] Multi-source fusion deep learning image enhancement breaks through the limitations of traditional image restoration methods. Traditional methods mainly rely on simplified degradation models and prior knowledge, and are difficult to deal with image degradation in complex scenes. The deep learning-based method learns the mapping relationship between degradation and restoration from a large number of real images, and has stronger nonlinear expression capabilities and data-driven adaptability. By incorporating multi-source data such as ultrasound and laser, the deep network can establish an association model between images, contours, and depths, achieve deep fusion at the information level, and comprehensively improve the performance of image enhancement. The enhanced seventh rail image has the advantages of being robust, clear, and accurate, providing a high-quality data foundation for subsequent defect detection and parameter measurement.
[0154] The restoration of the fused feature map in the decoding part requires gradually restoring the spatial resolution of the feature map and reconstructing the image details. Use deconvolution (transposed convolution), interpolation (such as bilinear interpolation) or anti-pooling to gradually restore the spatial resolution of the feature map; directly connect the corresponding layer of the encoding part to the layer of the decoding part for upsampling, and pass the high-resolution features extracted in the encoding process directly to the decoding process to help restore the details; after each upsampling, use the convolution layer to gradually restore the details of the image. The size of the convolution kernel can correspond to the encoding part, and continue to use convolution kernels with multi-scale receptive fields (such as 3x3 and 5x5); normalize the output of the convolution layer to ensure the stability of the training process and accelerate convergence; use the ReLU activation function to give the network nonlinear expression capabilities; use a 1x1 convolution kernel to generate the final guide rail image to ensure that the number of channels of the output image is consistent with the target image; the decoding part restores the fused feature map, which can reconstruct the image details and generate a high-quality enhanced image; by restoring and reconstructing the feature map, the clarity and detail performance of the image can be significantly improved, and the visual effect can be improved; using the information of the fused feature map in the decoding process, the image can be restored more comprehensively, ensuring that the enhanced image has higher accuracy and authenticity.
[0155] Step S3300, binarizing the seventh guide rail image to obtain a binarized guide rail image, using an 8-neighborhood tracking method, starting from the upper left corner of the binarized guide rail image, scanning the guide rail edge pixels clockwise, recording the coordinates of the edge points, and obtaining a first feature point set;
[0156] Specifically, the seventh guide rail image is binarized by using the threshold segmentation method, and the seventh guide rail image is converted into a black-and-white guide rail image. The grayscale threshold T is set, and the pixels with grayscale values greater than T in the black-and-white guide rail image are set to white, and the pixels with grayscale values less than T are set to black to obtain a binary image; the binary image is morphologically processed to eliminate isolated noise points and small fractures; first, a dilation operation is performed to expand the edge of the guide rail and fill the holes in the contour; then an corrosion operation is performed to shrink the non-guide rail area and remove edge burrs; linear elements are selected as the structural elements of the dilation and corrosion to maintain the straight line features of the guide rail; the binary image after morphological processing is scanned to extract feature points on the edge of the guide rail; the 8-neighborhood tracking method is used to scan the guide rail edge pixels clockwise starting from the upper left corner of the image, and the coordinates of the edge points are recorded to obtain the first feature point set; the first feature point set describes the geometric contour of the guide rail.
[0157] Threshold segmentation is the simplest and most intuitive image segmentation method, and is particularly effective for images with obvious grayscale differences. By setting a global threshold, the target and background can be quickly distinguished. Since the guide rail presents different grayscale characteristics from the surrounding environment in the image, the guide rail area can be extracted by threshold segmentation. The selection of the threshold needs to comprehensively consider the grayscale distribution of the guide rail and the background, which can be obtained through historical data statistics or image analysis. Too high or too low thresholds will cause segmentation distortion. Although threshold segmentation is simple and fast, it is sensitive to noise and illumination changes, and is prone to holes and breaks. Morphological processing can be used to improve the segmentation effect. The expansion operation diffuses the foreground pixel value to the neighborhood through the translation of the structural element, which can fill the holes in the target area; the erosion operation diffuses the background pixel value to the neighborhood through the translation of the structural element, which can eliminate the burrs on the edge of the target. The structural elements of expansion and erosion determine the processing effect, and should be selected according to the characteristics of the guide rail. Linear elements can better maintain the continuity of straight lines and suppress nonlinear noise. After morphological restoration, the guide rail area is smoother and more complete. Based on the binary image, the edge extraction of the guide rail is transformed into a contour tracking problem. Since the guide rail is in the shape of a slender strip in the image, its edge points can be obtained in sequence by scanning clockwise from the upper left corner; 8-neighborhood tracking can detect oblique edges and improve the density of edge points. The guide rail position information is recorded in the form of edge point coordinate sequence, which can save storage space. The coordinate sequence implies the topological relationship of the edge points, which is conducive to subsequent contour analysis. In short, image segmentation and edge extraction obtain the first feature point set, which describes the pixel-level contour of the guide rail. This feature point set is directly derived from the visual sensor and has the advantages of being intuitive and reliable, but it only reflects the surface information of the guide rail. In order to more comprehensively grasp the state of the guide rail, it is necessary to combine other sensors to obtain more features.
[0158] Step S3400, obtaining ultrasonic contour feature points based on the cross-sectional shape data of the guide rail collected by the ultrasonic sensor; obtaining laser distance feature points based on the surface depth data of the guide rail collected by the laser sensor; performing coordinate transformation on the ultrasonic contour feature points and the laser distance feature points, unifying them into a local coordinate system with the center of the guide rail as the origin, to obtain a second feature point set;
[0159] Specifically, ultrasonic detection uses the propagation and reflection characteristics of sound waves in the medium to detect the cross-sectional shape of the guide rail. When the ultrasonic wave encounters the boundary of the guide rail, a reflected echo is generated. By analyzing the flight time and amplitude of the echo signal, the spatial position of the cross-sectional area of the guide rail can be determined. Envelope detection highlights the energy characteristics of the echo by extracting the envelope of the echo signal; threshold judgment distinguishes the echo of the guide rail boundary from the noise echo by setting the energy threshold. Ultrasonic detection has a small blind area and strong penetration ability. It can obtain the geometric information of the cross-sectional area of the guide rail, which makes up for the shortcomings of visual detection. However, it is limited by the divergence of the ultrasonic beam and the detection resolution is limited. Laser ranging is based on the relationship between the travel time of light and the distance of the guide rail during propagation. It is used to obtain the distance information from the surface of the guide rail to the sensor. The laser beam has good directivity and monochromaticity. By accurately controlling the emission angle of the laser beam, high-resolution scanning of the surface of the guide rail can be achieved. The flight time of the laser reflection signal is proportional to the distance from the surface of the guide rail to the sensor. The flight time can be accurately measured by a high-speed timer, thereby obtaining a millimeter-level distance resolution. The distance data obtained by scanning is arranged according to coordinates, that is, a set of laser distance feature points is obtained. Laser ranging and visual inspection belong to non-contact detection, which can obtain high-precision three-dimensional information of the local area of the guide rail. However, it is easily affected by the reflective characteristics of the guide rail surface. In order to fuse the heterogeneous data obtained by different sensors, coordinate transformation is required to unify them into the same reference system. A local coordinate system is established with the center of the guide rail as the origin. The x-axis is along the length of the guide rail, the y-axis is perpendicular to the plane of the guide rail, and the z-axis is perpendicular to the x-axis and y-axis. The position of the ultrasonic and laser sensors relative to this coordinate system can be obtained by active calibration or manual measurement. The process of transforming the sensor coordinates to the local coordinates is essentially a rigid body transformation, including two steps of translation and rotation. Compared with the feature point set obtained by image segmentation, the feature point set obtained by the sensor belongs to sparse discrete sampling, but contains cross-sectional and depth information. Fusion of the two types of complementary feature point sets can obtain a more three-dimensional and complete understanding of the guide rail.
[0160] Step S3500, fusing the first feature point set and the second feature point set to obtain a third feature point set;
[0161] Specifically, the third feature point set covers the detection results of three sensors: vision, ultrasound, and laser, and integrates multi-scale features such as contour, distance, and cross-section, so it has a more accurate and comprehensive description of the spatial configuration of the guide rail. The third feature point set samples the guide rail in both two-dimensional and three-dimensional scales, and comprehensively describes the spatial configuration of the guide rail. It is worth noting that the fusion process may introduce data redundancy. In order to reduce the subsequent storage and processing pressure, it is necessary to screen the third feature point set and remove duplicate points that are too close. The process of multi-sensor detection and data fusion of the guide rail can be used to obtain the spatial geometric information of the guide rail and provide a data basis for the guide rail state monitoring and surface reconstruction. For example, in the guide rail integrity detection, the third feature point set can be used to reconstruct the three-dimensional model of the guide rail to analyze whether the guide rail has defects such as breakage and detachment. For example, in the guide rail prestress detection, the third feature point set can be compared with the design model to evaluate the stress deformation of the guide rail. Compared with single sensor data, the third feature point set contains richer and more reliable guide rail state information. Feature point fusion makes up for the deficiencies of different sensors in terms of resolution, blind spots, etc., and forms a more three-dimensional and complete perception of the guide rail. In summary, as a product of multi-sensor fusion, the third feature point set integrates the advantages of vision, ultrasound, and laser detection, and can provide more reliable and accurate data support for guide rail status monitoring.
[0162] Step S3000 starts from the guide rail surface image and extracts and fuses the guide rail state information at three levels: image domain, feature domain, and decision domain. Through image segmentation, two-dimensional contour features reflecting the surface morphology of the guide rail can be obtained; through edge extraction and coordinate transformation, three-dimensional surface features describing the spatial position of the guide rail can be obtained; through heterogeneous data association, multi-scale fusion features that take into account the internal structure and external shape of the guide rail can be obtained. Image segmentation uses threshold segmentation and morphological processing to accurately separate the guide rail area of interest from the visual image and obtain the first feature point set. Ultrasonic detection and laser ranging extract the depth information of the cross section and surface of the guide rail from the reflected signals of sound waves and light waves to obtain the second feature point set. The fusion of the three sensors of vision, ultrasound, and laser can provide a more accurate and comprehensive description of the spatial configuration of the guide rail.
[0163] Step S4000, coordinate transformation is performed on the third feature point set to obtain three-dimensional point cloud data of the guide rail; a fourth feature point set is obtained according to the three-dimensional point cloud data of the guide rail, a two-dimensional contour curve of the guide rail is fitted based on the fourth feature point set, and the length of the two-dimensional contour curve of the guide rail is calculated;
[0164] Furthermore, step S4000 includes:
[0165] Step S4100, constructing a three-dimensional space coordinate system, performing coordinate transformation on the third feature point set, and obtaining three-dimensional point cloud data of the guide rail;
[0166] Specifically, before 3D reconstruction, a unified spatial reference system needs to be established first. Since different images have their own coordinate systems in multi-sensor data fusion, they need to be unified into the same 3D spatial coordinate system. A common method is to select the coordinate system of one of the sensors as the global coordinate system, and then align the local coordinate systems of other sensors with it through coordinate transformation. Coordinate transformation requires knowing the relative position and posture relationship between different coordinate systems, which can be obtained through calibration. Once a unified 3D spatial coordinate system is established, the coordinates of all feature points in the third feature point set can be transformed from their respective local coordinate systems to the global coordinate system to form the 3D point cloud data of the guide rail. Each point in the point cloud data is represented by a 3D coordinate (X, Y, Z), which reflects the spatial position information of the guide rail surface. A high-quality 3D point cloud should have the characteristics of high point density, uniform distribution, and low noise. The unified coordinate system lays the foundation for subsequent 3D reconstruction, so that data from different perspectives and different sensors can be processed and analyzed in the same framework. The accuracy of coordinate transformation directly affects the accuracy of the reconstructed model, so a high-precision calibration method is required, and the calibration results need to be verified and optimized. Through coordinate transformation, discrete, multi-source two-dimensional image data are integrated into a unified three-dimensional point cloud form, which is a key step in achieving three-dimensional reconstruction.
[0167] Step S4200, performing noise reduction processing on the three-dimensional point cloud data of the guide rail to obtain a fourth feature point set;
[0168] Specifically, the original 3D point cloud data often contains a large amount of noise and outliers. These outlier data neither belong to the rail surface nor represent real defects. They are often introduced by factors such as imaging noise and environmental interference. In order to improve the accuracy of 3D reconstruction, the point cloud data must be denoised. Common point cloud denoising methods include statistical filtering, ray tracing, and surface fitting. Statistical filtering removes outliers compared to surrounding points by analyzing the local neighborhood of the point cloud; ray tracing removes suspended points and scattered points by simulating the interaction between light and the surface of the object; surface fitting treats points that deviate from the fitting surface as noise and removes them by fitting the local shape of the point cloud. Choosing a suitable denoising method requires weighing factors such as computational efficiency, parameter complexity, and the degree of retention of real details. Usually, multiple methods can be used in cascade, first removing obvious outliers, and then adjusting the remaining parts to achieve the best balance between denoising and fidelity. After denoising, the point cloud becomes smoother and flatter, the noise is effectively suppressed, and the real rail surface details are retained. Denoising makes the features in the point cloud more obvious, which is conducive to extracting high-confidence feature points. The point cloud after denoising is called the fourth feature point set, which will be used for subsequent guided stroke measurement. A high-quality fourth feature point set should have the advantages of uniform point density, low noise, and detail fidelity, which is an important guarantee for accurate reconstruction and measurement.
[0169] Furthermore, if Figure 3 As shown, step S4200 includes:
[0170] Step S4210, calculating the normal vector and curvature of each point in the three-dimensional point cloud, and marking points with abnormal normal vectors and curvature as noise points;
[0171] Step S4220, performing statistical analysis on the neighborhood points around the noise point, calculating the mean coordinates and mean square error of the neighborhood points, and removing the noise points whose deviation from the mean coordinates exceeds the mean square error threshold;
[0172] Step S4230, using a B-spline surface to perform approximate fitting on the remaining point cloud, treating points whose fitting residuals exceed a residual threshold as noise and removing them, to obtain a fourth feature point set;
[0173] The normal vector of the point cloud reflects the direction of the local surface, and the curvature reflects the degree of curvature of the local surface. Noise points often show that the normal vector direction is disordered and the curvature is much higher than the real surface. By calculating the normal vector and curvature of each point and comparing it with its neighboring points, noise points can be detected. Common normal vector estimation methods include PCA, Hough Transform, etc., and curvature estimation methods include spherical fitting, surface fitting, etc. The threshold for noise point detection needs to be set according to the actual characteristics of the point cloud. It is necessary to remove noise as much as possible and avoid misjudging real sharp details as noise. B-spline surface is a parameterized free-form surface with good smoothness and local controllability, and can approximate complex shapes well. By fitting the B-spline surface with the point cloud through the least squares method, the real shape of the guide rail can be restored to the greatest extent. The fitting residual reflects the distance between each point and the fitting surface. Points with too large residuals are likely to be noise points that have not been eliminated. By setting the residual threshold, the point cloud data can be further purified. The order of the fitting method, the number of control points, the node vector and other parameters need to be adjusted according to factors such as the density of the point cloud and the complexity of the details, so as to balance the fitting accuracy and computational efficiency. The refined point cloud obtained after fitting is the fourth feature point set, which eliminates most of the noise interference and well maintains the shape details of the guide rail, making it an ideal data source for precise measurement.
[0174] In summary, noise reduction processing can significantly improve the quality of point cloud data and lay a solid foundation for subsequent guided stroke measurement. Through a series of methods such as normal vector and curvature analysis, statistical filtering, and surface fitting, noise points are effectively identified and eliminated, while the real surface details are retained to the greatest extent. The fourth feature point set has a good balance between noise reduction and fidelity, and is a high-level summary and refinement of the spatial structure of the guide rail. The high-quality fourth feature point set provides reliable data support for the three-dimensional reconstruction of the guide rail and the guided stroke measurement, which helps to improve the measurement accuracy and reduce errors. It should be noted that noise reduction is not a one-time process, and it often requires iterative optimization and repeated debugging to find the best parameter settings. At the same time, noise reduction is not the stronger the better. Excessive noise reduction may cause loss of details and affect the measurement results. Therefore, in practical applications, it is necessary to weigh and select appropriate noise reduction strategies based on the specific characteristics of the guide rail and the measurement accuracy requirements.
[0175] Step S4300, fitting a two-dimensional contour curve of the guide rail based on the fourth feature point set;
[0176] Furthermore, if Figure 4 As shown, step S4300 includes:
[0177] Step S4310, extracting n key contour points from the fourth feature point set, where the key contour points include the end points, inflection points and curvature extreme points of the guide rail;
[0178] Specifically, by analyzing the geometric distribution of the fourth feature point set, the key points that are crucial to describing the contour shape of the guide rail can be identified. The end points of the guide rail represent the starting and ending positions of the track and are the basis for determining the guidance stroke. The track direction changes suddenly at the turning point, indicating a significant change in the shape of the guide rail. The curvature extreme point corresponds to the local maximum or minimum curvature of the guide rail, reflecting the curvature of the track. These three types of key contour points contain rich information about the shape of the guide rail and are the support points for contour fitting. Extracting key contour points can significantly reduce the amount of data and simplify the computational complexity. At the same time, the selection of key points will also affect the fitting accuracy. It is necessary to balance the number of points and shape fidelity. Generally, the density of key points can be controlled by setting the curvature threshold or spacing threshold. The end points and turning points can be obtained using the corner detection algorithm, such as Harris corner points, SUSAN corner points, etc. The curvature extreme point can be calculated by the differential geometry method. The extracted key contour points reflect the overall direction and local shape characteristics of the guide rail and are the skeleton for subsequent fitting. Reasonable selection of key points can avoid data redundancy and ensure the integrity of the contour, laying the foundation for accurate reconstruction of the shape of the guide rail.
[0179] Step S4320, mapping the n key contour points to a two-dimensional plane to construct a two-dimensional key contour point set;
[0180] Specifically, since the fourth feature point set is derived from multi-view 3D reconstruction, its coordinate values are distributed in 3D space. To facilitate contour fitting, the key contour points need to be uniformly mapped to a 2D plane. Coordinate mapping is a common method of shape analysis, which can simplify complex 3D problems into 2D problems. The selection of the mapping plane should be as parallel as possible to the plane where the guide rail is actually located, so as to truly reflect the shape characteristics of the guide rail; usually, a plane perpendicular to the length direction of the guide rail can be selected, or principal component analysis can be performed on the point cloud, and the first principal direction can be taken as the normal of the mapping plane. The key contour points are projected onto the plane to obtain the corresponding two-dimensional point set; plane mapping involves coordinate system transformation, and the influence of scale, rotation and translation factors must be considered. In order to maintain shape invariance, isometric or conformal mapping should be used. Orthogonal projection is the simplest isometric mapping, while conformal mapping can use oblique projection or perspective projection. Choosing a suitable coordinate mapping method can not only reduce the data dimension, but also retain the geometric characteristics of the guide rail, creating favorable conditions for subsequent fitting; the two-dimensional key contour point set intuitively depicts the distribution of the guide rail in space, and contains geometric information such as the track direction, length, and curvature. By making the discrete points continuous, the two-dimensional contour curve of the guide rail can be reconstructed. Reasonable two-dimensional mapping simplifies the expression of the problem, reduces the amount of calculation, and helps to improve the fitting efficiency and accuracy.
[0181] Step S4330, fitting the two-dimensional key contour point set to generate a two-dimensional contour curve of the guide rail; the two-dimensional contour curve includes n-1 curve segments, and the spline function of the n-1 curve segments is { , key contour points and The spline function of the curve segment between is ,in ;
[0182] Specifically, curve fitting is the process of constructing a continuous curve from discrete points, and the guide rail profile can be explicitly described by an analytical function. Common fitting methods include polynomial fitting, spline fitting, parametric curve fitting, etc. Among them, polynomial fitting uses polynomial functions to approximate discrete points, which has the advantages of simple form and convenient calculation, but high-order terms may introduce oscillation. Spline fitting uses piecewise low-order polynomials to smoothly connect, and satisfies a certain order of derivative continuity at the spline nodes, such as cubic splines, which can avoid the Runge phenomenon and better approximate complex shapes. Parametric curves such as Bezier curves and B-spline curves have good geometric intuitiveness and interactivity, are easy to adjust local shapes, and are widely used in the field of computer graphics. The key to fitting is to balance the approximation accuracy and complexity. Through optimization methods such as the least squares method, a compromise can be found between fitting error and model simplicity. Increasing the density of key points helps improve the approximation accuracy, but it also increases the computational overhead. Curve smoothness is also an important consideration. Too smooth may lose shape details, and too rough is not realistic. Introducing regularization terms can avoid overfitting and improve generalization performance. The fitted two-dimensional contour curve of the guide rail expresses the track geometry in an analytical form, which can be easily used to calculate and analyze shape features such as length, slope, and curvature. High-precision fitting can truly reproduce the shape of the guide rail and reduce measurement errors. Smooth and continuous contour curves also help to achieve digital expression and visual presentation of the guide rail. Curve fitting technology bridges the gap between discrete sampling and continuous shapes, and plays an indispensable role in track measurement.
[0183] The equation of the two-dimensional contour curve is:
[0184] Assume there is a set of key contour points ,in , n represents the total number of key contour points;
[0185] For each interval , there is a cubic polynomial equation:
[0186] ;
[0187] in, is the unknown coefficient, is a constant term, is the coefficient of the first-order term, is the coefficient of the quadratic term, is the cubic coefficient; Indicates Segment spline function, each is a cubic polynomial, which is used to fit the two-dimensional profile curve of the guide rail in this interval. x is the interval ] within the independent variable.
[0188] In order to solve , the following solution conditions need to be met:
[0189] Interpolation condition: The curve must pass through the data point at each node;
[0190] Smoothness condition: The first and second derivatives of the curve at each node must be continuous;
[0191] Boundary conditions: Natural boundary conditions (i.e., the second-order derivative is zero at the boundary nodes) or clamped boundary conditions (the first-order derivative values at the boundary nodes are given) are usually used.
[0192] Assume that Key contour points , using the above solution conditions, we can get a set of equations to solve ;
[0193] Interpolation conditions:
[0194] ;
[0195] Smooth conditions:
[0196] ;
[0197] Boundary conditions:
[0198] ;
[0199] in:
[0200] : is the first-order derivative of the i-th segment spline function;
[0201] : is the second-order derivative of the i-th segment spline function;
[0202] : is the i-th segment spline function at the key contour point The first derivative at ;
[0203] : is the i-th segment spline function at the key contour point The second derivative at ;
[0204] :For the first segment of the spline function at the key contour point The second derivative at ;
[0205] : The n-1th segment of the spline function at the key contour point The second derivative at ;
[0206] : The horizontal coordinate of the i-th key contour point of the guide rail, directly extracted from the fourth feature point set;
[0207] : The ordinate of the i-th key contour point of the guide rail, directly extracted from the fourth feature point set;
[0208] By solving the above equations, we obtain;
[0209] Determines the starting point height of the curve. The slope of the influence curve, that is, the inclination of the guide rail; The curvature of the influence curve, that is, the degree of bending of the guide rail; The rate of change of the influence curve, that is, the curvature change of the guide rail. If the change is small within a certain interval, the curve will remain smooth; If the change in a certain interval is large, the slope and curvature of the curve will change significantly. The value of changes slightly, and the height of the curve does not change significantly; if The value of changes greatly, the height of the curve changes significantly, and may cause drastic changes in the slope and curvature of the curve.
[0210] For example, suppose there are three key contour points , then the equation of cubic spline interpolation can be written as:
[0211] When i=1, in the interval :
[0212] ;
[0213] When i=2, in the interval :
[0214] ;
[0215] According to the above solution conditions, we can solve The value of , and finally the complete two-dimensional contour curve equation is obtained.
[0216] This spline interpolation method can generate a smooth curve that accurately fits the two-dimensional profile of the guide rail. Compared with simple polynomial fitting, spline interpolation can avoid the oscillation phenomenon caused by high-order polynomials, ensure the smoothness and continuity of the curve, and help improve the accuracy of guide rail health status detection.
[0217] Step S4400, calculate the length of the two-dimensional contour curve of the guide rail to obtain the guide rail guidance stroke measurement result.
[0218] Furthermore, if Figure 5 As shown, step S4400 includes:
[0219] Step S4410: discretize the two-dimensional contour curve of the guide rail to obtain an ordered sequence of discrete points. ,in Represents the total number of discrete points in the two-dimensional contour curve, represents the coordinates of the first discrete point, Indicates The coordinates of discrete points;
[0220] Specifically, the curve fitting results in the analytical function expression of the two-dimensional contour curve of the guide rail. In order to facilitate the length calculation, the curve needs to be discretized. The purpose of discretization is to approximate the continuous curve with a finite number of discrete points, which is the basis of numerical calculation. The selection of discrete points should take into account both approximation accuracy and computational efficiency. Too few points will affect the accuracy of length estimation, while too many points will increase the computational burden. Generally, a uniformly distributed discrete point sequence is obtained by sampling the curve parameters equidistantly. The selection of sampling intervals needs to balance the approximation error and the number of points. For curve segments with large curvature changes, the sampling density should be appropriately increased. By sampling the independent variables of the analytical expression equidistantly, a point sequence parameterized by arc length can be obtained, that is, the distances between adjacent points are equal in the parameter domain. This parameterization method is convenient for integral calculation. The discretized contour curve is represented in the form of a point sequence, and each point corresponds to a position on the curve. The first and last points in the point sequence are the end points of the guide rail, and the discrete points on the track are arranged in sequence inside. Adjacent points can be approximated by straight line segments to form a segment-by-segment linear polyline. The distance between adjacent points in a point array reflects the local approximation accuracy. The smaller the distance, the more accurate the approximation. Discretization is a commonly used technique in computer graphics that can transform geometric shapes into a form suitable for numerical operations. By discretizing the two-dimensional contour curve of the guide rail, the continuous analytical expression can be transformed into a discrete point array data structure to prepare for subsequent length calculations. A reasonable discretization strategy can strike a balance between calculation accuracy and efficiency, providing a guarantee for the reliability of the measurement results.
[0221] Step S4420, calculating the distances between adjacent discrete points in the discrete point sequence, accumulating all distances, and obtaining the total length of the two-dimensional contour curve;
[0222] The calculation formula of the total length of the two-dimensional contour curve includes:
[0223]
[0224]
[0225] in:
[0226] : The total length of the 2D contour curve;
[0227] : jth and jth The distance between discrete points;
[0228] : The coordinates of the jth discrete point, 1≤j≤ ;
[0229] : The total number of discrete points in the two-dimensional contour curve;
[0230] : Nonlinear adjustment factor, ranging from 0 to 1;
[0231] : A nonlinear oscillation term is introduced, which increases the complexity;
[0232] : The horizontal coordinate of the jth discrete point;
[0233] : The ordinate of the jth discrete point;
[0234] : The horizontal coordinate of the j+1th discrete point; : The ordinate of the j+1th discrete point;
[0235] :Indicates taking and These two ;
[0236] The oscillating nature of the sine function causes the distance calculation to have different weights between different points, thus reflecting the slight changes in the curve. The input parameters of the sine function affect the frequency and phase of the oscillation. Adjusting the input can make the oscillation term have different performance in different intervals; sine function is a standard periodic function whose value varies between -1 and 1.
[0237] when When , at this time the oscillation term reaches its maximum value and the influence is most significant; when Relative to When the value is very small, the value of the sine function is close to , at this time, the oscillation term has the smallest effect. The slight changes of the curve are expressed through the oscillation of the sine function. Especially when the curve changes little, the oscillation term can amplify these changes, making the distance calculation more sensitive; the complex shape of the curve often contains many small ups and downs and turns, which can be captured by introducing the sine oscillation term. The periodicity of the sine function enables it to show different weighting effects in different intervals, thus reflecting the actual complexity of the curve.
[0238] Determine experimentally or empirically the effects of controlling nonlinear terms, The introduction of makes the calculated distance not only rely on the Euclidean distance, but also has a dynamically changing oscillation term, making the distance calculation more complex and accurate. The amplitude of the nonlinear oscillation term is determined by the factor Decision. Larger This will cause the oscillation amplitude to be more obvious and increase the complexity of distance calculation; smaller This will reduce the impact of oscillation and make the calculation closer to the traditional Euclidean distance. =0, the formula degenerates into the ordinary Euclidean distance calculation formula; when When >0, nonlinear terms are introduced into the formula and the distance calculation will be affected by the oscillation term.
[0239] By introducing nonlinear terms, this formula can more accurately reflect the complexity and slight changes of the curve; the formula is applicable to curves of different shapes and can better adapt to complex situations in practical applications; the introduction of nonlinear terms enables the formula to consider not only the straight-line distance between points, but also the changes in the curve shape, which helps to more comprehensively reflect the characteristics of the guide rail curve.
[0240] Step S4400 discretizes the analytical expression of the two-dimensional contour curve of the guide rail to generate an ordered sequence of discrete points, effectively converting the continuous curve into a discrete point set. This method can accurately capture the subtle changes of the curve and ensure the high precision of the measurement results. The discretization process makes the complex curve calculation simple and efficient, reducing the complexity of the calculation. By discretizing the two-dimensional contour curve of the guide rail and calculating the distance between adjacent discrete points point by point, the changes in the curve details can be effectively captured, thereby improving the accuracy of the overall calculation. Secondly, this method has strong adaptability. Whether the guide rail is smooth or has more inflection points and curvature changes, its length can be accurately measured through discretization. In addition, compared with the complex analytical integration method, the method of accumulating distance point by point has a relatively simple calculation process and is easy to implement. Especially in practical engineering applications, the calculation speed and implementation difficulty are important considerations. This method has obvious advantages in this regard. Furthermore, the discretization processing and point-by-point accumulation methods have good robustness to noise and incomplete data. Even if there are certain errors or omissions in the data acquisition process, more accurate measurement results can still be obtained through appropriate preprocessing and subsequent accumulation calculations. At the same time, this method is suitable for application in automated measurement systems. By programming to calculate and accumulate the distance between discrete points, the measurement process can be fully automated, human intervention can be reduced, and measurement efficiency and consistency can be improved. In addition, in the process of discretization and point-by-point accumulation, the discrete point sequence and its spacing changes can be intuitively displayed, which is convenient for visual analysis of the measurement process and results, and is of great significance for quality control and result verification. Finally, this method can support real-time measurement applications. By quickly calculating the distance between discrete points and accumulating them, the travel measurement results of the guide rail can be obtained in a short time, meeting the needs of real-time monitoring and control. In summary, step S4420 not only improves the measurement accuracy and adaptability, but also simplifies the calculation process by calculating and accumulating the discrete point distances of the two-dimensional contour curve of the guide rail point by point, and provides a reliable and efficient solution for the guide rail guided travel measurement based on machine vision technology.
[0241] In the process of step S4000, through multi-level data processing, including the acquisition of three-dimensional point cloud data, noise reduction, key point extraction, contour fitting and length calculation, a complete and systematic measurement and analysis chain is formed, which can comprehensively and meticulously reflect the state and stroke of the guide rail. The method can adapt to guide rails of different types and shapes. High-precision measurement can be achieved by simply adjusting the key contour point extraction and fitting parameters for different guide rails. This highly adaptable measurement method can be widely used in various practical projects. By integrating multi-spectral imaging, three-dimensional reconstruction, noise reduction processing and precise measurement technologies, the measurement efficiency and accuracy are significantly improved. The systematic process makes the measurement process more automated and intelligent, reduces manual intervention and errors, and improves the overall measurement quality. The three-dimensional reconstruction and accurate stroke measurement results provide reliable data support for subsequent guide rail health status monitoring, defect detection and maintenance decisions. These data can help engineers better understand the use of the guide rails, timely discover and deal with potential problems, and ensure the safety and reliability of elevator operation. In general, step S4000 comprehensively improves the accuracy and efficiency of guide rail guidance stroke measurement through a series of refined data processing and analysis, providing strong technical support for the health monitoring and maintenance of elevator guide rails.
[0242] Example 2
[0243] This embodiment provides a guide rail travel measurement device based on machine vision technology on the basis of embodiment 1, such as Figure 6 As shown, including:
[0244] Image acquisition module: used to acquire a multispectral surface image of the elevator guide rail, and obtain a first guide rail image, a second guide rail image and a third guide rail image according to the multispectral surface image;
[0245] An illumination compensation module: used to perform adaptive illumination compensation on the first guide rail image, the second guide rail image and the third guide rail image to obtain a fourth guide rail image, a fifth guide rail image and a sixth guide rail image;
[0246] Image enhancement module: used to extract texture features, edge features and corner point features of the fourth guide rail image, the fifth guide rail image and the sixth guide rail image, obtain an image feature set, collect cross-sectional shape data and surface depth data of the elevator guide rail, build an elevator guide rail image enhancement model, and generate an enhanced seventh guide rail image through the image feature set, cross-sectional shape data, surface depth data and the elevator guide rail image enhancement model;
[0247] Guide rail length calculation module: used to obtain the fourth feature point set based on the seventh guide rail image, cross-sectional shape data and surface depth data, fit the guide rail two-dimensional contour curve based on the fourth feature point set, and calculate the length of the guide rail two-dimensional contour curve.
[0248] The image acquisition module comprises:
[0249] Surface image acquisition unit: used to obtain a multi-spectral surface image of the elevator guide rail, wherein the multi-spectral surface image includes visible light images, near infrared images and mid-infrared images of different bands;
[0250] Surface image preprocessing unit: used for preprocessing the acquired multispectral surface image to obtain a first guide rail image, a second guide rail image and a third guide rail image;
[0251] The illumination compensation module comprises:
[0252] A parameter acquisition unit: used to obtain brightness distribution parameters of the first guide rail image, the second guide rail image and the third guide rail image; the brightness distribution parameters of the first guide rail image include the actual grayscale mean m1 and the actual grayscale standard deviation σ1 of the first guide rail image, the brightness distribution parameters of the second guide rail image include the actual grayscale mean m2 and the actual grayscale standard deviation σ2 of the second guide rail image, and the brightness distribution parameters of the third guide rail image include the actual grayscale mean m3 and the actual grayscale standard deviation σ3 of the third guide rail image;
[0253] Parameter determination unit: used to determine the illumination compensation coefficient and camera exposure parameters according to the brightness distribution parameters;
[0254] An illumination compensation calculation unit is used to perform adaptive illumination compensation on the first guide rail image, the second guide rail image and the third guide rail image by using the determined illumination compensation coefficient and the camera exposure parameter to obtain the fourth guide rail image, the fifth guide rail image and the sixth guide rail image; the adaptive illumination compensation calculation formula includes a logarithmic transformation part and a spatial adaptive modulation part;
[0255] The parameter determination unit comprises:
[0256] Light compensation coefficient calculation unit: used to set the target grayscale mean M and the target grayscale standard deviation as E, and calculate the light compensation coefficient C in combination with the actual grayscale mean and the actual grayscale standard deviation of the image;
[0257] Visible light parameter calculation unit: used to obtain the visible light compensation coefficient C1 according to the actual grayscale mean m1 and the actual grayscale standard deviation σ1 of the first guide rail image; if C1>1, increase the exposure time of the visible light camera; if C1<1, reduce the exposure time of the visible light camera;
[0258] Short-wave infrared parameter calculation unit: used to obtain the short-wave infrared compensation coefficient C2 according to the actual grayscale mean m2 and the actual grayscale standard deviation σ2 of the second guide rail image; if C2>1, the short-wave infrared camera exposure gain is increased; if C2<1, the short-wave infrared camera exposure gain is reduced;
[0259] Long-wave infrared parameter calculation unit: used to obtain the long-wave infrared compensation coefficient C3 according to the actual grayscale mean m3 and the actual grayscale standard deviation σ3 of the third rail image; if C3>1, the detection lower limit of the thermal imager is reduced and the sensitivity is improved; if C3<1, the detection lower limit of the thermal imager is increased and the sensitivity is reduced;
[0260] The image enhancement module comprises:
[0261] Image feature extraction unit: used to extract multi-scale, multi-directional texture features, edge features and corner point features of the fourth guide rail image, the fifth guide rail image and the sixth guide rail image to obtain an image feature set;
[0262] Guide rail image enhancement unit: used to collect cross-sectional shape data and surface depth data of elevator guide rails, build an elevator guide rail image enhancement model, and generate an enhanced seventh guide rail image through an image feature set, cross-sectional shape data, surface depth data and the elevator guide rail image enhancement model;
[0263] Image binarization unit: used to perform binarization processing on the seventh guide rail image to obtain a binarized guide rail image, using an 8-neighborhood tracking method, starting from the upper left corner of the binarized guide rail image, scanning the guide rail edge pixels clockwise, recording the coordinates of the edge points, and obtaining a first feature point set;
[0264] Feature point extraction unit: used to obtain ultrasonic contour feature points according to the cross-sectional shape data of the guide rail; obtain laser distance feature points according to the surface depth data of the guide rail; perform coordinate transformation on the ultrasonic contour feature points and the laser distance feature points, unify them into a local coordinate system with the center of the guide rail as the origin, and obtain a second feature point set;
[0265] Feature point fusion unit: used to fuse the first feature point set and the second feature point set to obtain a third feature point set;
[0266] The guide rail length calculation module comprises:
[0267] Point cloud data generation unit: used to construct a three-dimensional space coordinate system, perform coordinate transformation on the third feature point set, and obtain three-dimensional point cloud data of the guide rail;
[0268] Noise reduction unit: used to perform noise reduction processing on the three-dimensional point cloud data of the guide rail to obtain a fourth feature point set;
[0269] A contour curve fitting unit: used for fitting a two-dimensional contour curve of the guide rail based on the fourth feature point set;
[0270] Length calculation unit: used to calculate the length of the two-dimensional contour curve of the guide rail and obtain the guide rail guidance stroke measurement result.
[0271] Example 3
[0272] This embodiment discloses an electronic device 500, such as Figure 7 As shown, the electronic device 500 may include one or more processors and one or more memories. The memories may store computer readable codes, and when the computer readable codes are run by the one or more processors, the guide rail guidance stroke measurement method based on machine vision technology as described above may be executed.
[0273] The method or system according to the embodiment of the present application can also be used by Figure 7 The electronic device architecture shown in FIG. Figure 7 As shown, the electronic device 500 may include a bus 501, one or more CPUs 502, a read-only memory (ROM) 503, a random access memory (RAM) 504, a communication port 505 connected to a network, an input / output component 506, a hard disk 507, etc. The storage device in the electronic device 500, such as the ROM 503 or the hard disk 507, may store the guide rail guidance stroke measurement method based on machine vision technology provided in the present application. The guide rail guide stroke measurement method based on machine vision technology may, for example, include: acquiring a multispectral surface image of the elevator guide rail, and obtaining a first guide rail image, a second guide rail image, and a third guide rail image according to the multispectral surface image; performing adaptive illumination compensation on the first guide rail image, the second guide rail image, and the third guide rail image to obtain a fourth guide rail image, a fifth guide rail image, and a sixth guide rail image; extracting texture features, edge features, and corner point features of the fourth guide rail image, the fifth guide rail image, and the sixth guide rail image to obtain an image feature set, collecting cross-sectional shape data and surface depth data of the elevator guide rail, and constructing an elevator guide rail image enhancement model, and generating an enhanced seventh guide rail image through the image feature set, the cross-sectional shape data, the surface depth data, and the elevator guide rail image enhancement model; obtaining a fourth feature point set based on the seventh guide rail image, the cross-sectional shape data, and the surface depth data, fitting a two-dimensional contour curve of the guide rail based on the fourth feature point set, and calculating the length of the two-dimensional contour curve of the guide rail.
[0274] Furthermore, the electronic device 500 may also include a user interface 508. Figure 7 The architecture shown is only exemplary and can be omitted according to actual needs when implementing different devices. Figure 7 One or more components of an electronic device are shown.
[0275] Example 4
[0276] This embodiment discloses a computer-readable storage medium 600, such as Figure 8As shown, computer-readable instructions are stored on the computer-readable storage medium 600. When the computer-readable instructions are executed by the processor, the guide rail guidance stroke measurement method based on machine vision technology according to the embodiment of the present application described with reference to the above figures can be executed. The storage medium 600 includes, but is not limited to, for example, volatile memory and / or non-volatile memory. Volatile memory may include, for example, random access memory (RAM) and cache memory (cache). Non-volatile memory may include, for example, read-only memory (ROM), hard disk, flash memory, etc.
[0277] In addition, according to an embodiment of the present application, the process described above with reference to the flowchart may be implemented as a computer software program. For example, the present application provides a non-temporary machine-readable storage medium, which stores machine-readable instructions, and the machine-readable instructions can be executed by a processor to execute instructions corresponding to the method steps provided in the present application, for example: obtaining a multispectral surface image of an elevator guide rail, and obtaining a first guide rail image, a second guide rail image, and a third guide rail image according to the multispectral surface image; performing adaptive illumination compensation on the first guide rail image, the second guide rail image, and the third guide rail image to obtain a fourth guide rail image, a fifth guide rail image, and a sixth guide rail image; extracting texture features, edge features, and corner features of the fourth guide rail image, the fifth guide rail image, and the sixth guide rail image to obtain an image feature set, collecting cross-sectional shape data and surface depth data of the elevator guide rail, constructing an elevator guide rail image enhancement model, and generating an enhanced seventh guide rail image through the image feature set, cross-sectional shape data, surface depth data, and the elevator guide rail image enhancement model; obtaining a fourth feature point set based on the seventh guide rail image, the cross-sectional shape data, and the surface depth data, fitting a two-dimensional contour curve of the guide rail based on the fourth feature point set, and calculating the length of the two-dimensional contour curve of the guide rail. When the computer program is executed by a central processing unit (CPU), the above functions defined in the method of the present application are performed.
[0278] The methods, apparatuses, and devices of the present application may be implemented in many ways. For example, the methods, apparatuses, and devices of the present application may be implemented by software, hardware, firmware, or any combination of software, hardware, and firmware. The above order of steps for the method is for illustration only, and the steps of the method of the present application are not limited to the order specifically described above unless otherwise specified. In addition, in some embodiments, the present application may also be implemented as programs recorded in a recording medium, which include machine-readable instructions for implementing the method according to the present application. Therefore, the present application also covers recording media storing programs for executing the method according to the present application.
[0279] In addition, the parts of the above-mentioned technical solutions provided in the embodiments of the present application that are consistent with the implementation principles of the corresponding technical solutions in the prior art are not described in detail to avoid excessive redundancy.
[0280] The specific implementation modes as described above further describe the purpose, technical solutions and beneficial effects of the present invention in detail. It should be understood that the above description is only a specific implementation mode of the present invention and is not intended to limit the present invention. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present invention shall be included in the protection scope of the present invention.
Claims
1. A guide rail travel measurement method based on machine vision technology, characterized in that: The method comprises: Acquire a multispectral surface image of the elevator guide rail, and obtain a first guide rail image, a second guide rail image, and a third guide rail image according to the multispectral surface image; perform adaptive illumination compensation on the first guide rail image, the second guide rail image, and the third guide rail image to obtain a fourth guide rail image, a fifth guide rail image, and a sixth guide rail image; Extracting texture features, edge features, and corner point features of the fourth guide rail image, the fifth guide rail image, and the sixth guide rail image to obtain an image feature set, collecting cross-sectional shape data and surface depth data of the elevator guide rail, and constructing an elevator guide rail image enhancement model, and generating an enhanced seventh guide rail image through the image feature set, the cross-sectional shape data, the surface depth data, and the elevator guide rail image enhancement model; Obtain a fourth feature point set based on the seventh guide rail image, cross-sectional shape data, and surface depth data, fit a two-dimensional contour curve of the guide rail based on the fourth feature point set, and calculate the length of the two-dimensional contour curve of the guide rail; The obtaining of the fourth feature point set based on the seventh guide rail image, the cross-sectional shape data and the surface depth data comprises: Binarization is performed on the seventh guide rail image to obtain a binary guide rail image, and starting from the upper left corner of the binary guide rail image, the guide rail edge pixels are scanned clockwise, and the coordinates of the edge points are recorded to obtain a first feature point set; Obtain ultrasonic contour feature points according to the cross-sectional shape data of the guide rail; obtain laser distance feature points according to the surface depth data of the guide rail; perform coordinate transformation on the ultrasonic contour feature points and the laser distance feature points, unify them into a local coordinate system with the center of the guide rail as the origin, and obtain a second feature point set; The first feature point set and the second feature point set are merged to obtain a third feature point set; The third feature point set is subjected to coordinate transformation to obtain three-dimensional point cloud data of the guide rail; and the fourth feature point set is obtained according to the three-dimensional point cloud data of the guide rail.
2. The guide rail travel measurement method based on machine vision technology according to claim 1 is characterized in that: The multispectral surface image of the elevator guide rail includes visible light images, near infrared images and mid-infrared images in different wavebands; The method of performing adaptive illumination compensation on the first guide rail image, the second guide rail image and the third guide rail image to obtain the fourth guide rail image, the fifth guide rail image and the sixth guide rail image comprises: obtaining brightness distribution parameters of the first guide rail image, the second guide rail image and the third guide rail image, and determining illumination compensation coefficients and camera exposure parameters according to the brightness distribution parameters; and performing adaptive illumination compensation on the first guide rail image, the second guide rail image and the third guide rail image using the determined illumination compensation coefficients and camera exposure parameters.
3. The guide rail travel measurement method based on machine vision technology according to claim 2 is characterized in that: Determining the illumination compensation coefficient and the camera exposure parameter according to the brightness distribution parameter includes: Set the target grayscale mean value M and the target grayscale standard deviation to E, and calculate the illumination compensation coefficient C based on the actual grayscale mean value and the actual grayscale standard deviation of the image; According to the actual grayscale mean m1 and the actual grayscale standard deviation σ1 of the first guide rail image, the visible light compensation coefficient C1 is obtained; if C1>1, the exposure time of the visible light camera is increased; if C1<1, the exposure time of the visible light camera is reduced; According to the actual grayscale mean m2 and the actual grayscale standard deviation σ2 of the second guide rail image, the short-wave infrared compensation coefficient C2 is obtained; if C2>1, the exposure gain of the short-wave infrared camera is increased; if C2<1, the exposure gain of the short-wave infrared camera is reduced; According to the actual grayscale mean m3 and the actual grayscale standard deviation σ3 of the third guide rail image, the long-wave infrared compensation coefficient C3 is obtained; if C3>1, the detection limit of the thermal imager is reduced and the sensitivity is improved; if C3<1, the detection limit of the thermal imager is increased and the sensitivity is reduced.
4. The guide rail travel measurement method based on machine vision technology according to claim 1 is characterized in that: The elevator guide rail image enhancement model adopts an encoding-decoding network, which includes an encoding part and a decoding part; the encoding-decoding network uses a convolution kernel with a multi-scale receptive field in each layer; The generating of the enhanced seventh guide rail image by using the image feature set, the cross-sectional shape data, the surface depth data and the elevator guide rail image enhancement model comprises: Inputting the image feature set, the cross-sectional shape data, and the surface depth data into the elevator guide rail image enhancement model, gradually reducing the feature map size in the image feature set in the encoding part of the elevator guide rail image enhancement model, and extracting deep semantic features of the fourth guide rail image, the fifth guide rail image, and the sixth guide rail image; Perform convolution operation on the cross-sectional shape data and surface depth data to extract the geometric structure features and surface undulation features of the elevator guide rail; In the middle layer of the elevator guide rail image enhancement model, deep semantic features, geometric structure features and surface relief features are fused to generate a fused feature map; In the decoding part, the fused feature map is restored, the image details are reconstructed, and the enhanced seventh guide track image is generated.
5. The guide rail travel measurement method based on machine vision technology according to claim 1 is characterized in that: The step of fitting the two-dimensional contour curve of the guide rail based on the fourth feature point set comprises: Extracting n key contour points from the fourth feature point set, the key contour points including the end points, inflection points and curvature extreme points of the guide rail; Map n key contour points to a two-dimensional plane to construct a two-dimensional key contour point set; Fitting the two-dimensional key contour point set to generate a two-dimensional contour curve of the guide rail; the two-dimensional contour curve includes n-1 curve segments, and the spline function of the n-1 curve segments is { , key contour points and The spline function of the curve segment between is ,in .
6. The guide rail travel measurement method based on machine vision technology according to claim 1 is characterized in that: The calculation of the length of the two-dimensional contour curve of the guide rail includes: Discretize the two-dimensional contour curve of the guide rail to obtain an ordered sequence of discrete points ,in Represents the total number of discrete points in the two-dimensional contour curve, represents the coordinates of the first discrete point, Indicates The coordinates of discrete points; Calculate the distances between adjacent discrete points in the discrete point sequence, accumulate all distances, and obtain the total length of the two-dimensional contour curve; the calculation formula for the total length of the two-dimensional contour curve introduces a nonlinear oscillation term ,in represents the horizontal coordinate of the jth discrete point, represents the ordinate of the jth discrete point, represents the horizontal coordinate of the j+1th discrete point, Represents the ordinate of the j+1th discrete point, 1≤j≤ , Indicates taking and The larger of these two values.
7. A guide rail guided stroke measuring device based on machine vision technology, which is used to implement the guide rail guided stroke measuring method based on machine vision technology as described in any one of claims 1 to 6, characterized in that: The device comprises: Image acquisition module: used to acquire a multispectral surface image of the elevator guide rail, and obtain a first guide rail image, a second guide rail image and a third guide rail image according to the multispectral surface image; An illumination compensation module: used to perform adaptive illumination compensation on the first guide rail image, the second guide rail image and the third guide rail image to obtain a fourth guide rail image, a fifth guide rail image and a sixth guide rail image; Image enhancement module: used to extract texture features, edge features and corner point features of the fourth guide rail image, the fifth guide rail image and the sixth guide rail image, obtain an image feature set, collect cross-sectional shape data and surface depth data of the elevator guide rail, build an elevator guide rail image enhancement model, and generate an enhanced seventh guide rail image through the image feature set, cross-sectional shape data, surface depth data and the elevator guide rail image enhancement model; Guide rail length calculation module: used to obtain the fourth feature point set based on the seventh guide rail image, cross-sectional shape data and surface depth data, fit the guide rail two-dimensional contour curve based on the fourth feature point set, and calculate the length of the guide rail two-dimensional contour curve.
8. An electronic device comprising a memory, a central processing unit, and a computer program stored in the memory and executable on the processor, characterized in that: When the processor executes the computer program, the steps in the guide rail guidance stroke measurement method based on machine vision technology described in any one of claims 1-6 are implemented.
9. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, which, when executed, implements the steps in the guide rail guided stroke measurement method based on machine vision technology as described in any one of claims 1 to 6.
Citation Information
Patent Citations
A method for detecting the perpendicularity of elevator guide rails
CN103852034B
An elevator guide rail parameter measuring device and method
CN116659419B
Vision system for imaging and measuring rail deflection
CN103635375A
Elevator shaft inner dimension measuring device
CN105444668A