Water conservancy facility surface displacement monitoring method and system based on machine vision
Through methods based on machine vision, Gaussian filtering, Fourier transform and other technologies are used to monitor the surface displacement of water conservancy facilities in real time, solving the problems of low precision, high cost and difficult monitoring in the existing technology, and realizing high-precision and dynamic water conservancy equipment. Facility surface displacement monitoring.
Patent Information
- Application Number
- CN202411052746.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-08-02
- Publication Date
- 2024-09-03
- Estimated Expiration
- Not applicable · inactive patent
AI Technical Summary
Existing surface displacement monitoring methods of water conservancy facilities have problems such as long measurement period, large impact from meteorological and terrain conditions, low accuracy, high labor intensity, poor stability, poor synchronization and difficulty in continuous monitoring, especially interference factors based on GNSS methods. The amount of civil engineering work required by the tension line-vertical line monitoring and static leveling methods is large, and the cost of automated total station monitoring is high.
Using a method based on machine vision, the monitoring image is obtained in real time, the Gaussian formula is used to generate a filter operator for noise removal, the gradient and angle of the pixels are calculated to form a gradient image, and the non-maximum suppression method and threshold algorithm are used to detect the edge of the light spot. The Fourier transform and the inverse Fourier transform are combined for filtering processing to determine the monitoring coordinates and calculate the coordinate changes at different times to measure the displacement of the surface of the water conservancy facility.
It achieves high-precision, dynamic, non-contact real-time monitoring of surface displacement of water conservancy facilities, maintains data stability in harsh environments, reduces monitoring costs and complexity, improves measurement accuracy and synchronization, supports a 10HZ sampling rate, and achieves 2D and 3D monitoring.
Smart Images

