Wave surface information extraction method and device, electronic equipment and storage medium
Reconstructing the wavefront point cloud through a dual-camera system solves the problem that traditional sensors cannot obtain wavefront information in the entire area, and realizes efficient and low-cost wavefront information measurement.
Patent Information
- Application Number
- CN202510639927.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-05-19
- Publication Date
- 2025-09-23
- Estimated Expiration
- 2045-05-19
AI Technical Summary
In the existing technology, wave surface information measurement relies on traditional sensors, which cannot obtain wave surface information of water waves in the entire area, resulting in low efficiency and high cost.
A dual-camera system is used. The first camera acquires the liquid surface image and identifies the coordinates of the liquid surface curve. The second camera performs point cloud recognition, reconstructs the wavefront point cloud through the coordinate transformation matrix, and generates wavefront information based on the preset detection point requirements.
It achieves high-precision, low-cost simultaneous acquisition of multi-point wavefront information, improves the measurement coverage and information dimension, and overcomes the limitations of dense deployment of traditional sensors.
Smart Images

Figure CN120689735A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of wave measurement technology, and in particular to a wavefront information extraction method and device, electronic equipment, and storage medium. Background Art
[0002] In hydrodynamic experiments, accurate acquisition of wave surface information (such as wave height, wavelength, amplitude and phase velocity) is of great significance for studying wave propagation, energy transfer and interaction with structures.
[0003] Currently, the measurement of wave surface information relies on traditional sensors (such as wave height meters). However, there may be multiple points in a water wave that need to be detected. Current sensors can only detect the value of a single point in the water wave at a time. The measurement range is limited, and it is impossible to obtain wave surface information across the entire area of the water wave, resulting in low efficiency in wave surface information acquisition. Although it is possible to set up multiple sensors for detection simultaneously, the cost is high. Therefore, how to improve the efficiency of wave surface information acquisition and reduce the cost has become a technical problem that needs to be solved urgently. Summary of the Invention
[0004] The main purpose of the embodiments of the present application is to propose a wavefront information extraction method and device, electronic equipment and storage medium, aiming to improve the efficiency of obtaining wavefront information and reduce costs.
[0005] To achieve the above objectives, a first aspect of an embodiment of the present application provides a wavefront information extraction method, which is applied to a camera module for capturing images of a pool, the camera module including a first camera and a second camera, and the method includes:
[0006] The first camera is used to capture an image of the liquid surface in the water pool to obtain a liquid surface image; wherein the liquid surface image includes an image of a liquid surface curve, and the liquid surface curve is a boundary between the liquid and the air in the water pool;
[0007] Performing liquid level recognition on the liquid level image to obtain liquid level curve coordinates, and performing height calculation on the liquid level curve coordinates to obtain reference wave height data of the liquid level curve;
[0008] Capturing the wave surface in the pool by the second camera to obtain a wave surface image, and performing point cloud recognition on the wave surface image to obtain a plurality of original wave surface point cloud coordinates;
[0009] Obtaining a conversion matrix between a camera coordinate system of the first camera and a camera coordinate system of the second camera, and performing a coordinate system conversion on each of the plurality of original wavefront point cloud coordinates according to the conversion matrix to obtain a plurality of basic wavefront point cloud coordinates;
[0010] Selecting target point cloud coordinates of a target detection point from the plurality of basic wave surface point cloud coordinates based on preset detection point requirement information, determining a reference liquid surface curve point associated with the target detection point in the liquid surface curve, and using the basic wave surface point cloud coordinates of the reference liquid surface curve point as the reference point cloud coordinates;
[0011] Data calculation is performed according to the target point cloud coordinates, the reference point cloud coordinates and the reference wave height data to obtain target wave height data corresponding to the target detection point, and wave surface information of the target detection point is generated based on the target wave height data.
[0012] In some embodiments, performing liquid level recognition on the liquid level image to obtain liquid level curve coordinates includes:
[0013] dividing the liquid surface image in a vertical direction to obtain a plurality of liquid surface sub-images;
[0014] For each of the liquid surface sub-images, pixel clustering is performed on the pixels of the liquid surface sub-image according to the pixel color values of the liquid surface sub-image to obtain average color values corresponding to multiple pixel categories;
[0015] Selecting a minimum average color value from the plurality of average color values as a target color value, and determining a liquid level category from the plurality of pixel categories according to the target color value;
[0016] The pixel coordinates of all pixels corresponding to the liquid surface category in the liquid surface sub-images are integrated to obtain the liquid surface curve coordinates.
[0017] In some embodiments, determining the liquid level category from the plurality of pixel categories according to the target color value includes:
[0018] Taking pixels of the pixel category corresponding to the target color value as candidate pixels, and calculating the dispersion between the target color value and each candidate pixel to obtain candidate dispersion data;
[0019] Performing data screening on the plurality of candidate discreteness data to obtain target discreteness data;
[0020] The pixel category of the pixel corresponding to the target discreteness data is determined as the liquid level category.
[0021] In some embodiments, after determining the pixel category of the pixel corresponding to the target discreteness data as the liquid level category, the method further includes:
[0022] Using pixels corresponding to the liquid level category as initial liquid level pixels;
[0023] Determining an air category and a liquid category from the plurality of pixel categories based on comparing the pixel coordinates of each pixel category with the pixel coordinates of the initial liquid level pixel;
[0024] extracting a target area excluding the initial liquid surface pixel from the liquid surface sub-image according to the pixel coordinates of the initial liquid surface pixel;
[0025] For the target area, a pixel at the intersection of the pixel corresponding to the air category and the pixel corresponding to the liquid category is used as an intermediate pixel, and the pixel category of the intermediate pixel is determined to be the liquid surface category.
[0026] In some embodiments, dividing the liquid surface image in a vertical direction to obtain a plurality of liquid surface sub-images includes:
[0027] Acquire an initial image by the first camera, wherein the initial image is an image of the liquid in the pool when it is still;
[0028] Obtaining an initial pixel color value of each pixel in the initial image, and obtaining a reference pixel color value of each pixel in the liquid surface image; wherein each pixel in the initial image has a corresponding pixel in the liquid surface image;
[0029] For each pair of pixels having a positional correspondence between the liquid surface image and the initial image, calculating a difference between a color value of the initial pixel and a color value of the reference pixel to obtain a color difference value;
[0030] The color difference value having a value other than 0 is determined as a positioning pixel, and the liquid surface image is segmented in the vertical direction according to the pixel coordinates of the positioning pixel to obtain a plurality of liquid surface sub-images.
[0031] In some embodiments, segmenting the liquid surface image in the vertical direction according to the pixel coordinates of the positioning pixels to obtain the plurality of liquid surface sub-images includes:
[0032] In the vertical direction, a maximum value is selected from the pixel coordinates of the plurality of positioning pixels as a first limiting coordinate, and a minimum value is selected from the pixel coordinates of the plurality of positioning pixels as a second limiting coordinate;
[0033] In the horizontal direction, a maximum value is selected from the pixel coordinates of the plurality of positioning pixels as a third limiting coordinate, and a minimum value is selected from the pixel coordinates of the plurality of positioning pixels as a fourth limiting coordinate; wherein the horizontal direction is perpendicular to the vertical direction;
[0034] cropping the liquid surface image according to the first limit coordinate, the second limit coordinate, the third limit coordinate, and the fourth limit coordinate to obtain a wave area image;
[0035] A mean value calculation is performed based on the third limit coordinate and the fourth limit coordinate to determine a pixel sub-interval, and the wave area image is segmented in the vertical direction based on the pixel sub-interval to obtain a plurality of liquid surface sub-images.
[0036] In some embodiments, performing data calculation based on the target point cloud coordinates, the reference point cloud coordinates, and the reference wave height data to obtain target wave height data corresponding to the target detection point includes:
[0037] Acquiring camera height data of the first camera;
[0038] Performing a difference calculation based on the reference wave height data and the camera height data to obtain a first distance;
[0039] Calculate a ratio between the first distance and the reference point cloud coordinates to obtain a unit point cloud scale parameter;
[0040] Obtaining a second distance by multiplying the unit point cloud scale parameter and the target point cloud coordinates;
[0041] The target wave height data is obtained by adding the second distance and the camera height data.
[0042] To achieve the above-mentioned purpose, a second aspect of an embodiment of the present application provides a wavefront information extraction device, the device comprising:
[0043] a first image acquisition module, configured to capture an image of the liquid surface of the pool using the first camera to obtain a liquid surface image; wherein the liquid surface image includes an image of a liquid surface curve, and the liquid surface curve is a boundary between the liquid and the air in the pool;
[0044] a liquid level recognition module, configured to perform liquid level recognition on the liquid level image to obtain liquid level curve coordinates, and perform height calculation on the liquid level curve coordinates to obtain reference wave height data of the liquid level curve;
[0045] a second image acquisition module, configured to capture an image of the wave surface in the pool by using the second camera to obtain a wave surface image;
[0046] a point cloud coordinate acquisition module, configured to perform point cloud recognition on the wavefront image to obtain a plurality of original wavefront point cloud coordinates;
[0047] a coordinate conversion module, configured to obtain a conversion matrix between the camera coordinate system of the first camera and the camera coordinate system of the second camera, and perform a coordinate system conversion on each of the plurality of original wavefront point cloud coordinates according to the conversion matrix to obtain a plurality of basic wavefront point cloud coordinates;
[0048] a point cloud selection module, configured to select target point cloud coordinates of a target detection point from the plurality of basic wave surface point cloud coordinates based on preset detection point requirement information, determine a reference liquid surface curve point associated with the target detection point in the liquid surface curve, and use the basic wave surface point cloud coordinates of the reference liquid surface curve point as reference point cloud coordinates;
[0049] The wavefront information generation module is used to perform data calculation based on the target point cloud coordinates, the reference point cloud coordinates and the reference wave height data to obtain the target wave height data corresponding to the target detection point, and generate the wavefront information of the target detection point based on the target wave height data.
[0050] To achieve the above-mentioned purpose, the third aspect of an embodiment of the present application proposes an electronic device, which includes a memory and a processor, wherein the memory stores a computer program, and the processor implements the method described in the first aspect when executing the computer program.
[0051] To achieve the above-mentioned purpose, the fourth aspect of the embodiments of the present application proposes a computer-readable storage medium, which stores a computer program. When the computer program is executed by a processor, it implements the method described in the first aspect.
[0052] The wavefront information extraction method and device, electronic device, and storage medium proposed in this application utilize a first camera to capture a liquid surface image, identify the liquid surface curve coordinates through image processing, and calculate the liquid surface height based on its spatial position in the image to obtain physically meaningful reference wave height data, thereby providing a calibration benchmark for wave height measurement. A second camera is then introduced to capture the wavefront within the pool from above. Point cloud recognition is used to obtain multiple raw wavefront point cloud coordinates, enabling spatial reconstruction of the wavefront's large-scale, continuous three-dimensional form, improving measurement coverage and information dimensionality. A coordinate transformation matrix is then established between the two cameras to convert the raw wavefront point cloud coordinates into base wavefront point cloud coordinates in the camera coordinate system of the first camera, thereby achieving geometric alignment of image data from different perspectives. Then, based on pre-determined detection point requirements, the target point cloud coordinates are selected from the base wavefront point cloud coordinates, and their reference liquid surface curve point within the liquid surface curve is determined. The base wavefront point cloud coordinates of this point are then used as the reference point cloud coordinates to construct a spatial measurement relationship between the target and the reference point. Finally, data calculations are performed based on the target point cloud coordinates, reference point cloud coordinates, and reference wave height data to obtain the target wave height data and generate wavefront information for the target detection point, achieving high-precision wave height estimation and visualization output for any position on the wavefront. The method of this embodiment combines image processing with point cloud reconstruction technology, not only avoiding the high cost associated with densely deployed traditional sensors, but also breaking the limitations of single-point detection. It can achieve simultaneous acquisition of multi-point wavefront information without increasing the amount of hardware. This overcomes the technical limitations of traditional wave height meters in terms of spatial distribution, cost control, and multi-point synchronous measurement, improving the efficiency of wavefront information acquisition while reducing hardware costs. BRIEF DESCRIPTION OF THE DRAWINGS
[0053] Figure 1 is a flow chart of the wavefront information extraction method provided in an embodiment of the present application;
[0054] Figure 2 This is a schematic diagram of a scenario for implementing the wavefront information extraction method provided in an embodiment of the present application;
[0055] Figure 3 yes Figure 1 Flowchart of step S102 in FIG.
[0056] Figure 4 yes Figure 3 Flowchart of step S301 in FIG.
[0057] Figure 5 yes Figure 4 Flowchart of step S404 in FIG.
[0058] Figure 6 It is a schematic diagram of liquid surface curve recognition for liquid surface sub-image;
[0059] Figure 7 yes Figure 3 Flowchart of step S303 in FIG.
[0060] Figure 8 yes Figure 3 Another flowchart of step S303 in FIG.
[0061] Figure 9 yes Figure 2 A side view of the schematic scene shown;
[0062] Figure 10 Schematic diagram of the structure of the wavefront information extraction device provided in an embodiment of the present application;
[0063] Figure 11 Schematic diagram of the hardware structure of the electronic device provided in the embodiment of the present application;
[0064] Figure 12 It is a relative wave height curve diagram of a specific target detection point. DETAILED DESCRIPTION
[0065] In order to make the purpose, technical solutions and advantages of this application more clear, the following further describes this application in detail with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain this application and are not intended to limit this application.
[0066] It should be noted that although the device schematics illustrate functional module divisions and the flowcharts illustrate logical sequences, in certain circumstances, the steps shown or described may be performed in a sequence that differs from the module divisions in the device or the sequence in the flowcharts. The terms "first," "second," and so on, in the specification, claims, and drawings, are used to distinguish similar items and are not necessarily used to describe a specific sequence or precedence.
[0067] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as commonly understood by those skilled in the art to which this application pertains. The terms used herein are for the purpose of describing the embodiments of this application only and are not intended to limit this application.
[0068] First, let’s analyze some of the terms used in this application:
[0069] Computer Vision (CV) is a technology that enables machines to simulate the human visual system. By automatically processing and understanding images or videos, it can identify objects, understand scenes, analyze motion, and make decisions. It combines technologies from multiple fields, including image processing, machine learning, and artificial intelligence. Its core goal is to enable computers to "understand" the content of images or videos, thereby promoting machine intelligence to better perceive and interact with the real world.
[0070] Point Cloud: A data format used to describe the shape of an object or scene in three-dimensional space. It consists of a large number of discrete points with three-dimensional coordinates. Each point usually represents a position in space and may include additional color, intensity, or normal information.
[0071] In hydrodynamic experiments, accurate acquisition of wave surface information (such as wave height, wavelength, amplitude and phase velocity) is of great significance for studying wave propagation, energy transfer and interaction with structures.
[0072] Currently, the measurement of wave surface information relies on traditional sensors (such as wave height meters). However, there may be multiple points in a water wave that need to be detected. Current sensors can only detect the value of a single point in the water wave at a time. The measurement range is limited, and it is impossible to obtain wave surface information across the entire area of the water wave, resulting in low efficiency in wave surface information acquisition. Although it is possible to set up multiple sensors for detection simultaneously, the cost is high. Therefore, how to improve the efficiency of wave surface information acquisition and reduce the cost has become a technical problem that needs to be solved urgently.
[0073] Based on this, the embodiments of the present application provide a wavefront information extraction method and device, an electronic device, and a storage medium, aiming to improve the efficiency of obtaining wavefront information and reduce costs.
[0074] The wavefront information extraction method and device, electronic device and storage medium provided in the embodiments of the present application are specifically illustrated through the following embodiments. First, the wavefront information extraction method in the embodiments of the present application is described.
[0075] The present application can be used in many general or special computer system environments or configurations. For example: personal computers, server computers, handheld or portable devices, tablet devices, multiprocessor systems, microprocessor-based systems, set-top boxes, programmable consumer electronics, network PCs, minicomputers, mainframe computers, distributed computing environments including any of the above systems or devices, and the like. The present application can be described in the general context of computer-executable instructions executed by a computer, such as program modules. Generally, program modules include routines, programs, objects, components, data structures, and the like that perform specific tasks or implement specific abstract data types. The present application can also be practiced in distributed computing environments in which tasks are performed by remote processing devices connected via a communication network. In a distributed computing environment, program modules can be located in local and remote computer storage media, including storage devices.
[0076] The wavefront information extraction method provided in the embodiment of the present application is applied to a camera module for capturing images of a pool, and the camera module includes a first camera and a second camera. Figure 1 This is an optional flowchart of the wavefront information extraction method provided in the embodiment of the present application. Figure 1 The method may include but is not limited to steps S101 to S106.
[0077] In step S101, a first camera is used to capture an image of the liquid surface in the pool to obtain a liquid surface image, wherein the liquid surface image includes an image of a liquid surface curve, which is a boundary between the liquid and air in the pool.
[0078] In step S102 , the liquid level image is subjected to liquid level recognition to obtain the liquid level curve coordinates, and the liquid level curve coordinates are subjected to height calculation to obtain reference wave height data of the liquid level curve.
[0079] In step S103 , the second camera is used to capture an image of the wave surface in the pool to obtain a wave surface image, and point cloud recognition is performed on the wave surface image to obtain a plurality of original wave surface point cloud coordinates.
[0080] Step S104 , obtaining a conversion matrix between the camera coordinate system of the first camera and the camera coordinate system of the second camera, and performing a coordinate system conversion on each of the multiple original wavefront point cloud coordinates according to the conversion matrix to obtain multiple basic wavefront point cloud coordinates.
[0081] Step S105, based on the preset detection point requirement information, the target point cloud coordinates of the target detection point are selected from multiple basic wave surface point cloud coordinates, and the reference liquid surface curve point associated with the target detection point is determined in the liquid surface curve, and the basic wave surface point cloud coordinates of the reference liquid surface curve point are used as the reference point cloud coordinates.
[0082] Step S106 , performing data calculation according to the target point cloud coordinates, the reference point cloud coordinates and the reference wave height data to obtain the target wave height data corresponding to the target detection point, and generating the wave surface information of the target detection point based on the target wave height data.
[0083] In steps S101 to S106, as shown in the embodiment of the present application, a first camera is used to capture a liquid surface image, identify the liquid surface curve coordinates through image processing, and calculate the height based on the spatial position of the liquid surface in the image to obtain physically meaningful reference wave height data, thereby providing the calibration benchmark required for wave height measurement. A second camera is then introduced to capture the wave surface within the pool from above. Point cloud recognition is used to obtain multiple raw wave surface point cloud coordinates, enabling spatial reconstruction of the large-scale, continuous three-dimensional shape of the wave surface, thereby improving the measurement coverage and information dimension. A coordinate transformation matrix is then established between the two cameras to convert the raw wave surface point cloud coordinates into basic wave surface point cloud coordinates in the camera coordinate system of the first camera, thereby achieving geometric alignment of image data from different perspectives. Then, based on the preset detection point requirement information, the target point cloud coordinates are selected from the basic wave surface point cloud coordinates, and its reference liquid surface curve point in the liquid surface curve is determined. The basic wave surface point cloud coordinates of this point are then used as the reference point cloud coordinates to construct a spatial measurement relationship between the target and the reference point. Finally, data calculations are performed based on the target point cloud coordinates, reference point cloud coordinates, and reference wave height data to obtain the target wave height data and generate wavefront information for the target detection point, achieving high-precision wave height estimation and visualization output for any position on the wavefront. The method of this embodiment combines image processing with point cloud reconstruction technology, not only avoiding the high cost associated with densely deployed traditional sensors, but also breaking the limitations of single-point detection. It can achieve simultaneous acquisition of multi-point wavefront information without increasing the amount of hardware. This overcomes the technical limitations of traditional wave height meters in terms of spatial distribution, cost control, and multi-point synchronous measurement, improving the efficiency of wavefront information acquisition while reducing hardware costs.
[0084] Before further introducing the specific steps of the wavefront information extraction method provided in the embodiment of the present application, it is necessary to first explain the experimental scenario to which the method is applicable. Figure 2 , Figure 2 This is a schematic diagram of a scenario for implementing the wavefront information extraction method provided in an embodiment of the present application. In this embodiment, the pool is a transparent rectangular, open cylinder. The pool is placed on a horizontal surface, filled with a certain amount of liquid, and wave motion is generated within the pool using a power device such as a wave generator. Figure 2 The colored curves shown in the figure are used to characterize the wave morphology of the liquid surface, where the blue curve represents the three-dimensional wave state of the water surface, and the red curve is the liquid surface curve observed from the shooting angle of the first camera.
[0085] To effectively capture wavefront information, this embodiment employs two viewing angles. The first camera is positioned horizontally, with its optical axis parallel to the aforementioned horizontal plane. Preferably, the optical axis of the first camera is aligned with the height of the static liquid in the pool to better capture the changing characteristics of the liquid surface profile at this viewing angle. The second camera is positioned from a top-down perspective, capturing the entire wavefront range, ensuring the complete spatial information required for subsequent wavefront reconstruction or feature analysis.
[0086] In step S101 of some embodiments, the liquid surface image is any frame of a video captured by the first camera of the liquid surface in the pool. It will be appreciated that the liquid surface curve is the boundary between the liquid and air in the pool. In the liquid surface image, this boundary is specifically manifested as a distinct grayscale or color boundary formed at the interface between the liquid and air, with this boundary forming a continuous or nearly continuous curve in the image.
[0087] In step S102 of some embodiments, the liquid level curve coordinates refer to the pixel positions corresponding to the liquid level curve in the liquid level image, and the reference wave height data refer to the real height data of the liquid level curve in three-dimensional space.
[0088] See also Figure 3 In some embodiments, step S102 may include but is not limited to steps S301 to S304:
[0089] Step S301 : dividing the liquid surface image in the vertical direction to obtain a plurality of liquid surface sub-images.
[0090] Step S302 : for each liquid surface sub-image, pixel clustering is performed on the pixels of the liquid surface sub-image according to the pixel color values of the liquid surface sub-image to obtain average color values corresponding to multiple pixel categories.
[0091] Step S303 : selecting the minimum average color value from the multiple average color values as the target color value, and determining the liquid level category from the multiple pixel categories according to the target color value.
[0092] In step S304 , pixel coordinates of pixels corresponding to the liquid surface category in all liquid surface sub-images are integrated to obtain liquid surface curve coordinates.
[0093] In step S301 of some embodiments, since the liquid surface curve extends horizontally and the illumination and background interference in the liquid surface image may vary locally, in order to enhance the stability of local feature recognition, the entire liquid surface image may be segmented into several strips in the vertical direction, each strip being a liquid surface sub-image. The liquid surface sub-images may be obtained by manual selection or by performing image processing on the liquid surface image to achieve automatic segmentation. For details, please refer to Figure 4Step S301 may include but is not limited to steps S401 to S404:
[0094] Step S401 : acquiring an initial image through a first camera. The initial image is an image of the liquid in the pool when it is still.
[0095] Step S402 : obtaining an initial pixel color value of each pixel in the initial image, and obtaining a reference pixel color value of each pixel in the liquid surface image.
[0096] Step S403 : for each pair of pixels in the liquid surface image and the initial image that have a positional correspondence, calculate the difference between the initial pixel color value and the reference pixel color value to obtain a color difference value.
[0097] In step S404 , the color difference value that is not 0 is determined as a positioning pixel, and the liquid surface image is segmented in the vertical direction according to the pixel coordinates of the positioning pixel to obtain a plurality of liquid surface sub-images.
[0098] In some embodiments, in step S401, the initial image refers to an image frame captured before waves are generated and when the liquid in the pool is completely still. Because the liquid surface is flat and undisturbed at this time, this image serves as a background reference image for subsequent liquid surface fluctuation detection, capturing the changes in the liquid area after the waves are generated. The initial image is typically captured before the wave-generating device is activated, and the image acquisition method is consistent with the liquid surface image acquisition method in step S101, ensuring spatial alignment of the images during subsequent processing.
[0099] In step S402 of some embodiments, because the liquid surface image and the initial image have the same resolution and viewing angle, each pixel in the initial image has a corresponding pixel in the liquid surface image. The initial pixel color value refers to the RGB value of a pixel in the initial image. The reference pixel color value refers to the RGB value of a pixel in the liquid surface image.
[0100] In step S403 of some embodiments, the color difference value refers to the RGB change between the reference pixel color value and the initial pixel color value for a pixel at a specific location. Because only the areas of liquid fluctuation in the captured video exhibit significant visual changes, the pixel color values in the static areas remain largely unchanged between images. Specifically, for each color channel, the difference between the color values of a pixel at a specific location in the reference image and the color values in the initial image is calculated, thereby accurately screening out image areas exhibiting wave motion.
[0101] In some embodiments, in step S404, if the color difference value corresponding to a pixel is 0, it indicates that the pixel has not undergone a significant color change between the liquid surface image and the initial image, which means that the image area represented by the pixel is not affected by the fluctuation. Such a pixel is called a positioning pixel.
[0102] Steps S401 to S404 shown in the embodiment of the present application realize adaptive division of the liquid surface image area based on the difference in color change between the initial image and the liquid surface image, thereby improving the intelligence, accuracy and processing efficiency of the liquid surface recognition pre-processing stage as a whole. The method of this embodiment uses the initial image obtained when the liquid is stationary as the background reference, and combines it with the dynamic liquid surface image for pixel-by-pixel comparison to accurately extract the effective area where the color changes due to the fluctuation. By locating these pixels with obvious changes, it can automatically determine the active interval of the wave surface disturbance, and accordingly form a division boundary that is spatially close to the wave area in the image, generating multiple liquid surface sub-images. This improves the pertinence of the area division, thereby avoiding the ineffective processing of a large number of irrelevant static areas.
[0103] See also Figure 5 In some embodiments, step S404 may also include but is not limited to steps S501 to S504:
[0104] Step S501 : In the vertical direction, a maximum value is selected from the pixel coordinates of a plurality of positioning pixels as a first limiting coordinate, and a minimum value is selected from the pixel coordinates of a plurality of positioning pixels as a second limiting coordinate.
[0105] Step S502 : In the horizontal direction, a maximum value is selected from the pixel coordinates of the plurality of positioning pixels as a third limiting coordinate, and a minimum value is selected from the pixel coordinates of the plurality of positioning pixels as a fourth limiting coordinate.
[0106] Step S503 , cropping the liquid surface image according to the first limiting coordinate, the second limiting coordinate, the third limiting coordinate, and the fourth limiting coordinate to obtain a wave area image.
[0107] Step S504 , performing mean calculation based on the third limit coordinate and the fourth limit coordinate to determine pixel subintervals, and performing vertical segmentation on the wave region image based on the pixel subintervals to obtain a plurality of liquid surface subimages.
[0108] In step S501 of some embodiments, the vertical direction is the longitudinal axis direction of the liquid surface image. Based on the image coordinates of all positioning pixels in the liquid surface image identified in the previous step, the coordinate distribution range of these positioning pixels in the vertical direction (which can be the y-coordinate) is extracted, and the maximum value thereof is selected as the first limiting coordinate, and the minimum value thereof is selected as the second limiting coordinate, respectively, to define the vertical boundary of the wave area in the image. In this embodiment, the origin of the image coordinate system is the lower left corner vertex of the liquid surface image, the positive direction of the y-axis is vertically upward, the first limiting coordinate corresponds to the highest crest of the wave, and the second limiting coordinate corresponds to the lowest trough of the wave.
[0109] In step S502 of some embodiments, the horizontal direction is perpendicular to the vertical direction, that is, the horizontal direction is the horizontal axis direction of the liquid surface image. The coordinate distribution range of these positioning pixels in the horizontal direction (which can be the x-coordinate) is extracted, and the maximum value is selected as the third limiting coordinate, and the minimum value is selected as the fourth limiting coordinate. In this embodiment, the origin of the image coordinate system is the lower left corner vertex of the liquid surface image, the positive direction of the x-axis is vertically upward, the third limiting coordinate corresponds to the leftmost end of the wave area, and the fourth limiting coordinate corresponds to the rightmost end of the wave area.
[0110] In step S503 of some embodiments, a quadrilateral subregion containing liquid surface disturbance information, i.e., a wave region image, can be extracted from the liquid surface image based on the first to fourth limiting coordinates. In some embodiments, the cropped region can be slightly larger than the quadrilateral subregion formed based on the first to fourth limiting coordinates. The image cropping process can be implemented using image processing software or image array interception operations.
[0111] In some embodiments, in step S504, a fixed number of segments can be set. The effective horizontal pixel length of the wave region image, i.e., the total span of the wave region along the horizontal axis of the image, can be calculated based on the third and fourth limiting coordinates. This pixel length is then divided by the preset number of segments to obtain the horizontal pixel interval width of each liquid surface sub-image, i.e., the pixel sub-interval. Based on this pixel sub-interval, the starting and ending pixel coordinates of each segment can be sequentially determined horizontally, while the corresponding image content is preserved intact vertically, thereby extracting multiple liquid surface sub-images.
[0112] In steps S501 to S504 shown in the embodiment of the present application, multiple positioning pixels in the image are identified based on the color difference changes caused by the liquid surface disturbance, and the extreme values of these pixels in the horizontal and vertical directions are used as dynamic limit coordinates, thereby automatically generating a bounding box of the wave area, achieving effective cropping of the original image, and extracting the image area containing only wave information. Then, based on the wave area image, it is divided into multiple liquid surface sub-images according to the set sub-interval standard, so that the subsequent liquid surface recognition task can be completed independently in smaller and more locally consistent image units. This method not only avoids the noise interference and imbalance problems caused by full-image clustering, but also has strong adaptive capabilities, and can adapt to the changing requirements of different wave propagation ranges and image distribution characteristics. It realizes efficient focusing and structured extraction of the liquid surface disturbance area as a whole, laying a high-quality data foundation for subsequent wave height calculation.
[0113] In step S302 of some embodiments, a clustering operation can be performed using the pixel color value (i.e., RGB value) of each pixel as a feature vector by using K-Means or other unsupervised clustering algorithms, and a plurality of pixel sets representing different color features are output. Pixel category refers to the category of the pixel set after the clustering algorithm. In the present embodiment, the pixel categories include: liquid surface category, air category, and water category, but are not limited thereto. The average color value corresponding to each pixel category refers to the average value of the RGB values of all pixels in the same pixel set. In the present embodiment, pixel clustering is implemented using the K-Means clustering algorithm, and the average color value is the cluster center corresponding to each type of pixel set.
[0114] In step S303 of some embodiments, because the liquid surface curve is represented by a darker boundary formed by the interface between the liquid and air in the liquid surface sub-image, while the air and liquid are lighter in color, the RGB value of the pixel set corresponding to the liquid surface boundary is smaller. Therefore, the pixel set corresponding to the minimum average color value is the pixel set that best matches the liquid surface characteristics, and the pixel class corresponding to this pixel set is determined to be the liquid surface class. The target color value is the color value with the smallest value among all the average color values.
[0115] See also Figure 6 , Figure 6 Schematic diagram of liquid surface curve recognition for liquid surface sub-images. From top to bottom, the first camera approaches the liquid surface, the first camera captures the trough, and the first camera captures the peak.
[0116] It should be noted that the above method of determining the pixel set corresponding to the liquid surface category is more suitable for scenes when the liquid surface curve tends to be calm and is at the same height as the optical axis of the first camera. Since the viewing angle of the first camera is close to the horizontal liquid surface, the liquid surface is in the shape of a strip at this time, the RGB value is also stable, the discreteness of the pixel distribution is extremely low, and there is basically no interference. However, the first camera looks down at the liquid surface part of the trough, so in the liquid surface sub-image, the three-dimensional liquid surface components generated by the lens looking down, as well as the water droplets remaining on the wall of the pool, will be captured. However, in the aforementioned steps, these interfering pixels will be clustered into the same pixel set as the pixels corresponding to the liquid surface, thereby interfering with the recognition accuracy of the liquid surface curve.
[0117] In some scenarios where the first camera looks down at the liquid surface, the following steps can be used to remove interfering pixels. Figure 7 In some embodiments, step S303 includes but is not limited to steps S701 to S703:
[0118] In step S701 , pixels of a pixel category corresponding to a target color value are taken as candidate pixels, and a dispersion between the target color value and each candidate pixel is calculated to obtain candidate dispersion data.
[0119] Step S702 , screening multiple candidate discreteness data to obtain target discreteness data.
[0120] Step S703: Determine the pixel category of the pixel corresponding to the target discreteness data as the liquid level category.
[0121] In step S701 of some embodiments, candidate pixels refer to all pixels in a pixel set whose cluster center is a target color value. The candidate discreteness data is the variance of the distance between each candidate pixel and the target color value. When the value of the candidate discreteness data is smaller, it means that the pixels of this category are concentrated in the color space and have strong color consistency, which is consistent with the imaging characteristics that the liquid surface appears as a boundary band in the image with a darker and stable color. On the contrary, if the discreteness is larger, it means that the category may contain multiple pixels with similar colors but inconsistent physical positions or imaging characteristics, and may contain non-liquid surface areas.
[0122] In step S702 of some embodiments, the candidate discreteness data set is screened to remove pixels that deviate far from the target color value to obtain a set of target discreteness data that meets the color consistency standard. The screening method may include setting a threshold filter (such as only retaining pixels with a discreteness less than a preset value), statistical distribution analysis (such as retaining the top percentile of color-similar pixels), or further refinement using an adaptive clustering method. The purpose of this step is to avoid boundary blur or color extension effects caused by the color clustering process, and to exclude interfering pixels that are similar in color but do not belong to the liquid surface area, thereby ensuring that the final liquid surface category has stronger color consistency and spatial stability.
[0123] In step S703 of some embodiments, the corresponding pixel is determined according to the target discreteness data finally screened out, and the pixel category corresponding to the pixel is confirmed as the liquid level category.
[0124] Compared with the method of judging the liquid surface category by relying solely on color depth or brightness value, steps S701 to S703 shown in the embodiment of the present application effectively eliminate interfering pixels that are similar in color but do not actually belong to the liquid surface area, such as wave surface reflections, shadows at the edge of the pool, or background color interference, by calculating and screening the discreteness. Finally, the pixel category of the screened pixels is determined to be the liquid surface category, ensuring that the extracted liquid surface area has a high degree of consistency and continuity in color features. This double-layer screening strategy not only enhances the accuracy of liquid surface category determination, but also provides a pixel basis with a clear structure and clear boundaries for the subsequent coordinate extraction of the liquid surface curve.
[0125] When the first camera captures the crest, the liquid level at the crest is higher than the first camera, that is, the first camera is looking up at the crest. At this time, as the liquid level rises, the liquid surface will gradually become thinner from a strip until it disappears, while the interference is the component below the water surface when the camera is looking up. Figure 8 In some embodiments, after step S703, the wavefront information extraction method provided in the embodiment of the present application may further include but is not limited to steps S801 to S804:
[0126] Step S801: Pixels corresponding to the liquid level category are used as initial liquid level pixels.
[0127] In step S802 , the pixel coordinates of each pixel category are compared with the pixel coordinates of the initial liquid surface pixel to determine the air category and the liquid category from the plurality of pixel categories.
[0128] Step S803 : extracting a target area excluding the initial liquid surface pixels from the liquid surface sub-image according to the pixel coordinates of the initial liquid surface pixels.
[0129] Step S804 : extracting a target area excluding the initial liquid surface pixels from the liquid surface sub-image according to the pixel coordinates of the initial liquid surface pixels.
[0130] In step S801 of some embodiments, the initial liquid level pixels are a set of pixels corresponding to the liquid level category screened by RGB values and pixel discreteness.
[0131] In step S802 of some embodiments, based on the coordinate distribution of each pixel category in the liquid surface sub-image, the pixel coordinates of the initial liquid surface pixels are compared and determined to identify the principal component categories at the top and bottom of the image, which are defined as the air category and the liquid category, respectively. Specifically, if the vast majority of pixels in the current pixel category are located above the initial liquid surface pixels, the pixel category is determined to be the air category. If the vast majority of pixels in the current pixel category are located below the initial liquid surface pixels, the pixel category is determined to be the liquid category. Figure 7 Taking the clustered image in the third row as an example, the pixels in the original image are divided into four categories: air layer, liquid surface layer (i.e., initial liquid surface pixels), impurity layer, and water layer. Pixels corresponding to the air layer are all above the initial liquid surface pixels, so the corresponding pixel category is air. Pixels in the impurity layer and water layer are both below the initial liquid surface pixels, so the corresponding pixel category can be determined as liquid.
[0132] In step S803 of some embodiments, due to the characteristic that the peak area has no dark border, the initial liquid level pixels obtained by screening the RGB value and discreteness data cannot cover all the boundaries of the peak. If the peak area is not processed, the liquid level curve finally obtained will not be a complete line. Figure 7 Taking the original image in the third row as an example, the area image from the leftmost side to the first initial liquid level pixel on the left side in the cluster image can be used as the target area.
[0133] In step S804 of some embodiments, the middle pixel refers to a pixel located at the boundary between a pixel belonging to the air category and a pixel belonging to the liquid category.
[0134] In steps S801 to S804 shown in the embodiment of the present application, based on preliminary identification, spatial analysis of the pixel boundary between the air category and the liquid category is introduced to actively identify the intersection transition pixels between the two categories and recalibrate them as the liquid surface category, thereby effectively repairing the lack of liquid surface boundary information. The method of this embodiment is particularly suitable for special scenarios where the edge of the liquid surface appears blurred, thinned, or even disappears when the first camera looks up at the wave crest. While maintaining recognition accuracy, the adaptive processing capability for complex conditions such as rising wave crests and liquid levels exceeding the viewing angle is enhanced, ensuring the spatial coherence and physical continuity of the liquid surface curve, and providing a more stable and reliable image input basis for subsequent wave height calculation and wave surface modeling.
[0135] In step S304 of some embodiments, the liquid surface curve coordinates refer to the continuous position data of pixels corresponding to the liquid surface category in the liquid surface image coordinate system. Specifically, all pixels belonging to the liquid surface category are found in each liquid surface sub-image, their original image coordinates are restored to the positions corresponding to the full image, and the coordinate information of these points is sequentially integrated in the horizontal direction to form a discrete point set describing the position of the liquid surface image.
[0136] Steps S301 to S304, as illustrated in the present embodiment, vertically divide the liquid surface image into multiple liquid surface sub-images. Each liquid surface sub-image is then subjected to local color clustering, thereby avoiding clustering errors caused by uneven color distribution across the entire image. This improves the spatial resolution and local accuracy of liquid surface recognition. Ultimately, by integrating the coordinates of the liquid surface pixels identified in all liquid surface sub-images, a complete and coherent liquid surface curve coordinate can be efficiently restored, laying a stable and reliable image foundation for subsequent liquid level calculation and reference wave height data generation.
[0137] Step S102 also includes calculating the height of the liquid surface curve coordinates to obtain reference wave height data for the liquid surface curve. In this embodiment, a scale perpendicular to the horizontal plane is placed within the first camera's capture range. The liquid surface curve coordinates can be calculated based on the ratio between the number of pixels in the liquid surface image captured by the first camera and the actual size data to obtain reference wave height data. Other methods can also be used to convert the liquid surface curve coordinates from image coordinates to actual size data, and this embodiment does not strictly limit the specific implementation method.
[0138] In step S103 of some embodiments, the pixels in the wavefront image can be reconstructed in three dimensions using visual techniques such as depth estimation, stereo matching, or structured light projection to obtain the three-dimensional coordinates of each pixel in the camera coordinate system of the second camera, thereby forming a discrete point set representing the spatial shape of the wavefront, i.e., the original wavefront point cloud coordinates. It should be noted that the original wavefront point cloud coordinates are spatial coordinate data obtained in the camera coordinate system established by the second camera, and their positional relationship only reflects the three-dimensional projection result of the point cloud relative to the optical center of the second camera. Therefore, the coordinate values in the original wavefront point cloud coordinates are relative, i.e., they only have geometric meaning within the current camera perspective and cannot directly reflect the absolute position or height information of each wavefront point in the real physical space. It is understandable that the second camera can be a monocular camera, a binocular camera, or a depth camera, but is not limited thereto.
[0139] In step S104 of some embodiments, since the first camera and the second camera can be determined at the beginning of the experiment, the position and posture relationship between the two cameras can be predetermined, thereby calculating the rotation matrix and translation vector between the two cameras. The rotation matrix and translation vector are then combined to form a transformation matrix. The transformation matrix refers to the transformation relationship matrix that converts the camera coordinate system of the second camera into the camera coordinate system of the first camera. By applying this transformation matrix to each original wavefront point cloud coordinate, it can be converted from the second camera coordinate system to the first camera coordinate system. The resulting coordinate point is the basic wavefront point cloud coordinate.
[0140] In step S105 of some embodiments, the detection point requirement information refers to user-preset information regarding the target location where wave height needs to be calculated. It typically includes one or more spatial points of interest on the wave surface within the pool and can be set based on the experimental layout, analysis requirements, or monitoring strategy. For example, if the impact of reefs on water movement needs to be studied, a reef can be placed in the pool. The detection point requirement information can then be: "Set multiple detection points in the wave surface areas corresponding to the water areas in front of, in the middle of, and at the tail of the reef to obtain the wave height changes in the flow, reflection, and wake areas after the wave encounters the reef."
[0141] The target point cloud coordinates refer to the three-dimensional coordinate points corresponding to each target detection point selected in the basic wavefront point cloud coordinates according to the detection point requirement information, representing the specific position of the detection point in the wavefront.
[0142] Since the second camera captures the complete wavefront range, the original wavefront point cloud coordinates obtained through the wavefront image and the basic wavefront point cloud coordinates after the coordinate system conversion include the liquid surface curve (such as Figure 2The reference liquid level curve point refers to the spatial point that corresponds or is associated with the target detection point in the real space and is located on the liquid level curve. The reference liquid level curve point is usually located on the same vertical projection line as the target detection point. The reference point cloud coordinates refer to the basic wave surface point cloud coordinates corresponding to the reference liquid level curve point. For example, please refer to Figure 2 The red curve represents the liquid surface curve. The origin of the camera coordinate system of the first camera is the optical center of the first camera. The positive z-axis is along the optical axis of the first camera toward the pool, the positive x-axis is horizontal and to the right, and the positive y-axis is perpendicular to the horizontal plane. The target detection point is a point on the wave surface, and its corresponding target point cloud coordinates are (x2, y2, z2). On the liquid surface curve, there is a reference liquid surface curve point associated with the target detection point. The reference point cloud coordinates corresponding to this reference liquid surface curve point are (x1, y1, z1), where x1 = x2.
[0143] In step S106 of some embodiments, see Figure 9 , Figure 9 for Figure 2 The target wave height data refers to the actual height data of the target detection point, that is, the distance from the target detection point to the horizontal plane. The calculation process of the target wave height data includes the following steps: First, obtain the camera height data of the first camera. The camera height data refers to the vertical distance from the first camera to the horizontal plane. Figure 9 Then, the difference between the reference wave height data and the camera height data is calculated to obtain the first distance. The reference wave height data is the vertical height of the reference point cloud coordinate (x1, y1, z1) relative to the horizontal plane in the real world. Figure 9 In the image, the liquid surface curve coordinates are 2D positions in the image coordinate system, while the reference point cloud coordinates are 3D points in the camera coordinate system. The two can be aligned by horizontally registering their x-coordinates. In other words, if x1 is known, the corresponding reference wave height data can be directly obtained from the wave height data mapped by the liquid surface curve.
[0144] Since the reference coordinate system of the reference point cloud coordinates (x1, y1, z1) is the camera coordinate system of the first camera, y1 represents the vertical distance of the point relative to the camera's optical center, expressed in point cloud numbers or relative unit coordinates. Subtracting the camera height data D0 from the reference wave height data Dref yields the first distance corresponding to coordinate y1. Next, the unit point cloud scale parameter is calculated based on the ratio of the first distance and the reference point cloud coordinates. Since the positive direction of the y-axis is perpendicular to the horizontal plane and points downward, the numerical calculations for y1 and y2 require absolute values. The unit point cloud scale parameter refers to the real-world physical distance corresponding to a unit point cloud coordinate (i.e., 1 unit in the y-axis direction) in the camera coordinate system of the first camera. It is typically expressed in meters and represents the scaling factor for converting point cloud relative coordinates to world coordinates. The second distance is then multiplied by the target point cloud coordinates to obtain the second distance. This second distance represents the vertical distance of the target detection point from the optical center of the first camera in real space. Finally, the target wave height data is obtained by adding the second distance to the camera height data.
[0145] It is understandable that once the unit point cloud scale parameter is determined, there are multiple calculation methods for solving the y value of the target point cloud coordinate, and this embodiment does not impose the sole limitation on this.
[0146] Finally, based on the target wave height data, other physical parameters that can reflect the wave characteristics at that point can be calculated, such as wavelength, amplitude, period, angular frequency, and phase velocity. In addition, through spectrum analysis methods such as Fourier transform, the energy spectrum and phase spectrum of the wave can be further extracted to reveal its frequency components and coherence characteristics. Based on the spatial wavefront change data, the group velocity of the wave can be calculated to more accurately describe the propagation characteristics of the wave. In scenarios involving structures, this method can also be used to analyze the characteristics of the radiated wave field around the structure. Wavefront information refers to a set of key physical parameters used to describe the wave state at the target detection point, which can be in the form of text descriptions or charts.
[0147] See also Figure 12 , Figure 12 The figure shows the relative wave height curve at a specific target detection point. The black curve (Lab_prob) represents the relative wave height data collected using a wave height meter, and the red dashed line (Image) represents the relative wave height data obtained using the wavefront information extraction method provided in the embodiment of this application. It should be noted that relative wave height data refers to the difference between the actual wave height data and a specific height. In this embodiment, the specific height is 40 cm. Figure 12The horizontal axis represents time (time), in seconds. The vertical axis represents relative wave height (elevation), in mm. The upper left corner shows a magnified view of the peak of the curve between 33.1s and 33.7s. It can be seen that the wave height meter data exhibits peak clipping at the peak of the curve. However, the wavefront information extraction method provided in this embodiment not only accurately analyzes the wave height meter data but also avoids peak clipping. Therefore, this method can verify the accuracy of the wave height meter and eliminate errors caused by wave-making plate movement.
[0148] See also Figure 10 The present application also provides a wavefront information extraction device that can implement the above-mentioned wavefront information extraction method. The device includes:
[0149] The first image acquisition module 1001 is used to capture the liquid surface of the pool through a first camera to obtain a liquid surface image, wherein the liquid surface image includes an image of a liquid surface curve, which is the boundary between the liquid and the air in the pool.
[0150] The liquid level recognition module 1002 is used to perform liquid level recognition on the liquid level image to obtain the liquid level curve coordinates, and perform height calculation on the liquid level curve coordinates to obtain reference wave height data of the liquid level curve.
[0151] The second image acquisition module 1003 is used to capture the image of the wave surface in the pool through a second camera to obtain a wave surface image.
[0152] The point cloud coordinate acquisition module 1004 is used to perform point cloud recognition on the wavefront image to obtain a plurality of original wavefront point cloud coordinates.
[0153] The coordinate conversion module 1005 is used to obtain a conversion matrix between the camera coordinate system of the first camera and the camera coordinate system of the second camera, and perform coordinate system conversion on each of the multiple original wavefront point cloud coordinates according to the conversion matrix to obtain multiple basic wavefront point cloud coordinates.
[0154] The point cloud selection module 1006 is used to select the target point cloud coordinates of the target detection point from multiple basic wave surface point cloud coordinates based on the preset detection point requirement information, and determine the reference liquid surface curve point associated with the target detection point in the liquid surface curve, and use the basic wave surface point cloud coordinates of the reference liquid surface curve point as the reference point cloud coordinates.
[0155] The wavefront information generation module 1007 is used to perform data calculation based on the target point cloud coordinates, reference point cloud coordinates and reference wave height data to obtain target wave height data corresponding to the target detection point, and generate wavefront information of the target detection point based on the target wave height data.
[0156] The specific implementation of the wavefront information extraction device is basically the same as the specific embodiment of the above-mentioned wavefront information extraction method, and will not be repeated here.
[0157] The present application also provides an electronic device comprising a memory and a processor, wherein the memory stores a computer program, and the processor implements the above-mentioned wavefront information extraction method when executing the computer program. The electronic device can be any smart terminal including a tablet computer, an in-vehicle computer, or the like.
[0158] See also Figure 11 , Figure 11 The hardware structure of an electronic device according to another embodiment is shown. The electronic device includes:
[0159] The processor 1101 can be implemented as a general-purpose CPU (Central Processing Unit), a microprocessor, an application-specific integrated circuit (ASIC), or one or more integrated circuits, and is used to execute relevant programs to implement the technical solutions provided in the embodiments of the present application.
[0160] The memory 1102 can be implemented in the form of a read-only memory (ROM), a static storage device, a dynamic storage device, or a random access memory (RAM). The memory 1102 can store an operating system and other application programs. When the technical solutions provided in the embodiments of this specification are implemented through software or firmware, the relevant program code is stored in the memory 1102 and is called by the processor 1101 to execute the wavefront information extraction method of the embodiments of this application.
[0161] Input / output interface 1103, used to implement information input and output;
[0162] Communication interface 1104, used to implement communication interaction between this device and other devices, which can be achieved through wired means (such as USB, network cable, etc.) or wireless means (such as mobile network, WiFi, Bluetooth, etc.);
[0163] Bus 1105 , which transmits information between various components of the device (e.g., processor 1101 , memory 1102 , input / output interface 1103 , and communication interface 1104 );
[0164] The processor 1101 , the memory 1102 , the input / output interface 1103 and the communication interface 1104 are connected to each other in communication within the device via a bus 1105 .
[0165] An embodiment of the present application further provides a computer-readable storage medium, which stores a computer program. When the computer program is executed by a processor, the above-mentioned wavefront information extraction method is implemented.
[0166] The memory, as a non-transient computer-readable storage medium, can be used to store non-transient software programs and non-transient computer executable programs. In addition, the memory may include a high-speed random access memory and may also include a non-transient memory, such as at least one disk storage device, a flash memory device, or other non-transient solid-state storage device. In some embodiments, the memory may optionally include a memory remotely arranged relative to the processor, and these remote memories may be connected to the processor via a network. Examples of the above-mentioned network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.
[0167] The wavefront information extraction method, wavefront information extraction device, electronic device, and storage medium provided in the embodiments of the present application utilize a first camera to capture a liquid surface image, identify the liquid surface curve coordinates through image processing, and calculate the height based on the spatial position of the liquid surface in the image to obtain physically meaningful reference wave height data, thereby providing the calibration benchmark required for wave height measurement. A second camera is then introduced to capture the wave surface within the pool from above. Multiple raw wavefront point cloud coordinates are obtained through point cloud recognition, enabling spatial reconstruction of the wave surface's large-scale, continuous three-dimensional form, improving the measurement coverage and information dimensionality. A coordinate transformation matrix is then established between the two cameras to convert the raw wavefront point cloud coordinates into base wavefront point cloud coordinates in the camera coordinate system of the first camera, thereby achieving geometric alignment of image data from different perspectives. Then, based on preset detection point requirements, the target point cloud coordinates are selected from the base wavefront point cloud coordinates, and their reference liquid surface curve point in the liquid surface curve is determined. The base wavefront point cloud coordinates of this point are then used as the reference point cloud coordinates to construct a spatial measurement relationship between the target and the reference point. Finally, data calculations are performed based on the target point cloud coordinates, reference point cloud coordinates, and reference wave height data to obtain the target wave height data and generate wavefront information for the target detection point, achieving high-precision wave height estimation and visualization output for any position on the wavefront. The method of this embodiment combines image processing with point cloud reconstruction technology, not only avoiding the high cost associated with densely deployed traditional sensors, but also breaking the limitations of single-point detection. It can achieve simultaneous acquisition of multi-point wavefront information without increasing the amount of hardware. This overcomes the technical limitations of traditional wave height meters in terms of spatial distribution, cost control, and multi-point synchronous measurement, improving the efficiency of wavefront information acquisition while reducing hardware costs.
[0168] The embodiments described in the embodiments of this application are intended to more clearly illustrate the technical solutions of the embodiments of this application and do not constitute a limitation on the technical solutions provided by the embodiments of this application. Those skilled in the art will appreciate that with the evolution of technology and the emergence of new application scenarios, the technical solutions provided in the embodiments of this application are also applicable to similar technical problems.
[0169] Those skilled in the art will understand that the technical solutions shown in the figures do not constitute a limitation on the embodiments of the present application, and may include more or fewer steps than shown in the figures, or a combination of certain steps, or different steps.
[0170] The device embodiments described above are merely illustrative. The units described as separate components may or may not be physically separate, i.e., they may be located in one place or distributed across multiple network units. Some or all of the modules may be selected based on actual needs to achieve the objectives of this embodiment.
[0171] Those skilled in the art will appreciate that all or some of the steps in the methods, systems, and functional modules / units in the devices disclosed above may be implemented as software, firmware, hardware, or appropriate combinations thereof.
[0172] The terms "first", "second", "third", "fourth", etc. (if any) in the specification of the present application and the above-mentioned drawings are used to distinguish similar objects and are not necessarily used to describe a specific order or sequential order. It should be understood that the data used in this way can be interchangeable where appropriate, so that the embodiments of the present application described herein can be implemented in an order other than those illustrated or described herein. In addition, the terms "including" and "having" and any variations thereof are intended to cover non-exclusive inclusions, for example, a process, method, system, product or device that includes a series of steps or units is not necessarily limited to those steps or units clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.
[0173] It should be understood that in this application, "at least one (item)" means one or more, and "plurality" means two or more. "And / or" is used to describe the association relationship of associated objects, indicating that three relationships may exist. For example, "A and / or B" can mean: only A exists, only B exists, and A and B exist at the same time, where A and B can be singular or plural. The character " / " generally indicates that the previous and next associated objects are in an "or" relationship. "At least one of the following items" or similar expressions refers to any combination of these items, including any combination of single items or plural items. For example, at least one of a, b or c can mean: a, b, c, "a and b", "a and c", "b and c", or "a and b and c", where a, b, c can be single or multiple.
[0174] In the several embodiments provided in this application, it should be understood that the disclosed devices and methods can be implemented in other ways. For example, the device embodiments described above are merely schematic. For example, the division of the above-mentioned units is only a logical function division. In actual implementation, there may be other division methods, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of devices or units, which can be electrical, mechanical or other forms.
[0175] The units described above as separate components may or may not be physically separate, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed across multiple network units. Some or all of these units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
[0176] In addition, the functional units in the various embodiments of the present application may be integrated into a single processing unit, or each unit may exist physically separately, or two or more units may be integrated into a single unit. The aforementioned integrated units may be implemented in the form of hardware or software functional units.
[0177] If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present application, or the part that contributes to the prior art, or all or part of the technical solution can be embodied in the form of a software product, which is stored in a storage medium and includes multiple instructions for enabling a computer device (which can be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods of various embodiments of the present application. The aforementioned storage medium includes: various media that can store programs, such as a USB flash drive, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk.
[0178] The preferred embodiments of the present invention are described above with reference to the accompanying drawings, but are not intended to limit the scope of the present invention. Any modifications, equivalent substitutions, and improvements made by those skilled in the art without departing from the scope and essence of the present invention should be within the scope of the present invention.
Claims
1. A wavefront information extraction method, characterized in that: A camera module for capturing images of a pool, the camera module comprising a first camera and a second camera, the method comprising: The first camera is used to capture an image of the liquid surface in the water pool to obtain a liquid surface image; wherein the liquid surface image includes an image of a liquid surface curve, and the liquid surface curve is a boundary between the liquid and the air in the water pool; Performing liquid level recognition on the liquid level image to obtain liquid level curve coordinates, and performing height calculation on the liquid level curve coordinates to obtain reference wave height data of the liquid level curve; Capturing an image of the wave surface in the pool by the second camera to obtain a wave surface image, and performing point cloud recognition on the wave surface image to obtain a plurality of original wave surface point cloud coordinates; Obtaining a conversion matrix between a camera coordinate system of the first camera and a camera coordinate system of the second camera, and performing a coordinate system conversion on each of the plurality of original wavefront point cloud coordinates according to the conversion matrix to obtain a plurality of basic wavefront point cloud coordinates; Selecting target point cloud coordinates of a target detection point from the plurality of basic wave surface point cloud coordinates based on preset detection point requirement information, determining a reference liquid surface curve point associated with the target detection point in the liquid surface curve, and using the basic wave surface point cloud coordinates of the reference liquid surface curve point as the reference point cloud coordinates; Data calculation is performed according to the target point cloud coordinates, the reference point cloud coordinates and the reference wave height data to obtain target wave height data corresponding to the target detection point, and wave surface information of the target detection point is generated based on the target wave height data.
2. The method according to claim 1, characterized in that The performing liquid level recognition on the liquid level image to obtain liquid level curve coordinates includes: dividing the liquid surface image in a vertical direction to obtain a plurality of liquid surface sub-images; For each of the liquid surface sub-images, pixel clustering is performed on the pixels of the liquid surface sub-image according to the pixel color values of the liquid surface sub-image to obtain average color values corresponding to multiple pixel categories; Selecting a minimum average color value from the plurality of average color values as a target color value, and determining a liquid level category from the plurality of pixel categories according to the target color value; The pixel coordinates of all pixels corresponding to the liquid surface category in the liquid surface sub-images are integrated to obtain the liquid surface curve coordinates.
3. The method according to claim 2, characterized in that Determining the liquid level category from the plurality of pixel categories according to the target color value includes: Taking pixels of the pixel category corresponding to the target color value as candidate pixels, and calculating the dispersion between the target color value and each candidate pixel to obtain candidate dispersion data; Performing data screening on the plurality of candidate discreteness data to obtain target discreteness data; The pixel category of the pixel corresponding to the target discreteness data is determined as the liquid level category.
4. The method according to claim 3, characterized in that After determining the pixel category of the pixel corresponding to the target discreteness data as the liquid level category, the method further includes: Using pixels corresponding to the liquid level category as initial liquid level pixels; Determining an air category and a liquid category from the plurality of pixel categories based on comparing the pixel coordinates of each pixel category with the pixel coordinates of the initial liquid level pixel; extracting a target area excluding the initial liquid surface pixel from the liquid surface sub-image according to the pixel coordinates of the initial liquid surface pixel; For the target area, a pixel at the intersection of the pixel corresponding to the air category and the pixel corresponding to the liquid category is used as an intermediate pixel, and the pixel category of the intermediate pixel is determined to be the liquid surface category.
5. The method according to claim 2, characterized in that The liquid surface image is divided in a vertical direction to obtain a plurality of liquid surface sub-images, including: Acquire an initial image by the first camera, wherein the initial image is an image of the liquid in the pool when it is still; Obtaining an initial pixel color value of each pixel in the initial image, and obtaining a reference pixel color value of each pixel in the liquid surface image; wherein each pixel in the initial image has a corresponding pixel in the liquid surface image; For each pair of pixels having a positional correspondence between the liquid surface image and the initial image, calculating a difference between a color value of the initial pixel and a color value of the reference pixel to obtain a color difference value; The color difference value having a value other than 0 is determined as a positioning pixel, and the liquid surface image is segmented in the vertical direction according to the pixel coordinates of the positioning pixel to obtain a plurality of liquid surface sub-images.
6. The method according to claim 5, characterized in that The vertical segmentation of the liquid surface image according to the pixel coordinates of the positioning pixels to obtain a plurality of liquid surface sub-images includes: In the vertical direction, a maximum value is selected from the pixel coordinates of the plurality of positioning pixels as a first limiting coordinate, and a minimum value is selected from the pixel coordinates of the plurality of positioning pixels as a second limiting coordinate; In the horizontal direction, a maximum value is selected from the pixel coordinates of the plurality of positioning pixels as a third limiting coordinate, and a minimum value is selected from the pixel coordinates of the plurality of positioning pixels as a fourth limiting coordinate; wherein the horizontal direction is perpendicular to the vertical direction; cropping the liquid surface image according to the first limit coordinate, the second limit coordinate, the third limit coordinate, and the fourth limit coordinate to obtain a wave area image; A mean value calculation is performed based on the third limit coordinate and the fourth limit coordinate to determine a pixel sub-interval, and the wave area image is segmented in the vertical direction based on the pixel sub-interval to obtain a plurality of liquid surface sub-images.
7. The method according to any one of claims 1 to 6, characterized in that The performing data calculation according to the target point cloud coordinates, the reference point cloud coordinates and the reference wave height data to obtain the target wave height data corresponding to the target detection point includes: Obtaining camera height data of the first camera; Performing a difference calculation based on the reference wave height data and the camera height data to obtain a first distance; Calculate a ratio between the first distance and the reference point cloud coordinates to obtain a unit point cloud scale parameter; Obtaining a second distance by multiplying the unit point cloud scale parameter and the target point cloud coordinates; The target wave height data is obtained by adding the second distance and the camera height data.
8. A wavefront information extraction device, characterized in that: The device comprises: a first image acquisition module, configured to capture an image of the liquid surface of the pool using the first camera to obtain a liquid surface image; wherein the liquid surface image includes an image of a liquid surface curve, and the liquid surface curve is a boundary between the liquid and the air in the pool; a liquid level recognition module, configured to perform liquid level recognition on the liquid level image to obtain liquid level curve coordinates, and perform height calculation on the liquid level curve coordinates to obtain reference wave height data of the liquid level curve; a second image acquisition module, configured to capture an image of the wave surface in the pool by using the second camera to obtain a wave surface image; a point cloud coordinate acquisition module, configured to perform point cloud recognition on the wavefront image to obtain a plurality of original wavefront point cloud coordinates; a coordinate conversion module, configured to obtain a conversion matrix between the camera coordinate system of the first camera and the camera coordinate system of the second camera, and perform a coordinate system conversion on each of the plurality of original wavefront point cloud coordinates according to the conversion matrix to obtain a plurality of basic wavefront point cloud coordinates; a point cloud selection module, configured to select target point cloud coordinates of a target detection point from the plurality of basic wave surface point cloud coordinates based on preset detection point requirement information, determine a reference liquid surface curve point associated with the target detection point in the liquid surface curve, and use the basic wave surface point cloud coordinates of the reference liquid surface curve point as reference point cloud coordinates; The wavefront information generation module is used to perform data calculation based on the target point cloud coordinates, the reference point cloud coordinates and the reference wave height data to obtain the target wave height data corresponding to the target detection point, and generate the wavefront information of the target detection point based on the target wave height data.
9. An electronic device, characterized in that: The electronic device includes a memory and a processor, the memory stores a computer program, and the processor implements the method according to any one of claims 1 to 7 when executing the computer program.
10. A computer-readable storage medium storing a computer program, characterized in that: When the computer program is executed by a processor, the method according to any one of claims 1 to 7 is implemented.
Citation Information
Patent Citations
Method for measuring height of wave surface of wave on deck
CN117146783A
Intelligent reconstruction and forecasting system and method for three-dimensional wave field in real marine environment
CN119206092A
Volume measurement method and apparatus and computer readable storage medium
WO2023097913A1
Cited By
Target container liquid level visual detection and early warning method and system
CN121330329A