Artificial intelligence-based methods, devices, and equipment for water surface stability detection
Through the artificial intelligence-based water surface stability detection method, the light point accumulation map and contour calculation are used to determine the water surface stability area, which solves the error problem caused by the shaking of the vertical imaging plane of the water surface and improves the accuracy and speed of air tightness detection.
Patent Information
- Application Number
- CN202110689415.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-06-22
- Publication Date
- 2024-08-30
- Estimated Expiration
- 2041-06-22
AI Technical Summary
In the existing technology, when the stability of the water surface is judged by observing the change in the intersection position of the water surface and the side wall of the water tank, it is easily affected by the shaking of the vertical imaging plane of the water surface, resulting in errors in the air tightness detection results.
The water surface stability detection method based on artificial intelligence is used to obtain the water surface background image and light spot map before and after the laser is injected into the water body, and image processing is performed to determine the stable area of the light spot, and to determine whether the water surface is in a stable state, using the light spot accumulation map and contour The stable area is calculated to eliminate errors caused by water surface sloshing.
The accuracy of the detection rate and air tightness detection results is improved, and the error in judgment of water surface stability is reduced.
Smart Images

Figure CN113469960B
Abstract
Description
Technical Field
[0001] The present invention relates to the field of artificial intelligence technology, and in particular to a water surface stability detection method, device and equipment based on artificial intelligence. Background Art
[0002] When processing some process components, it is necessary to ensure a certain airtightness, which puts forward certain requirements for the sealing of the processing equipment. However, the immersion method is usually used to detect the sealing of processing equipment. The principle is: immerse the processing equipment to be tested filled with gas at a specified pressure in a water tank, and observe whether there are bubbles in the water tank after the water in the water tank is stable, so as to judge the airtightness of the processing equipment based on the bubbles when the water is in a stable state.
[0003] Currently, technicians in this field usually collect side images of the airtightness test tank and judge whether the water surface is in a stable state based on the position change of the intersection of the water surface and the side wall of the tank.
[0004] In practice, the inventors found that the above-mentioned prior art has the following defects: when the water surface shakes perpendicular to the imaging plane of the side image, the intersection formed by the water surface and the side wall of the tank will not change position. Therefore, it is inaccurate to judge whether the water surface is in a stable state only based on the position change of the intersection, which will cause errors in the airtightness detection results. Summary of the invention
[0005] In order to solve the above technical problems, the purpose of the present invention is to provide a water surface stability detection method, device and equipment based on artificial intelligence. The technical solutions adopted are as follows:
[0006] In a first aspect, an embodiment of the present invention provides a water surface detection method based on artificial intelligence, the method comprising:
[0007] Acquire a water surface background image and a water surface light spot image before and after the laser is irradiated into the water body; perform image processing on the water surface background image and the water surface light spot image to obtain a real-time light spot image, wherein the real-time light spot image includes a plurality of light spots;
[0008] When the plurality of light spots are in the corresponding stable area, it is determined that the water surface is in a stable state at the current moment;
[0009] The acquisition of the stable region comprises:
[0010] When the water surface is in a steady state, acquiring a steady-state light spot image;
[0011] The center point coordinates of each light spot in the steady-state light spot image are obtained, and a plurality of the steady-state light spot images are accumulated to obtain a light spot accumulation map of each light spot; the center position of each light spot accumulation map is obtained based on the plurality of center point coordinates contained in the light spot accumulation map of each light spot, and the maximum distance from the outline to the center position is obtained according to the outline of the light spot accumulation map; a first circular area obtained with the maximum distance as a first radius and the center position as the center is used as the stable area corresponding to each light spot.
[0012] Further, after determining that the water surface at the current moment is in a stable state, the method further includes:
[0013] If the water surface corresponding to a plurality of consecutive moments is in the stable state, it is determined that the water surface has reached the stable state.
[0014] Furthermore, after obtaining the stable region, the method further includes:
[0015] Setting a second radius according to the position deviation of the light spot caused by the instability of the water surface;
[0016] The unstable area of the light spot is obtained by subtracting the stable area from the circular area obtained by the second radius and the center position.
[0017] Furthermore, after obtaining the stable region, the method further includes:
[0018] Setting an offset width according to the position offset of the light spot caused by the instability of the water surface;
[0019] A second radius is obtained according to the first radius and the offset width, and an unstable area of the light spot is obtained by subtracting the first circular area from a second circular area obtained by the second radius.
[0020] Furthermore, the optimization method for determining whether the water surface is in a stable state at the current moment includes:
[0021] When the proportion of the light spots in the stable area is greater than the proportion in the unstable area, it is determined that the water surface is in the stable state at the current moment.
[0022] In a second aspect, another embodiment of the present invention provides a water surface stability detection device based on artificial intelligence, the device comprising:
[0023] An image processing unit, used to obtain a water surface background image and a water surface light spot image before and after the laser is irradiated into the water body; image processing is performed on the water surface background image and the water surface light spot image to obtain a real-time light spot image, wherein the real-time light spot image includes a plurality of light spots;
[0024] A stability detection unit, used to determine that the water surface at the current moment is in a stable state when the plurality of light spots are in the corresponding stable area;
[0025] The acquisition of the stable area in the stable detection unit includes:
[0026] A steady-state image acquisition unit, used for acquiring a steady-state light spot image when the water surface is in a steady state;
[0027] A stable area setting unit is used to obtain the center point coordinates of each light spot in the steady-state light spot image, accumulate multiple steady-state light spot images to obtain a light spot accumulation map for each light spot; obtain the center position of each light spot accumulation map based on the multiple center point coordinates contained in the light spot accumulation map of each light spot, and obtain the maximum distance from the outline to the center position according to the outline of the light spot accumulation map; and use a first circular area with the maximum distance as a first radius and the center position as the center as the stable area corresponding to each light spot.
[0028] Furthermore, after the stability detection unit determines that the water surface is in a stable state at the current moment, the method further includes:
[0029] If the water surface corresponding to a plurality of consecutive moments is in the stable state, it is considered that the water surface has reached the stable state.
[0030] Furthermore, after obtaining the stable region in the stable region setting unit, the method further includes:
[0031] Setting a second radius according to the position deviation of the light spot caused by the instability of the water surface;
[0032] The unstable area of the light spot is obtained by subtracting the stable area from the circular area obtained by the second radius and the center position.
[0033] Furthermore, the optimization method for determining in the stability detection unit that the water surface at the current moment is in a stable state includes:
[0034] When the proportion of the light spots in the stable area is greater than the proportion in the unstable area, it is determined that the water surface is in the stable state at the current moment.
[0035] Furthermore, an electronic device includes a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the steps of any one of the above methods when executing the computer program.
[0036] The embodiments of the present invention have at least the following beneficial effects: by setting the stable area of the light spot through the steady-state light spot image in the stable state, and then confirming that the water surface is in a stable state by judging whether the light spot in the collected real-time light spot image is in the corresponding stable area, on the one hand, the detection rate can be improved, and on the other hand, since the setting of the stable area is the maximum area divided according to the accumulated active area of the light spots when the water body is stable, and the stable area is a circular area, it is possible to eliminate the problem of water surface steady-state judgment error caused by the shaking of the water body perpendicular to the imaging plane, thereby improving the airtightness detection result. BRIEF DESCRIPTION OF THE DRAWINGS
[0037] In order to more clearly illustrate the technical solutions and advantages in the embodiments of the present invention or the prior art, the drawings required for use in the embodiments or the prior art descriptions are 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.
[0038] Figure 1 A flow chart of a water surface stability detection method based on artificial intelligence provided by one embodiment of the present invention;
[0039] Figure 2 A flowchart of a method for detecting water surface stability based on artificial intelligence provided by one embodiment of the present invention;
[0040] Figure 3 A schematic diagram of a Gaussian pyramid and a hit-miss transformation process provided by an embodiment of the present invention;
[0041] Figure 4 A schematic diagram of light spot accumulation provided by an embodiment of the present invention;
[0042] Figure 5 A schematic diagram of a light spot accumulation diagram provided by an embodiment of the present invention;
[0043] Figure 6 A schematic diagram of a first circular area provided by an embodiment of the present invention;
[0044] Figure 7 A schematic diagram of a threshold map provided by an embodiment of the present invention;
[0045] Figure 8 A schematic diagram of a light spot detection area provided by an embodiment of the present invention;
[0046] Fig. 9 A structural block diagram of a water surface stability detection device based on artificial intelligence provided by another embodiment of the present invention;
[0047] Fig.10 A structural block diagram of a stable detection unit provided by an embodiment of the present invention;
[0048] Fig.11 A schematic diagram of an electronic device provided by an embodiment of the present invention. DETAILED DESCRIPTION
[0049] In order to further explain the technical means and effects adopted by the present invention to achieve the predetermined invention purpose, the following is a detailed description of the water surface stability detection method, device and equipment based on artificial intelligence proposed by the present invention, its specific implementation method, structure, characteristics and its function, in combination with the accompanying drawings and preferred embodiments. In the following description, different "one embodiment" or "another embodiment" does not necessarily refer to the same embodiment. In addition, specific features, structures, or characteristics in one or more embodiments may be combined in any suitable form.
[0050] Unless defined otherwise, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this invention belongs.
[0051] The specific scheme of the water surface stability detection method, device and equipment based on artificial intelligence provided by the present invention is described in detail below with reference to the accompanying drawings.
[0052] Refer to the attached Figure 1 and attached Figure 2 The embodiment of the present invention provides a water surface stability detection method based on artificial intelligence, which includes the following specific steps:
[0053] Step S001, obtaining a water surface background image and a water surface light spot image before and after the laser is irradiated into the water body; performing image processing on the water surface background image and the water surface light spot image to obtain a real-time light spot image, which includes a plurality of light spots.
[0054] Specifically, an embodiment of the present invention arranges an RGB camera and a laser device above a water tank, and uses the RGB camera and the laser device to collect water surface images before and after the laser device is activated, wherein the water surface image includes a water surface background image before the laser enters the water body and a water surface light spot image after the laser enters the water body.
[0055] The water surface background image and the water surface light spot image are processed to obtain a real-time light spot image. The image processing method is as follows:
[0056] 1) Downsample the water surface background image and the water surface light point image.
[0057] Specifically, the embodiment of the present invention presets two downsamplings of the water surface background image and the water surface light spot image. The first downsampling uses a 3*3 Gaussian kernel for convolution operation, that is, if the size of the input image is M×N, the size of the output image becomes M / 4×N / 4, which can reduce the subsequent calculation amount; the second downsampling is to extract the parameters of the R channel of the water surface background image after the first downsampling, and use it as the judgment standard of the image grayscale. Since the laser light spot is red light, the brightness change of the R channel can better reflect the position of the laser light spot.
[0058] 2) Perform histogram matching on the sampled water surface background image and water surface light point image.
[0059] Specifically, considering that when the laser device is emitting, the overall brightness of the water surface light spot image will increase, so that the differential image obtained by the differential operation will contain a lot of noise, the grayscale histogram of the water surface background image and the grayscale histogram of the water surface light spot image are obtained, and the grayscale histogram of the water surface light spot image is used as a reference image to increase the pixel points in the grayscale histogram of the water surface background image to achieve the purpose of making the brightness of the rest of the parts except the light spots roughly the same.
[0060] 3) Performing a difference operation on the water surface background image and the water surface light spot image after histogram matching to obtain a difference image, which is the real-time light spot image.
[0061] Furthermore, in order to prevent the real-time light spot image from being affected by other non-target light spots, the embodiment of the present invention optimizes the real-time light spot image. Figure 3 , the optimization method is as follows:
[0062] 1) Down-sampling the real-time light spot image through Gaussian pyramid to obtain multiple images of different scales; performing hit-miss transformation calculation on the obtained image and the structure element B, and accumulating the calculation results to obtain the real-time light spot image with light spot enhancement.
[0063] In the embodiment of the present invention, the preset number of downsampling is 3 times, and each downsampling adopts a 3*3 Gaussian convolution kernel, forming a total of 4 images of different scales. The structure element B is defined as a 3*3 square structure element.
[0064] 2) Upsampling the calculation results after the hit-miss transformation to the same scale, which is the size of the initial real-time light spot image. In the embodiment of the present invention, upsampling uses a difference algorithm, and the missing pixels are directly generated by using the nearest original pixel grayscale.
[0065] Preferably, considering the continuity of features in the image, the embodiment of the present invention adopts a nearest neighbor interpolation algorithm, which is a simple difference method but has a very fast calculation speed.
[0066] 3) Accumulate the four images upsampled to the same scale to obtain a cumulative composite image, and normalize the cumulative composite image to obtain a real-time light spot image with better contrast. The real-time light spot image can clearly show the enhanced laser bright spot features, and other optical path features will be weakened.
[0067] 4) The Otsu threshold segmentation algorithm is used to perform threshold processing on the real-time light spot image obtained after accumulation. The threshold processing is as follows: input the grayscale histogram of the accumulated light spot image, traverse all the grayscale values in the grayscale histogram, divide the grayscale histogram into two categories: foreground and background. The foreground is the light spot. According to the inter-class variance of each traversal, the threshold T when the inter-class variance is the largest is obtained, and the image is segmented according to the threshold T, and then the binary real-time light spot image is output.
[0068] It should be noted that the grayscale value of the background is 0, and the grayscale value of the foreground is 255, that is, the grayscale value of the light spot is 255.
[0069] 5) In order to eliminate noise, the embodiment of the present invention uses a 5*5 structural element to perform an erosion operation on the binary real-time light spot image. After the operation is completed, the real-time light spot image can clearly present multiple bright light spots on a black background.
[0070] Step S002: When a plurality of light spots are in the corresponding stable area, it is determined that the water surface is in a stable state at the current moment.
[0071] Specifically, the embodiment of the present invention sets a stable region corresponding to each light spot based on a steady-state light spot image obtained when the water surface is in a steady state. The method for obtaining the stable region is as follows:
[0072] 1) When the water surface is in a steady state, a binary steady-state light spot image is obtained through step S001. In order to obtain a valid steady-state light spot image, the embodiment of the present invention performs connected component labeling on the steady-state light spot image to obtain a valid steady-state light spot image. The specific method is: a two-scanning method is used to label the connected components of the binary steady-state light spot image. The scanning method is to assign a label to each pixel position in the first scan. When a plurality of different labels are assigned to the pixel set in the N connected region obtained by the connected domain extraction algorithm, the minimum value among the different values of these labels is selected as the valid value of the label in the N connected domain; the second scan repeats the operation of the first scan, and the value of the label corresponding to the non-valid value in the N connected domain is changed to the same valid value according to the valid value obtained in the first scan. The entire steady-state light spot image is traversed by these two operations, and the number of N connected domains in the steady-state light spot image is obtained according to the valid value of the label corresponding to the pixel point. Since one light spot corresponds to one N connected domain, the number of N connected domains can be used to represent the total number P of light spots in the steady-state light spot image.
[0073] It should be noted that, in the embodiment of the present invention, the N connected domains are 4 connected domains, and in other embodiments, 8 connected domains may also be selected.
[0074] When the total number of light spots P in the steady-state light spot image is not equal to the total number of scattered light beams of the laser device, it is determined that the result is greatly affected by noise, and the image collected this time is discarded and the next image collection is continued.
[0075] It should be noted that, since the connected component labels are all traversed from top to bottom and from left to right in the image, it can be considered that the labels of the light spots obtained by the secondary scanning algorithm for each steady-state light spot image are consistent.
[0076] 2) Obtain the center point coordinates of each light spot in the steady-state light spot image, accumulate multiple steady-state light spot images to obtain a light spot accumulation map of each light spot, obtain the center position of each light spot accumulation map based on the multiple center point coordinates, and obtain the maximum distance from the outline to the center position according to the outline of the light spot accumulation map; the first circle obtained with the maximum distance as the first radius and the center position as the center is the stable area corresponding to each light spot.
[0077] Specifically, since the distribution of light spots at this time is regarded as the light spot characteristics under the steady state of the water surface, the embodiment of the present invention acquires the stable area when the water surface is in the steady state by detecting the coordinates of the center points of the light spots.
[0078] The embodiment of the present invention uses a first-order moment calculation method to obtain the center point coordinates of each light spot in a steady-state light spot image, specifically: the horizontal coordinate of the center point of the light spot is obtained by the ratio of the sum of the horizontal coordinates of the pixel points corresponding to the light spot and the number of the pixel points corresponding to the light spot; the vertical coordinate of the center point of the light spot is obtained by the ratio of the sum of the vertical coordinates of the pixel points corresponding to the light spot and the number of the pixel points corresponding to the light spot.
[0079] For the calibration of a stable water surface, each light spot can be regarded as a feature of a steady-state water surface. Therefore, an embodiment of the present invention takes a light spot in a steady-state light spot image as an example to illustrate a method for obtaining a stable area corresponding to the light spot, specifically: superimposing multiple steady-state light spot images to obtain a light spot accumulation map corresponding to the light spot, obtaining the center position of the light spot accumulation map according to multiple center point coordinates contained in the light spot accumulation map of the light spot, and obtaining the maximum distance from the outline to the center position according to the outline of the light spot accumulation map; the first circular area obtained with the maximum distance as the first radius and the center position as the center is the stable area corresponding to the light spot.
[0080] As an example, see the attached Figure 4 , Figure 4 The figure shows the superposition position of the same light spot in four exposures. In order to distinguish the light spots corresponding to each exposure, the embodiment of the present invention uses different grayscale colors for marking, which are actually all white. Figure 5 The light spot accumulation shown Figure 5 .
[0081] Furthermore, the embodiment of the present invention uses the Mean-Shift clustering algorithm to obtain the center position of the light point accumulation graph, specifically:
[0082] The center position of the light spot accumulation map is estimated based on the different center point coordinates of the same light spot in the light spot accumulation map: first select a center point coordinate as the center position (center); find all points within the preset distance R from the center position, record as set M. Take the center position as the center point, calculate the vector from the center position to each element in the set M, add these vectors, and get the vector shift, that is, the center position moves along the direction of the vector shift, the moving distance is ||shift||, and the new coordinates of the center position value are:
[0083] center′=||shift||+center
[0084] Repeat the above steps until the moving distance ||shift|| is less than the threshold K, then the coordinates at this time are considered to be the required center position, that is, the center position of the light spot accumulation map.
[0085] Refer to the attached Figure 6, based on the contour of the light point accumulation graph, calculate the distance between the center position corresponding to the light point accumulation graph and each point on the contour: In the embodiment of the present invention, the maximum distance is the first radius r, the center position (x i ,y i ) as the center of the circle to obtain a first circular area, which is the stable area corresponding to the light spot when the water surface is in a stable state.
[0086] Considering that the position offset of the light spot may be caused when the water surface is unstable, and the background noise light spot may be caused by reflection and other conditions when the water surface is unstable, the embodiment of the present invention obtains the unstable area of the water surface based on the position offset and the noise light spot.
[0087] Preferably, the embodiment of the present invention obtains the unstable area by setting the second radius, specifically:
[0088] (1) In the embodiment of the present invention, the second radius is set based on the range of the position deviation of the light spot caused by the instability of the water surface: r B =αr A , where r B is the second radius; α is the first offset coefficient; r A is the first radius. A circle is drawn using the second radius and the center position to obtain a circular area.
[0089] It should be noted that the first offset coefficient α is an empirical value, and in the embodiment of the present invention, α=2.
[0090] (2) The area obtained by subtracting the stable area from the circular area is the unstable area corresponding to the light spot position offset.
[0091] As another example, an embodiment of the present invention can also set an offset width according to the position offset of the light spot caused by the instability of the water surface, and then obtain a second radius according to the first radius and the offset width, and obtain an unstable area of the light spot by subtracting the first circular area from the second circular area obtained by the second radius.
[0092] Furthermore, the embodiment of the present invention takes into account the background noise light spots caused by reflection and other conditions when the water surface is unstable, and optimizes the unstable area. The optimization method is:
[0093] In the embodiment of the present invention, the maximum area of light spot activity is set according to the distribution range of the noise light spot, and the area is set as a rectangular area, then the side length of the rectangular area is: c =4βr A , where l c is the side length; β is the second offset coefficient. The area obtained by subtracting the circular area from the rectangular area is the unstable area corresponding to the distribution range of the background noise light points.
[0094] As another example, an embodiment of the present invention can also set the maximum area of light spot activity according to the distribution range of the noise light spots, and the area is set as a rectangular area, then the offset width of the noise light spots is set, and the side length of the rectangular area is obtained by using the second radius and the offset width, and then the unstable area is obtained by subtracting the second circular area from the obtained rectangular area.
[0095] It should be noted that the second offset coefficient β is an empirical value, and in the embodiment of the present invention, β=3.
[0096] Further, see Attachment Figure 7 In the embodiment of the present invention, the rectangular area is a threshold map corresponding to the light spot composed of a stable area and an unstable area, and each light spot corresponds to a threshold map, namely, a stable area A, a first unstable area B, and a second unstable area C.
[0097] In order to reduce the amount of calculation and improve the detection efficiency, the embodiment of the present invention sets the light spot detection area corresponding to each water surface light spot image according to the threshold map, specifically:
[0098] According to the design of the laser device, refer to the attached Figure 8 , each steady-state light spot image can be approximately characterized as N light spot positions in a rectangular area. The first coordinate system established based on the steady-state light spot image in the embodiment of the present invention obtains the coordinates of the upper left corner 6 and the lower right corner 7 of the light spot detection area through the threshold map of the first light spot and the Nth light spot:
[0099] (X 左上 , Y 左上 )=(x1-2βr A ,y1+2βr A )
[0100] (X 右下 , Y 右下 )=(x N +2βr A ,y N -2βr A )
[0101] Among them, x1 is the horizontal coordinate of the first light spot; y1 is the vertical coordinate of the first light spot; N is the horizontal coordinate of the Nth light spot; y N is the ordinate of the Nth light spot.
[0102] Then, the light spot detection area 8 corresponding to each steady-state light spot image is obtained according to the upper left corner coordinates and the lower right corner coordinates.
[0103] It should be noted that based on the second coordinate system established with the lower left corner of the light spot detection area as the origin, the coordinates of the center point of each light spot can be expressed as the coordinates relative to the designed detection area:
[0104] (X i , Y i )=(x i -x1+2βr A ,y i -y N +2βr A )
[0105] Where (X i , Y i ) is the coordinate of the center point of the i-th light spot in the second coordinate system, (x i ,y i ) is the coordinate of the center point of the i-th light spot in the first coordinate system.
[0106] Furthermore, the embodiment of the present invention performs a convolution operation on each light spot in the real-time light spot image and the corresponding threshold image, and determines whether the water surface is in a stable state according to the convolution operation result.
[0107] In order to quantify the stability of the water surface at the time corresponding to the light spot, the embodiment of the present invention sets a weight for each area in the threshold image: the weight of the stable area is 0; and according to the different bright spots of the first unstable area and the second unstable area: the first unstable area is a light spot with a position shift, and the second unstable area is a noise light spot, and then the weight of the first unstable area is set to The weight of the second unstable region is set to ω. According to the proportion of the real-time light spot image in the stable region and the proportion of the real-time light spot image in the unstable region, it is determined whether the water surface is in a stable state at this time.
[0108] In the embodiment of the present invention, the pixel value of the background with a gray value of 0 is set to 0, the pixel value of the light point with a gray value of 255 is set to 1, and the Point function is defined as the detection function of each light point corresponding to the real-time light point image, which is defined as follows:
[0109]
[0110] Among them, Q i represents the threshold map corresponding to the i-th light spot; M represents the area of the real-time light spot image corresponding to the threshold map, n0 is the number of pixels with a pixel value of 1; n3 is the number of pixels with a pixel value of 1 in the stable area; n1 is the number of pixels with a pixel value of 1 in the first unstable area; n2 is the number of pixels with a pixel value of 1 in the second unstable area.
[0111] This formula represents the weighted proportion of the light spot pixels where the real-time light spot falls in the non-stable area. The larger the value of the Point function, the farther the light spot position is from the stable area. That is, when the proportion of the real-time light spot image in the stable area is greater than the proportion of the real-time light spot image in the non-stable area, it is considered that the water surface is in the stable state at the current moment.
[0112] To avoid the situation where all light spots cannot be identified due to process requirements in the water tank, in an embodiment of the present invention, when multiple light spots preset in the real-time light spot image are in the corresponding stable area, it is considered that the water surface is in a stable state at the current moment.
[0113] Preferably, the embodiment of the present invention obtains The condition for judging the steady state based on the Point values of the light points is: take the average value of the Point values of this part of the light points and set an average threshold δ for it. If it is less than the average threshold, it can be judged that the water surface corresponding to the current moment is in a stable state, otherwise, it is in an unstable state.
[0114] If the water surface corresponding to multiple consecutive moments is in a stable state, the water surface is considered to have reached a stable state. That is, when the image output at a certain moment is in a stable state, the marking function signal = 1 is set. If it is still in a stable state at the next moment, the function increases by 1. If it is not in a stable state at the next moment, it is set to 0. When the water surface detected at multiple consecutive moments is in a stable state, that is, signal>M, the water surface is considered to have reached a stable state.
[0115] Preferably, in the embodiment of the present invention, when signal>10, that is, M=10, it is considered that the water surface has reached a stable state.
[0116] In summary, the embodiment of the present invention provides a water surface stability detection method based on artificial intelligence, which obtains the water surface background image and the water surface light spot image before and after the laser is irradiated into the water body, and performs image processing on the water surface background image and the water surface light spot image to obtain a real-time light spot image; when the water surface is in a steady state, a light spot accumulation image of each light spot is obtained according to the accumulation of multiple steady-state light spot images, and a stable area of the light spot is obtained according to the light spot accumulation image, and then when multiple light spots in the real-time light spot image are in the corresponding stable area, it is considered that the water surface at the current moment is in a stable state. The stable area of the light spot is set by the light spot image in the stable state, and then the water surface is confirmed to be in a stable state by judging whether each light spot in the collected real-time light spot image is in the corresponding stable area. On the one hand, the detection rate can be improved, and on the other hand, the error of water surface stability judgment can be reduced, thereby improving the air tightness detection result.
[0117] Based on the same inventive concept as the above method, an embodiment of the present invention provides a water surface stability detection device based on artificial intelligence.
[0118] Refer to the attached Fig. 9 An embodiment of the present invention provides a water surface stability detection device based on artificial intelligence, which includes: an image processing unit 10 and a stability detection unit 20.
[0119] The image processing unit 10 is used to obtain a water surface background image and a water surface light spot image before and after the laser is irradiated into the water body; the water surface background image and the water surface light spot image are processed to obtain a real-time light spot image, which includes multiple light spots.
[0120] The stability detection unit 20 is used to determine that the water surface is in a stable state at the current moment when a plurality of light spots are in the corresponding stable area.
[0121] Further, see Attachment Fig.10 The stable detection unit 20 includes a steady-state image acquisition unit 21 and a stable region setting unit 22 .
[0122] The steady-state image acquisition unit 21 is used to acquire a steady-state light spot image when the water surface is in a steady state.
[0123] The stable area setting unit 22 is used to obtain the center point coordinates of each light spot in the steady-state light spot image, accumulate multiple steady-state light spot images to obtain a light spot accumulation map of each light spot; obtain the center position of each light spot accumulation map based on the multiple center point coordinates contained in the light spot accumulation map of each light spot, and obtain the maximum distance from the outline to the center position according to the outline of the light spot accumulation map; and use the maximum distance as the first radius and the center position as the center to obtain a first circular area as the stable area corresponding to each light spot.
[0124] Furthermore, after the stability detection unit 20 determines that the water surface is in a stable state at the current moment, the method further includes:
[0125] If the water surface corresponding to multiple consecutive moments is in a stable state, the water surface is considered to have reached a stable state.
[0126] Furthermore, after obtaining the stable region in the stable region setting unit 22, the method further includes:
[0127] The second radius is set according to the position deviation of the light spot caused by the instability of the water surface;
[0128] The unstable area of the light spot is obtained by subtracting the stable area from the circular area obtained by the second radius and the center position.
[0129] Furthermore, the optimization method for determining that the water surface at the current moment is in a stable state in the stability detection unit 20 includes:
[0130] When the proportion of light spots in the stable area is greater than that in the unstable area, it is determined that the water surface is in a stable state at the current moment.
[0131] For further information, please see the attached Fig.11 , which shows a schematic diagram of an electronic device provided by an embodiment of the present invention. The electronic device in this embodiment includes: a processor, a memory, and a computer program stored in the memory and executable on the processor. When the processor executes the computer program, the steps in the above-mentioned embodiment of the water surface stability detection method based on artificial intelligence are implemented, for example Figure 2 Alternatively, when the processor executes the computer program, the functions of each unit in the embodiment of the water surface stability detection device based on artificial intelligence are realized.
[0132] Exemplarily, the computer program may be divided into one or more units, wherein one or more units are stored in the memory and executed by the processor to complete the present invention. One or more units may be a series of computer program instruction segments capable of completing specific functions, and the instruction segments are used to describe the execution process of the computer program in the electronic device.
[0133] The electronic device may be a computing device such as a desktop computer, a notebook, a PDA, and a cloud server. The electronic device may include, but is not limited to, a processor and a memory. Those skilled in the art will appreciate that the schematic diagram is only an example of the electronic device and does not constitute a limitation of the electronic device. The electronic device may include more or fewer components than shown in the figure, or may combine certain components, or different components. For example, the electronic device may also include input and output devices, a bus, etc.
[0134] The processor may be a central processing unit (CPU), other general-purpose processors, digital signal processors (DSP), application-specific integrated circuits (ASIC), field programmable gate arrays (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. A general-purpose processor may be a microprocessor or any conventional processor, which is the control center of an electronic device and uses various interfaces and lines to connect various parts of the entire electronic device.
[0135] It should be noted that the sequence of the embodiments of the present invention described above is for description only and does not represent the advantages and disadvantages of the embodiments. The above describes specific embodiments of this specification. Other embodiments are within the scope of the appended claims. In some cases, the actions or steps recorded in the claims can be performed in an order different from that in the embodiments and still achieve the desired results. In addition, the processes depicted in the drawings do not necessarily require the specific order or continuous order shown to achieve the desired results. In some embodiments, multitasking and parallel processing are also possible or may be advantageous.
[0136] The various embodiments in this specification are described in a progressive manner, and the same or similar parts between the various embodiments can be referenced to each other, and each embodiment focuses on the differences from other embodiments.
[0137] The above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. Any modifications, equivalent substitutions, improvements, etc. made within the spirit and principle of the present invention should be included in the protection scope of the present invention.
Claims
1. A water surface stability detection method based on artificial intelligence, characterized in that: The method includes: Acquire a water surface background image and a water surface light spot image before and after the laser is irradiated into the water body; perform image processing on the water surface background image and the water surface light spot image to obtain a real-time light spot image, wherein the real-time light spot image includes a plurality of light spots; When a plurality of the light spots are in the corresponding stable area, determining that the water surface at the current moment is in the stable state; The acquisition of the stable region comprises: When the water surface is in a steady state, acquiring a steady-state light spot image; Acquire the center point coordinates of each light spot in the steady-state light spot image, accumulate multiple steady-state light spot images to obtain a light spot accumulation map of each light spot; obtain the center position of each light spot accumulation map based on the multiple center point coordinates contained in the light spot accumulation map of each light spot, and obtain the maximum distance from the outline to the center position according to the outline of the light spot accumulation map; and use a first circular area obtained by taking the maximum distance as a first radius and the center position as the center as the stable area corresponding to each light spot; The water surface background image and the water surface light spot image are processed to obtain a real-time light spot image, including: The water surface background image and the water surface light spot image are downsampled; the sampled water surface background image and the water surface light spot image are histogram matched; the water surface background image and the water surface light spot image after histogram matching are differentially operated to obtain a differential image, which is a real-time light spot image.
2. The method according to claim 1, characterized in that After determining that the water surface at the current moment is in a stable state, the method further includes: If the water surface corresponding to a plurality of consecutive moments is in the stable state, it is determined that the water surface reaches the stable state.
3. The method according to claim 1, characterized in that After obtaining the stable region, the method further includes: Setting a second radius according to the position deviation of the light spot caused by the instability of the water surface; The unstable area of the light spot is obtained by subtracting the stable area from the circular area obtained by the second radius and the center position.
4. The method according to claim 1, characterized in that After obtaining the stable region, the method further includes: Setting an offset width according to the position offset of the light spot caused by the instability of the water surface; A second radius is obtained according to the first radius and the offset width, and an unstable area of the light spot is obtained by subtracting the first circular area from a second circular area obtained by the second radius.
5. The method according to claim 4 or 3, characterized in that: The optimization method for determining that the water surface at the current moment is in a stable state comprises: When the proportion of the light spots in the stable area is greater than the proportion in the unstable area, it is determined that the water surface is in the stable state at the current moment.
6. A water surface stability detection device based on artificial intelligence, characterized in that: The device includes: An image processing unit, used to obtain a water surface background image and a water surface light spot image before and after the laser is irradiated into the water body; image processing is performed on the water surface background image and the water surface light spot image to obtain a real-time light spot image, wherein the real-time light spot image includes a plurality of light spots; A stability detection unit, used for determining that the water surface at the current moment is in a stable state when the plurality of light spots are in a corresponding stable area; The acquisition of the stable area in the stable detection unit includes: A steady-state image acquisition unit, used for acquiring a steady-state light spot image when the water surface is in a steady state; A stable region setting unit is used to obtain the center point coordinates of each light spot in the steady-state light spot image, accumulate multiple steady-state light spot images to obtain a light spot accumulation map of each light spot; obtain the center position of each light spot accumulation map based on the multiple center point coordinates contained in the light spot accumulation map of each light spot, and obtain the maximum distance from the outline to the center position according to the outline of the light spot accumulation map; and use a first circular area obtained by taking the maximum distance as a first radius and the center position as the center as the stable region corresponding to each light spot; The water surface background image and the water surface light spot image are processed to obtain a real-time light spot image, including: The water surface background image and the water surface light spot image are downsampled; the sampled water surface background image and the water surface light spot image are histogram matched; the water surface background image and the water surface light spot image after histogram matching are differentially operated to obtain a differential image, which is a real-time light spot image.
7. The device according to claim 6, characterized in that After the stability detection unit determines that the water surface is in a stable state at the current moment, the method further includes: If the water surface corresponding to a plurality of consecutive moments is in the stable state, it is considered that the water surface has reached the stable state.
8. The device according to claim 6, characterized in that After the stable region is obtained in the stable region setting unit, the method further includes: Setting a second radius according to the position deviation of the light spot caused by the instability of the water surface; The unstable area of the light spot is obtained by subtracting the stable area from the circular area obtained by the second radius and the center position.
9. The device according to claim 8, characterized in that The optimization method for determining that the water surface at the current moment is in a stable state in the stability detection unit includes: When the proportion of the light spots in the stable area is greater than the proportion in the unstable area, it is determined that the water surface is in the stable state at the current moment.
10. An electronic device 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 steps of the method according to any one of claims 1 to 6 are implemented.
Citation Information
Patent Citations
Artificial intelligence detection method and detection system for air tightness of sealing equipment
CN112308828A
Air tightness detection process camera aperture adjusting method and system based on artificial intelligence
CN112683459A