Figure CN118587658A
Abstract
Description
Technical Field
[0001] The invention belongs to the technical field of data processing, and in particular relates to a method and system for monitoring surface displacement of water conservancy facilities based on machine vision. Background Art
[0002] At present, the surface displacement monitoring of hydraulic structures is mainly carried out by manual monitoring, which has the disadvantages of long measurement period, great influence of meteorological and topographical conditions, low accuracy, high labor intensity, complex operation, poor stability, poor synchronization and difficulty in continuous monitoring. The most widely used automatic monitoring methods for surface deformation are the total station-based automatic monitoring system, GNSS-based methods, tension line-vertical line monitoring methods, and static leveling monitoring methods. Among them, GNSS has many interference factors and long measurement period, the tension line-vertical line monitoring method and static leveling monitoring method have large civil engineering workload, and the automatic total station monitoring system has high cost.
[0003] Traditional monitoring methods can only achieve static measurements, but are unable to monitor the dynamic performance of surface displacement of reservoir water conservancy facilities. Summary of the invention
[0004] In order to solve the above technical problems, the present invention provides a method and system for monitoring the surface displacement of water conservancy facilities based on machine vision, which are used to solve the technical problems in the prior art.
[0005] On the one hand, the invention provides the following technical solution: a method for monitoring surface displacement of water conservancy facilities based on machine vision, the method comprising: Acquire a monitoring image in real time, calculate and generate a filter operator for the monitoring image using a Gaussian formula, and remove noise from the monitoring image based on the filter operator; Calculating the gradient and angle of the pixel points of the monitoring image after noise removal based on the filtering operator using a calculation formula, and forming a gradient image; Processing the gradient image by using a non-maximum suppression method to form a maximum, and forming a single pixel edge based on a pixel point corresponding to the maximum and a pixel point not corresponding to the maximum; Detecting the single pixel edge by using a threshold algorithm and forming a light spot edge of the monitoring image, and filtering the light spot edge by using Fourier transform and inverse Fourier transform to obtain a light spot edge image; The monitoring coordinates of the monitoring image are determined based on the light spot edge image, and the monitoring coordinates at different times are calculated to obtain the displacement of the surface of the water conservancy facility.
[0006] Compared with the prior art, the beneficial effects of the present application are as follows: by determining the monitoring coordinates of the monitoring image based on the light spot edge image, the specific positions of the four light spots in the monitoring image can be clearly obtained, thereby knowing the specific positions of the monitoring coordinates, and improving the accuracy of displacement monitoring of the surface of water conservancy facilities in the later stage; By calculating the monitoring coordinates at different times, the displacement of the surface of the water conservancy facility is obtained, and two images at different times are obtained. By comparing the two images, the number of pixel points that the targets of the two images have moved on the image can be obtained. According to the focal length of the lens and the position of the target from the lens, the actual distance moved by the target can be calculated, thereby measuring the surface displacement of the water conservancy facility; by measuring the displacement changes of the target in two directions, the displacement in the direction of settlement and dam break of the reservoir water conservancy facility can be obtained, and the two-dimensional monitoring of the surface of the reservoir water conservancy facility can be realized; by using a high-speed industrial camera, a sampling rate of 10HZ can be achieved, and the dynamic monitoring of the surface displacement of the reservoir water conservancy facility can be realized without affecting the output accuracy. The pixel offset change of the target in the image is identified by the target intelligent recognition algorithm, so as to obtain the displacement change of the actual structure, and the displacement detection parallel to the camera direction is realized by combining laser ranging, so as to realize the ultra-high-precision non-contact real-time measurement of the surface displacement of the reservoir water conservancy facility structure, and at the same time, a high-speed camera is used to realize the 10HZ dynamic measurement of the surface displacement.
[0007] Furthermore, the step of removing noise from the monitoring image based on the filtering operator includes: The grayscale values of the pixels to be processed and the neighboring pixels of the monitoring image are convolved with the filtering operator to realize weighted average operation, so as to remove the noise of the monitoring image.
[0008] Furthermore, the Gaussian formula includes: ; In the formula, represents the Gaussian filter function, and represents the spatial coordinates, represents the filter standard deviation, Represents the base of natural logarithms.
[0009] Furthermore, the calculation formula includes:
[0010] in, Represented as the gradient strength of the pixel point, Expressed as the gradient angle of the pixel, Expressed as Partial derivatives and, Expressed as Partial derivatives and, , They are represented as 2×2 filter operators, The data represented as the filter operator matrix, and Represents spatial coordinates.
[0011] Furthermore, the step of detecting the single pixel edge by using a threshold algorithm and forming the spot edge of the monitoring image includes: Determine whether the pixel point of the single-pixel edge is greater than a preset high threshold. If the pixel point of the single-pixel edge is greater than the preset high threshold, collect the pixel point, connect all the collected pixel points into an edge, and form the spot edge of the monitoring image.
[0012] Furthermore, the step of filtering the edge of the light spot by using Fourier transform and inverse Fourier transform includes: The amplitude spectrum of the edge of the light spot is obtained by using a conversion formula, low-frequency and high-frequency information in the edge of the light spot is obtained based on the amplitude spectrum, and it is determined whether the grayscale of the edge of the light spot corresponding to the high-frequency information exceeds a grayscale threshold; De-noising the grayscale of the edge of the light spot that exceeds the grayscale threshold, and processing the de-noised edge of the light spot using an inverse Fourier transform function; The conversion formula includes: ; ; in, Represented as the edge of the light spot, Expressed as a spectrum, Expressed as a complex function, represents Fourier transform, exp represents the exponential function with the natural constant e as the base, represents the phase function, represents an imaginary unit; The inverse Fourier transform function comprises: ; in, It is expressed as the inverse Fourier transform function, where m and n are discrete space variables. , is a frequency domain variable, with the unit being radians per sampling unit, For function is the gray value at the coordinate (x, y) on the monitoring image.
[0013] Furthermore, the step of acquiring monitoring images in real time includes: A plurality of staggered infrared targets are arranged on the surface of the water conservancy facility to be inspected, an industrial camera is installed on one side of all the infrared targets, and four infrared light sources are installed on the industrial camera, and the infrared light spots of the infrared light sources are irradiated on the infrared targets; The industrial camera is used to acquire the image of the infrared target with the infrared light spot, and remove the light except the infrared light spot to form a monitoring image.
[0014] In the second aspect, the invention provides the following technical solution: a surface displacement monitoring system for water conservancy facilities based on machine vision, the system comprising: A denoising module, used for acquiring a monitoring image in real time, calculating and generating a filter operator of the monitoring image using a Gaussian formula, and denoising the monitoring image based on the filter operator; A gradient module, used to calculate the gradient and angle of the pixel points of the monitoring image after noise removal based on the filtering operator using a calculation formula, and form a gradient image; An edge module, used for processing the gradient image by using a non-maximum suppression method to form a maximum, and forming a single-pixel edge based on a pixel point corresponding to the maximum and a pixel point not corresponding to the maximum; A processing module, used to detect the single pixel edge by using a threshold algorithm, and form the spot edge of the monitoring image, and filter the spot edge by using Fourier transform and inverse Fourier transform to obtain a spot edge image; A calculation module is used to determine the monitoring coordinates of the monitoring image based on the light spot edge image, calculate the monitoring coordinates at different times, and obtain the displacement of the surface of the water conservancy facility.
[0015] In the third aspect, the invention provides the following technical solution: a computer comprising a memory, a processor, and a computer program stored in the memory and executable on the processor; when the processor executes the computer program, the method for monitoring the surface displacement of water conservancy facilities based on machine vision as described above is implemented.
[0016] In a fourth aspect, the invention provides the following technical solution: a storage medium having a computer program stored thereon, wherein the computer program, when executed by a processor, implements the surface displacement monitoring method of water conservancy facilities based on machine vision as described above. BRIEF DESCRIPTION OF THE DRAWINGS
[0017] In order to more clearly illustrate the technical solutions in the embodiments of the present invention, 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 labor.
[0018] Figure 1 A flow chart of a method for monitoring surface displacement of water conservancy facilities based on machine vision provided in the first embodiment of the present invention; Figure 2 A schematic diagram of monitoring coordinates formed by four light spots of a monitoring image provided by the first embodiment of the present invention; Figure 3 A structural block diagram of a water conservancy facility surface displacement monitoring system based on machine vision provided in a second embodiment of the present invention; Figure 4 A schematic diagram of the hardware structure of a computer provided in the third embodiment of the present invention.
[0019] The embodiments of the present invention will be further described below with reference to the accompanying drawings. DETAILED DESCRIPTION
[0020] Embodiments of the present invention are described in detail below, examples of which are shown in the accompanying drawings, wherein the same or similar reference numerals throughout are the same or similar elements or elements having the same or similar functions. The embodiments described below with reference to the accompanying drawings are exemplary and are intended to be used to explain the embodiments of the present invention, and should not be construed as limiting the present invention.
[0021] In the description of the embodiments of the present invention, it should be understood that the terms "length", "width", "up", "down", "front", "back", "left", "right", "vertical", "horizontal", "top", "bottom", "inside" and "outside" etc., indicating orientations or positional relationships, are based on the orientations or positional relationships shown in the accompanying drawings, and are only for the convenience of describing the embodiments of the present invention and simplifying the description, and do not indicate or imply that the referred device or element must have a specific orientation, be constructed and operated in a specific orientation, and therefore should not be understood as a limitation on the present invention.
[0022] In addition, the terms "first" and "second" are used for descriptive purposes only and should not be understood as indicating or implying relative importance or implicitly indicating the number of the indicated technical features. Thus, a feature defined as "first" or "second" may explicitly or implicitly include one or more of the features. In the description of the embodiments of the present invention, the meaning of "plurality" is two or more, unless otherwise clearly and specifically defined.
[0023] Embodiment 1 In the first embodiment of the present invention, see Figure 1 A method for monitoring surface displacement of water conservancy facilities based on machine vision includes the following steps S01 to S04: S01, acquiring a monitoring image in real time, calculating and generating a filter operator of the monitoring image using a Gaussian formula, and removing noise from the monitoring image based on the filter operator; Specifically, the step of acquiring the monitoring image in real time includes: A plurality of staggered infrared targets are arranged on the surface of the water conservancy facility to be inspected, an industrial camera is installed on one side of all the infrared targets, and four infrared light sources are installed on the industrial camera, and the infrared light spots of the infrared light sources are irradiated on the infrared targets; The industrial camera is used to obtain an image of the infrared target with the infrared light spot, and remove light other than the infrared light spot to form a monitoring image; In this embodiment, a monitoring device is required to obtain monitoring images, wherein the monitoring device mainly includes a monitoring host and an infrared target. The monitoring host includes a main controller, an industrial camera, a camera lens, and an 850nm filter. The infrared target is mainly composed of 850nm infrared light.
[0024] 850nm infrared targets are installed at monitoring points on the surface of reservoir water conservancy facilities. Generally, an infrared target is installed at a distance of 20 meters to 50 meters. The 850nm infrared target is powered by 12V. After power-on, it can emit infrared light with a wavelength of 850nm. The monitoring host is installed in a stable position outside the reservoir water conservancy facilities. The monitoring host lens is aimed at the infrared target. The installation position of the monitoring host is adjusted so that the industrial camera can capture all infrared targets. The monitoring host uses an ARM processor as the main controller. The main controller controls the industrial camera to take pictures and videos. An 850nm filter is installed in front of the lens. The filter uses a bandpass filter that can only pass 850nm infrared light. On the image collected by the industrial camera, only the infrared image of the infrared target can be displayed. Each infrared image presents 4 spots. The main controller calculates the center position of the infrared spot through the image recognition algorithm, thereby obtaining the specific position of the target on the target surface of the industrial camera, that is, the specific pixel point reflected on the image. It is worth mentioning that by comparing the two images, we can get how many pixels the targets in the two images have moved on the images. According to the focal length of the lens and the position of the target from the lens, we can calculate the actual distance the target has moved, and thus measure the surface displacement of the water conservancy facilities. By measuring the displacement changes of the target in two directions, we can get the displacement in the direction of settlement and dam break of the reservoir water conservancy facilities, and realize two-dimensional monitoring of the surface of the reservoir water conservancy facilities. By using a high-speed industrial camera, a sampling rate of 10HZ can be achieved to realize dynamic monitoring of the surface displacement of the reservoir water conservancy facilities without affecting the output accuracy. By using an active infrared target and installing a bandpass filter in front of the lens, the influence of other environments can be effectively shielded, the complexity of the main controller algorithm can be reduced, and the measurement accuracy can be improved. By using an active infrared target, the infrared light has strong penetration in bad weather, which can ensure the data stability of the system in bad environments. Specifically, the step of removing noise from the monitoring image based on the filtering operator includes: The grayscale values of the pixels to be processed and the neighboring pixels of the monitoring image are convolved with the filtering operator to realize weighted average operation, so as to remove the noise of the monitoring image.
[0025] The Gaussian formula includes: ; In the formula, represents the Gaussian filter function, and represents the spatial coordinates, represents the filter standard deviation, Represents the base of natural logarithms.
[0026] In this embodiment, it is necessary to first find the spot imaging area corresponding to each target in the image to locate the coordinates of the center of the spot; the first step is to filter out the noise that may exist in the image. In this case, Gaussian filtering is used for denoising. First, a filter operator is generated according to the Gaussian formula, and then the grayscale values of the pixel points to be processed and the neighboring pixel points are convolved with the filter operator to achieve weighted average operation, so that high-frequency noise in the image can be effectively removed. The two-dimensional Gaussian formula is: ; Among them, M(x,y) represents the Gaussian filter function, x and y represent the spatial coordinates, and σ represents the filter standard deviation, which determines the width of the Gaussian function, that is, the shape of the Gaussian distribution.
[0027] The Gaussian filter operators generated by the Gaussian formula are: ; Wherein, S represents the Gaussian filter operator.
[0028] The Gaussian filter operator is a distance-weighted operator. The closer the distance, the higher the weight, and the greater the contribution to the grayscale value of the pixel, which can effectively suppress noise.
[0029] S02, using a calculation formula based on the filter operator to calculate the gradient and angle of the pixel points of the monitoring image after noise removal, and forming a gradient image; Specifically, the calculation formula includes:
[0030] in, Represented as the gradient strength of the pixel point, Expressed as the gradient angle of the pixel, Expressed as Partial derivatives and, Expressed as Partial derivatives and, , They are represented as 2×2 filter operators, The data represented as the filter operator matrix, and Represents spatial coordinates.
[0031] In this embodiment, the gradient image and the angle image are calculated, and the Canny operator is used to calculate the gradient based on the Gaussian filter. The 2×2 filter operator is: ; Among them, Gx and Gy represent the gradient values in the x and y directions respectively; The above formula can be used to approximately calculate the sum of the two partial derivatives x and y: ; ; Where G(x) and G(y) represent the gradients in the X and Y directions respectively.
[0032] Therefore, we can get the gradient G(x,y) and angle of a certain pixel in the image (x,y): ; G(x,y) represents the gradient strength of the pixel, and θ(x,y) represents the gradient direction of the pixel.
[0033] S03, using a non-maximum suppression method to process the gradient image to form a maximum, and forming a single-pixel edge based on a pixel point corresponding to the maximum and a pixel point not corresponding to the maximum; In this embodiment, the non-maximum suppression process of the gradient image, the gradient image obtained by the second step has the problems of uneven edge width, blur and misidentification, so it is necessary to suppress the non-maximum points of the gradient image to remove those non-edge pixels. By using the non-maximum suppression method to find the points of the local maximum value in the gradient image as edge points, and setting the gray value of the point corresponding to the non-maximum value to zero, a thin and accurate single-pixel edge can be formed.
[0034] It is worth noting that when each pixel is compared with two neighboring pixels with the same gradient, if the gradient value of this pixel is not the maximum value among the three pixels, this pixel is suppressed, that is, this pixel is set to zero.
[0035] S04, using a threshold algorithm to detect the single pixel edge and form a light spot edge of the monitoring image, and using Fourier transform and inverse Fourier transform to filter the light spot edge to obtain a light spot edge image; Specifically, the step of filtering the edge of the light spot by using Fourier transform and inverse Fourier transform includes: The amplitude spectrum of the edge of the light spot is obtained by using a conversion formula, low-frequency and high-frequency information in the edge of the light spot is obtained based on the amplitude spectrum, and it is determined whether the grayscale of the edge of the light spot corresponding to the high-frequency information exceeds a grayscale threshold; De-noising the grayscale of the edge of the light spot that exceeds the grayscale threshold, and processing the de-noised edge of the light spot using an inverse Fourier transform function; The conversion formula includes: ; ; in, Represented as the edge of the light spot, Expressed as a spectrum, Expressed as a complex function, represents Fourier transform, exp represents the exponential function with the natural constant e as the base, represents the phase function, represents an imaginary unit; The inverse Fourier transform function comprises: ; in, It is expressed as the inverse Fourier transform function, where m and n are discrete space variables. , is a frequency domain variable, with the unit being radians per sampling unit, For function is the gray value at the coordinate (x, y) on the monitoring image.
[0036] Specifically, the step of detecting the single pixel edge by using a threshold algorithm and forming the spot edge of the monitoring image includes: Determine whether the pixel point of the single-pixel edge is greater than a preset high threshold. If the pixel point of the single-pixel edge is greater than the preset high threshold, collect the pixel point, connect all the collected pixel points into an edge, and form the spot edge of the monitoring image.
[0037] In this embodiment, a threshold algorithm is used to detect the edge of the image, and two thresholds are selected. Pixels less than the low threshold are determined as false edges; and pixels greater than the high threshold are determined as strong edges; and those pixels formed after the high threshold judgment are connected into edges based on the pixels formed, so that a more accurate spot edge can be formed; After the above processing, the edge information image of the light spot is obtained. There are still many pseudo edges on the edge, which will cause precision errors in the subsequent calculation of precise displacement. The edge of the image is further filtered using Fourier transform and inverse Fourier transform to obtain an accurate light spot edge image; In this embodiment, assuming that f(m,n) is a function containing two discrete spatial variables m and n, the two-dimensional Fourier transform of the function is defined as follows: ; Among them, ω1, ω2 are frequency domain variables, and their units are radians / sampling unit. Usually the function F(ω1, ω2) is called the frequency domain representation of the function f(m,n). F(ω1, ω2) is a complex function, and the period of its variables ω1, ω2 is 2π. Because of the existence of this periodicity, usually when the image is displayed, the value range of these two variables is -π ≤ω1, ω2≤π. m and n are the height and width of the original image, f(m,n) is the grayscale value at the coordinate (x, y) on the original image, and m and n are discrete space variables; Suppose the input image is f(x,y), and its spectrum is F(u,v), that is ; F(u,v) is a complex function, expressed in amplitude form as: ; Through the above conversion, the amplitude spectrum of the image can be obtained, and the low-frequency and high-frequency information in the image can be obtained. The low-frequency information corresponds to the grayscale component that changes slowly in the image, and the high-frequency information corresponds to the grayscale component that changes faster and faster in the image, which is caused by the sharp transition of grayscale. In the edge area, there will be mutations in grayscale, and the threshold is set to judge and denoise the mutation of grayscale changes. The corrected amplitude spectrum can be used to obtain more accurate edge image data after inverse Fourier transformation. The corrected image can improve the fitting accuracy of the light spot circle. Inverse Fourier transform function: .
[0038] S05, determining the monitoring coordinates of the monitoring image based on the light spot edge image, calculating the monitoring coordinates at different times, and obtaining the displacement of the surface of the water conservancy facility.
[0039] It is worth noting that machine vision uses cameras to identify the displacement of targets, which can usually only identify displacements in two directions. The direction parallel to the camera cannot be obtained from the image. The current products use the principle of image monitoring and generally only monitor the dynamic changes of two axes. We use the supplementary method of laser ranging. A laser ranging module is installed on the monitoring host camera to measure the distance of the target and realize the distance change of the target on the Y axis. The X-axis and Z-axis displacements of the surface displacement of the water conservancy facility are measured by the principle of machine vision, and the Y-axis displacement of the surface of the water conservancy facility is realized by laser ranging. In specific implementation, when the controller reads the camera image, each target is imaged as 4 light spots. After obtaining the pixel coordinates of the centers of the 4 light spots, the center coordinates of the target can be obtained (such as Figure 2 ); Assume that the coordinates of point A are A(X1, Y1), the coordinates of point B are B(X2, Y2), the coordinates of point C are C(X3, Y3), and the coordinates of point D are D(X4, Y4); The coordinates of the center point are obtained by averaging the center points of AB and CD, and Sx=((X2-X1) / 2+(X3-X4) / 2) / 2; Sy=((Y4-Y1) / 2+(Y3-Y2) / 2) / 2; the pixel coordinates of the target in the image can be obtained by calculating the coordinate positions of the four light spots.
[0040] In summary, by using an active 850nm infrared light source as a target, using an industrial camera and a bandpass filter to obtain image comparison, the displacement of the target installed on the surface of the water conservancy facility is obtained, and the added laser ranging realizes the change of target displacement, thereby realizing three-dimensional monitoring of the surface displacement of water conservancy facilities, improving the system monitoring accuracy, and realizing dynamic monitoring of the surface displacement of reservoir water conservancy facilities, solving the problems of high cost, great construction difficulty, high construction cost, and susceptibility to environmental influences of traditional monitoring methods.
[0041] By comparing the two images, we can get how many pixels the targets in the two pictures have moved on the images. According to the focal length of the lens and the position of the target from the lens, we can calculate the actual distance the target has moved, thereby measuring the surface displacement of the water conservancy facilities. By measuring the displacement changes of the target in two directions, we can get the displacement in the direction of settlement and dam break of the reservoir water conservancy facilities, and realize two-dimensional monitoring of the surface of the reservoir water conservancy facilities. By using a high-speed industrial camera, a sampling rate of 10HZ can be achieved to realize dynamic monitoring of the surface displacement of the reservoir water conservancy facilities without affecting the output accuracy. By using an active infrared target and installing a bandpass filter in front of the lens, the influence of other environments can be effectively shielded, the complexity of the main controller algorithm can be reduced, and the measurement accuracy can be improved. By using an active infrared target, the infrared light has strong penetration in bad weather, which can ensure the data stability of the system in bad environments.
[0042] Embodiment 2 like Figure 3 As shown, in a second embodiment of the present invention, a surface displacement monitoring system for water conservancy facilities based on machine vision is provided, and the system comprises: A denoising module 10 is used to acquire a monitoring image in real time, calculate and generate a filter operator of the monitoring image using a Gaussian formula, and denoise the monitoring image based on the filter operator; A gradient module 20, for calculating the gradient and angle of the pixel points of the monitoring image after noise removal based on the filtering operator using a calculation formula, and forming a gradient image; An edge module 30 is used to process the gradient image by using a non-maximum suppression method to form a maximum value, and to form a single-pixel edge based on a pixel point corresponding to the maximum value and a pixel point not corresponding to the maximum value; The processing module 40 is used to detect the single pixel edge by using a threshold algorithm, and form the spot edge of the monitoring image, and filter the spot edge by using Fourier transform and inverse Fourier transform to obtain a spot edge image; The calculation module 50 is used to determine the monitoring coordinates of the monitoring image based on the light spot edge image, calculate the monitoring coordinates at different times, and obtain the displacement of the surface of the water conservancy facility.
[0043] In some optional embodiments, the noise removal module includes: The denoising unit is used to perform a convolution operation on the grayscale values of the pixel points to be processed and the neighboring pixel points of the monitoring image with the filtering operator to realize a weighted average operation, so as to remove the noise of the monitoring image.
[0044] In some optional embodiments, the noise removal module includes:
[0045] In the formula, represents the Gaussian filter function, and represents the spatial coordinates, represents the filter standard deviation, Represents the base of natural logarithms.
[0046] In some optional embodiments, the gradient module includes: in, Represented as the gradient strength of the pixel point, Expressed as the gradient angle of the pixel, Expressed as Partial derivatives and, Expressed as Partial derivatives and, , They are represented as 2×2 filter operators, The data represented as the filter operator matrix, and Represents spatial coordinates.
[0047] In some optional embodiments, the processing module includes: A forming unit is used to determine whether the pixel point of the single-pixel edge is greater than a preset high threshold. If the pixel point of the single-pixel edge is greater than the preset high threshold, the pixel point is collected, and all the collected pixel points are connected into an edge to form a spot edge of the monitoring image.
[0048] In some optional embodiments, the processing module further includes: A processing unit, which obtains an amplitude spectrum of the edge of the light spot by using a conversion formula, obtains low-frequency and high-frequency information in the edge of the light spot based on the amplitude spectrum, and determines whether the grayscale of the edge of the light spot corresponding to the high-frequency information exceeds a grayscale threshold; De-noising the grayscale of the edge of the light spot that exceeds the grayscale threshold, and processing the de-noised edge of the light spot using an inverse Fourier transform function; The conversion formula includes: ; ; in, Represented as the edge of the light spot, Expressed as a spectrum, Expressed as a complex function, represents Fourier transform, exp represents the exponential function with the natural constant e as the base, represents the phase function, represents an imaginary unit; The inverse Fourier transform function comprises:
[0049] in, It is expressed as the inverse Fourier transform function, where m and n are discrete space variables. , is a frequency domain variable, with the unit being radians per sampling unit, For function is the gray value at the coordinate (x, y) on the monitoring image.
[0050] In some optional embodiments, the noise removal module further includes A monitoring unit is used to set a plurality of staggered infrared targets on the surface of the water conservancy facility to be detected, an industrial camera is installed on one side of all the infrared targets, and four infrared light sources are installed on the industrial camera, and the infrared light spots of the infrared light sources are irradiated on the infrared targets; The industrial camera is used to acquire the image of the infrared target with the infrared light spot, and remove the light except the infrared light spot to form a monitoring image.
[0051] The surface displacement monitoring system of water conservancy facilities based on machine vision provided in the embodiment of the present invention has the same implementation principle and technical effects as those in the aforementioned method embodiment. For the sake of brief description, for matters not mentioned in the system embodiment, reference can be made to the corresponding contents in the aforementioned method embodiment.
[0052] Embodiment 3 like Figure 4 As shown, in the third embodiment of the present invention, the embodiment of the present invention provides the following technical solution, a computer, including a memory 202, a processor 201, and a computer program stored in the memory 202 and executable on the processor 201, and when the processor 201 executes the computer program, the surface displacement monitoring method of water conservancy facilities based on machine vision as described above is implemented.
[0053] Specifically, the processor 201 may include a central processing unit (CPU), or an application specific integrated circuit (ASIC), or may be configured to implement one or more integrated circuits of the embodiments of the present application.
[0054] Among them, the memory 202 may include a large-capacity memory for data or instructions. For example, but not limitation, the memory 202 may include a hard disk drive (HDD), a floppy disk drive, a solid state drive (SSD), a flash memory, an optical disk, a magneto-optical disk, a magnetic tape, or a universal serial bus (USB) drive or a combination of two or more of these. In appropriate cases, the memory 202 may include a removable or non-removable (or fixed) medium. In appropriate cases, the memory 202 may be inside or outside the data processing device. In a specific embodiment, the memory 202 is a non-volatile memory. In a specific embodiment, the memory 202 includes a read-only memory (ROM) and a random access memory (RAM). Where appropriate, the ROM may be a mask-programmed ROM, a programmable ROM (PROM), an erasable PROM (EPROM), an electrically erasable PROM (EEPROM), an electrically alterable ROM (EAROM) or a flash memory (FLASH), or a combination of two or more of these. Under appropriate circumstances, the RAM can be a static random access memory (SRAM) or a dynamic random access memory (DRAM), wherein the DRAM can be a fast page mode dynamic random access memory (FPMDRAM), an extended data output dynamic random access memory (EDODRAM), a synchronous dynamic random access memory (SDRAM), etc.
[0055] The memory 202 may be used to store or cache various data files that need to be processed and / or used for communication, as well as possible computer program instructions executed by the processor 201 .
[0056] The processor 201 implements the above-mentioned method for monitoring surface displacement of water conservancy facilities based on machine vision by reading and executing computer program instructions stored in the memory 202 .
[0057] In some embodiments, the computer may further include a communication interface 203 and a bus 200. Figure 4 As shown, the processor 201, the memory 202, and the communication interface 203 are connected via a bus 200 and communicate with each other.
[0058] The communication interface 203 is used to implement communication between the modules, devices, units and / or equipment in the embodiment of the present application. The communication interface 203 can also implement data communication with other components such as: external devices, image / data acquisition equipment, databases, external storage, and image / data processing workstations.
[0059] The bus 200 includes hardware, software or both, and couples the components of the computer to each other. The bus 200 includes but is not limited to at least one of the following: a data bus, an address bus, a control bus, an expansion bus, and a local bus. By way of example and not limitation, bus 200 may include an Accelerated Graphics Port (AGP) or other graphics bus, an Extended Industry Standard Architecture (EISA) bus, a Front Side Bus (FSB), a Hyper Transport (HT) interconnect, an Industry Standard Architecture (ISA) bus, an InfiniBand interconnect, a Low Pin Count (LPC) bus, a memory bus, a Micro Channel Architecture (MCA) bus, a Peripheral Component Interconnect (PCI) bus, a PCI-Express (PCI-X) bus, a Serial Advanced Technology Attachment (SATA) bus, a Video Electronics Standards Association Local Bus (VLB) bus, or other suitable buses or a combination of two or more of these. Where appropriate, bus 200 may include one or more buses. Although embodiments of the present application describe and illustrate a particular bus, the present application contemplates any suitable bus or interconnect.
[0060] Embodiment 4 In the fourth embodiment of the present invention, in combination with the above-mentioned surface displacement monitoring method of water conservancy facilities based on machine vision, the embodiment of the present invention provides the following technical solution, a storage medium, on which a computer program is stored, and when the computer program is executed by a processor, the above-mentioned surface displacement monitoring method of water conservancy facilities based on machine vision is implemented.
[0061] Those skilled in the art will appreciate that the logic and / or steps described in the flowchart as data or in other ways herein, for example, can be considered as a sequenced data table of executable instructions for implementing logical functions, and can be specifically implemented in any computer-readable medium for use by an instruction execution system, device or apparatus (such as a computer-based system, a system including a processor, or other system that can fetch instructions from an instruction execution system, device or apparatus and execute instructions), or in combination with these instruction execution systems, devices or apparatuses. For the purposes of this specification, "computer-readable medium" can be any device that can contain, store, communicate, propagate or transmit a program for use by an instruction execution system, device or apparatus, or in combination with these instruction execution systems, devices or apparatuses.
[0062] More specific examples of computer-readable media (a non-exhaustive list) include the following: an electrical connection with one or more wires (electronic device), a portable computer disk case (magnetic device), a random access memory (RAM), a read-only memory (ROM), an erasable and programmable read-only memory (EPROM or flash memory), an optical fiber device, and a portable compact disk read-only memory (CDROM). In addition, the computer-readable medium may even be a paper or other suitable medium on which the program is printed, since the program may be obtained electronically, for example, by optically scanning the paper or other medium, followed by editing, deciphering or, if necessary, processing in another suitable manner, and then stored in a computer memory.
[0063] It should be understood that the various parts of the present invention can be implemented by hardware, software, firmware or a combination thereof. In the above-mentioned embodiments, multiple steps or methods can be implemented by software or firmware stored in a memory and executed by a suitable instruction execution system. For example, if implemented by hardware, as in another embodiment, it can be implemented by any one of the following technologies known in the art or a combination thereof: a discrete logic circuit having a logic gate circuit for implementing a logic function for a data signal, a dedicated integrated circuit having a suitable combination of logic gate circuits, a programmable gate array (PGA), a field programmable gate array (FPGA), etc.
[0064] The technical features of the above-described embodiments may be arbitrarily combined. To make the description concise, not all possible combinations of the technical features in the above-described embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.
[0065] The above-mentioned embodiments only express several implementation methods of the present application, and the descriptions thereof are relatively specific and detailed, but they cannot be understood as limiting the scope of the invention patent. It should be pointed out that, for a person of ordinary skill in the art, several variations and improvements can be made without departing from the concept of the present application, and these all belong to the protection scope of the present application. Therefore, the protection scope of the patent of the present application shall be subject to the attached claims.
Claims
1. A method for monitoring surface displacement of water conservancy facilities based on machine vision, characterized in that: The method comprises: Acquire a monitoring image in real time, calculate and generate a filter operator for the monitoring image using a Gaussian formula, and remove noise from the monitoring image based on the filter operator; Calculating the gradient and angle of the pixel points of the monitoring image after noise removal based on the filtering operator using a calculation formula, and forming a gradient image; Processing the gradient image by using a non-maximum suppression method to form a maximum, and forming a single pixel edge based on a pixel point corresponding to the maximum and a pixel point not corresponding to the maximum; Detecting the single pixel edge by using a threshold algorithm and forming a light spot edge of the monitoring image, and filtering the light spot edge by using Fourier transform and inverse Fourier transform respectively to obtain a light spot edge image; The monitoring coordinates of the monitoring image are determined based on the light spot edge image, and the monitoring coordinates at different times are calculated to obtain the displacement of the surface of the water conservancy facility.
2. The method for monitoring surface displacement of water conservancy facilities based on machine vision according to claim 1 is characterized in that: The step of removing noise from the monitoring image based on the filtering operator comprises: The grayscale values of the pixels to be processed and the neighboring pixels of the monitoring image are convolved with the filtering operator to realize weighted average operation, so as to remove the noise of the monitoring image.
3. The method for monitoring surface displacement of water conservancy facilities based on machine vision according to claim 1 is characterized in that: The Gaussian formula includes: In the formula, represents the Gaussian filter function, and represents the spatial coordinates, represents the filter standard deviation, and e represents the base of the natural exponential function.
4. The method for monitoring surface displacement of water conservancy facilities based on machine vision according to claim 1, characterized in that: The calculation formula includes: in, Represented as the gradient strength of the pixel, Expressed as the gradient angle of the pixel, Expressed as Partial derivatives and, Expressed as Partial derivatives and, , They are represented as 2×2 filter operators, The data represented as the filter operator matrix, and Represents spatial coordinates.
5. The method for monitoring surface displacement of water conservancy facilities based on machine vision according to claim 1, characterized in that: The step of detecting the single pixel edge by using a threshold algorithm and forming the spot edge of the monitoring image comprises: Determine whether the pixel point of the single-pixel edge is greater than a preset high threshold. If the pixel point of the single-pixel edge is greater than the preset high threshold, collect the pixel point, connect all the collected pixel points into an edge, and form the spot edge of the monitoring image.
6. The method for monitoring surface displacement of water conservancy facilities based on machine vision according to claim 1 is characterized in that: The step of filtering the edge of the light spot by using Fourier transform and inverse Fourier transform comprises: The amplitude spectrum of the edge of the light spot is obtained by using a conversion formula, low-frequency and high-frequency information in the edge of the light spot is obtained based on the amplitude spectrum, and it is determined whether the grayscale of the edge of the light spot corresponding to the high-frequency information exceeds a grayscale threshold; De-noising the grayscale of the edge of the light spot that exceeds the grayscale threshold, and processing the de-noised edge of the light spot using an inverse Fourier transform function; The conversion formula includes: in, Represented as the edge of the light spot, Expressed as a spectrum, Expressed as a complex function, represents Fourier transform, exp represents the exponential function with the natural constant e as the base, represents the phase function, represents an imaginary unit; The inverse Fourier transform function comprises: in, It is expressed as the inverse Fourier transform function, where m and n are discrete space variables. , is a frequency domain variable, with the unit being radians per sampling unit, For function is the gray value at the coordinate (x, y) on the monitoring image.
7. The method for monitoring surface displacement of water conservancy facilities based on machine vision according to claim 1, characterized in that: The step of acquiring monitoring images in real time comprises: A plurality of staggered infrared targets are arranged on the surface of the water conservancy facility to be inspected, an industrial camera is installed on one side of all the infrared targets, and four infrared light sources are installed on the industrial camera, and the infrared light spots of the infrared light sources are irradiated on the infrared targets; The industrial camera is used to acquire the image of the infrared target with the infrared light spot, and remove the light except the infrared light spot to form a monitoring image.
8. A surface displacement monitoring system for water conservancy facilities based on machine vision, characterized in that: The system comprises: A denoising module, used for acquiring a monitoring image in real time, calculating and generating a filter operator of the monitoring image using a Gaussian formula, and denoising the monitoring image based on the filter operator; A gradient module, used to calculate the gradient and angle of the pixel points of the monitoring image after noise removal based on the filtering operator using a calculation formula, and form a gradient image; An edge module, used for processing the gradient image by using a non-maximum suppression method to form a maximum, and forming a single-pixel edge based on a pixel point corresponding to the maximum and a pixel point not corresponding to the maximum; A processing module, used to detect the single pixel edge by using a threshold algorithm, and form the spot edge of the monitoring image, and filter the spot edge by using Fourier transform and inverse Fourier transform to obtain a spot edge image; A calculation module is used to determine the monitoring coordinates of the monitoring image based on the light spot edge image, calculate the monitoring coordinates at different times, and obtain the displacement of the surface of the water conservancy facility.
9. A computer comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that: When the processor executes the computer program, the method for monitoring the surface displacement of water conservancy facilities based on machine vision as described in any one of claims 1 to 7 is implemented.
10. A storage medium, characterized in that: The storage medium stores a computer program, and when the computer program is executed by the processor, the method for monitoring the surface displacement of water conservancy facilities based on machine vision as described in any one of claims 1 to 7 is implemented.
Citation Information
Patent Citations
An intelligent identification and analysis method for an examination answer sheet system
CN109711284A
Space object pose measurement method based on point features and monocular camera
CN111220126A
Method and system for simultaneously measuring lens distortion and MTF indexes
CN112304573A
Target automatic recognition method and device for total station image measurement
CN113112415A
Lettuce multispectral image foreground segmentation method
CN113240697A
Cited By
Beidou-based hydraulic engineering and equipment inclination and settlement monitoring device and method thereof
CN118999479A
Beidou-based water conservancy project and equipment tilt settlement monitoring device and method
CN118999479B
Automatic measuring and reading method for calibrated scale of tension wire instrument based on machine vision and perspective transformation
CN121474964A
