Wave front information extraction method and device, electronic equipment and storage medium
By combining two cameras with image processing and point cloud reconstruction technology, the problem of traditional sensors being unable to acquire wavefront information across the entire area has been solved, achieving efficient and low-cost acquisition of wavefront information.
Patent Information
- Application Number
- CN202510639927.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-05-19
- Publication Date
- 2026-08-25
- Estimated Expiration
- 2045-05-19
AI Technical Summary
In existing technologies, the measurement of wave surface information relies on traditional sensors, which cannot acquire wave surface information of water waves over the entire area, resulting in low efficiency and high cost.
Two cameras are used for image acquisition and point cloud recognition. The first camera is placed horizontally to acquire liquid surface images and identify the coordinates of the liquid surface curves. The second camera is placed overhead to acquire wave surface images and perform point cloud recognition. Geometric alignment under different viewpoints is achieved through a coordinate transformation matrix, and finally the target wave height data is calculated.
It improves the efficiency of wavefront information acquisition and reduces hardware costs without increasing the number of hardware components, overcomes the high cost problem caused by the dense deployment of traditional sensors, and realizes the synchronous acquisition of wavefront information at multiple points.
Smart Images

Figure CN120689735B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of wave measurement technology, and in particular to a method and apparatus for extracting wave surface information, an electronic device, and a storage medium. Background Technology
[0002] In hydrodynamic experiments, the 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, wave surface information measurement relies on traditional sensors (such as wave height meters). However, there may be multiple points in a water wave that need to be detected. Currently, sensors can only detect the value at one point at a time, limiting the measurement range and preventing the acquisition of wave surface information across the entire area, resulting in low efficiency in wave surface information acquisition. While multiple sensors can be used simultaneously, this is costly. Therefore, improving the efficiency of wave surface information acquisition while reducing costs has become an urgent technical problem to be solved. Summary of the Invention
[0004] The main objective of this application is to provide a wavefront information extraction method, apparatus, electronic device, and storage medium, which aims to improve the efficiency of wavefront information acquisition and reduce costs.
[0005] To achieve the above objectives, a first aspect of this application proposes a wavefront information extraction method, applied to a camera module for image acquisition of a water tank, the camera module including a first camera and a second camera, the method comprising: The first camera captures an image of the liquid surface in the pool, which is a liquid surface image. The liquid surface image includes an image of the liquid surface curve, which is the boundary line between the liquid and the air in the pool. The first camera is placed horizontally with its optical axis parallel to the horizontal plane. The liquid surface image is subjected to liquid surface recognition to obtain liquid surface curve coordinates, and the height of the liquid surface curve coordinates is calculated to obtain reference wave height data of the liquid surface curve; The second camera captures images of the wave surface in the pool, and performs point cloud recognition on the wave surface images to obtain multiple original wave surface point cloud coordinates; wherein, the second camera is arranged at a top-down angle, and the shooting range covers the entire wave surface in the pool. Obtain the transformation matrix between the camera coordinate system of the first camera and the camera coordinate system of the second camera, and perform coordinate system transformation on each of the multiple original wavefront point cloud coordinates according to the transformation matrix to obtain multiple basic wavefront point cloud coordinates; Based on the preset detection point requirement information, the target point cloud coordinates of the target detection point are selected from multiple basic wavefront point cloud coordinates, and a reference liquid surface curve point associated with the target detection point is determined in the liquid surface curve, and the basic wavefront point cloud coordinates of the reference liquid surface curve point are used as the reference point cloud coordinates. Data calculations are performed 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 wave surface information of the target detection point is generated based on the target wave height data.
[0006] In some embodiments, the step of performing liquid surface recognition on the liquid surface image to obtain liquid surface curve coordinates includes: The liquid surface image is divided vertically to obtain multiple liquid surface sub-images; For each of the liquid surface sub-images, the pixels of the liquid surface sub-images are clustered according to the pixel color values of the liquid surface sub-images to obtain the average color values corresponding to multiple pixel categories; The minimum average color value is selected from the plurality of average color values as the target color value, and the liquid surface category is determined from the plurality of pixel categories based on the target color value; The pixel coordinates of all the pixels in the liquid surface sub-images corresponding to the liquid surface category are integrated to obtain the liquid surface curve coordinates.
[0007] In some embodiments, determining the liquid surface category from a plurality of pixel categories based on the target color value includes: Pixels corresponding to the pixel category of the target color value are selected as candidate pixels, and the dispersion between the target color value and each candidate pixel is calculated to obtain candidate dispersion data. Data filtering is performed on multiple candidate discrete data to obtain target discrete data; The pixel category of the pixel corresponding to the target discrete data is determined as the liquid surface category.
[0008] In some embodiments, after determining the pixel category of the pixel corresponding to the target discrete data as the liquid surface category, the method further includes: The pixel corresponding to the liquid surface category is used as the initial liquid surface pixel; By comparing the pixel coordinates of each pixel category with the pixel coordinates of the initial liquid surface pixel, the air category and the liquid category are determined from the multiple pixel categories; Based on the pixel coordinates of the initial liquid surface pixel, extract the target region excluding the initial liquid surface pixel from the liquid surface sub-image; For the target area, the pixel at the intersection of the pixel corresponding to the air category and the pixel corresponding to the liquid category is taken as the intermediate pixel, and the pixel category of the intermediate pixel is determined as the liquid surface category.
[0009] In some embodiments, the step of dividing the liquid surface image vertically to obtain multiple liquid surface sub-images includes: An initial image is acquired by the first camera, and the initial image is an image of the liquid in the pool when it is still. Obtain the initial pixel color value of each pixel in the initial image, and obtain the 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 with a positional correspondence in the liquid surface image and the initial image, the difference between the color value of the initial pixel and the color value of the reference pixel is calculated to obtain a color difference value; The pixels with a color difference value of 0 are identified as positioning pixels, and the liquid surface image is segmented in the vertical direction according to the pixel coordinates of the positioning pixels to obtain multiple liquid surface sub-images.
[0010] In some embodiments, the step of segmenting the liquid surface image vertically according to the pixel coordinates of the positioned pixel to obtain multiple liquid surface sub-images includes: In the vertical direction, the maximum value is selected from the pixel coordinates of the plurality of positioning pixels as the first limiting coordinate, and the minimum value is selected from the pixel coordinates of the plurality of positioning pixels as the second limiting coordinate. In the horizontal direction, the maximum value is selected from the pixel coordinates of the plurality of positioning pixels as the third limiting coordinate, and the minimum value is selected from the pixel coordinates of the plurality of positioning pixels as the fourth limiting coordinate; wherein, the horizontal direction is perpendicular to the vertical direction; The liquid surface image is cropped based on the first limiting coordinate, the second limiting coordinate, the third limiting coordinate, and the fourth limiting coordinate to obtain a wave region image; The mean value is calculated based on the third and fourth limit coordinates to determine the pixel sub-intervals. The wave region image is then segmented vertically based on the pixel sub-intervals to obtain multiple liquid surface sub-images.
[0011] In some embodiments, the step of calculating the target wave height data corresponding to the target detection point based on the target point cloud coordinates, the reference point cloud coordinates, and the reference wave height data includes: Obtain the camera height data of the first camera; The first distance is obtained by calculating the difference between the reference wave height data and the camera height data; The ratio between the first distance and the reference point cloud coordinates is calculated to obtain the unit point cloud ratio parameter. The second distance is obtained 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.
[0012] To achieve the above objectives, a second aspect of this application provides a wavefront information extraction device applied to a camera module for image acquisition of a water tank. The camera module includes a first camera and a second camera. The device includes: The first image acquisition module is used to acquire an image of the liquid surface of the pool through the first camera to obtain a liquid surface image; wherein, the liquid surface image includes an image of the liquid surface curve, the liquid surface curve being the boundary line between the liquid and the air in the pool, and the first camera is placed horizontally with its optical axis parallel to the horizontal plane. The liquid surface recognition module is used to recognize the liquid surface in the liquid surface image, obtain the liquid surface curve coordinates, and calculate the height of the liquid surface curve coordinates to obtain the reference wave height data of the liquid surface curve. The second image acquisition module is used to acquire images of the wave surface in the pool through the second camera to obtain a wave surface image; wherein the second camera is arranged at a top-down angle and the shooting range covers the entire wave surface in the pool. The point cloud coordinate acquisition module is used to perform point cloud recognition on the wavefront image to obtain multiple original wavefront point cloud coordinates; The coordinate transformation module is used to obtain the transformation matrix between the camera coordinate system of the first camera and the camera coordinate system of the second camera, and to perform coordinate system transformation on each of the multiple original wavefront point cloud coordinates according to the transformation matrix to obtain multiple basic wavefront point cloud coordinates. The point cloud selection module is used to select the target point cloud coordinates of the target detection point from multiple base wavefront point cloud coordinates based on preset detection point requirement information, and to determine a reference liquid surface curve point associated with the target detection point in the liquid surface curve, and to use the base wavefront point cloud coordinates of the reference liquid surface curve point as the reference point cloud coordinates. The wavefront information generation module is used to perform data calculations 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, and to generate wavefront information of the target detection point based on the target wave height data.
[0013] To achieve the above objectives, a third aspect of this application provides an electronic device, which includes a memory and a processor. The memory stores a computer program, and the processor executes the computer program to implement the method described in the first aspect.
[0014] To achieve the above objectives, a fourth aspect of the present application provides a computer-readable storage medium storing a computer program that, when executed by a processor, implements the method described in the first aspect.
[0015] The wavefront information extraction method, apparatus, electronic device, and storage medium proposed in this application acquire liquid surface images using a first camera, 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 a calibration benchmark required for wave height measurement. Then, a second camera is introduced to capture aerial images of the wavefront within the pool, obtaining multiple original wavefront point cloud coordinates through point cloud recognition, achieving spatial reconstruction of the large-scale, continuous three-dimensional morphology of the wavefront, thus improving the measurement coverage and information dimension. Next, by establishing a coordinate transformation matrix between the two cameras, the original wavefront point cloud coordinates are converted into basic wavefront point cloud coordinates in the camera coordinate system of the first camera, thereby achieving geometric alignment of image data from different perspectives. Then, combined with preset detection point requirement information, target point cloud coordinates are selected from the basic wavefront point cloud coordinates, and a reference liquid surface curve point is determined for that target. The basic wavefront point cloud coordinates of this point are then used as the reference point cloud coordinates to construct the spatial measurement relationship between the target and the reference point. Finally, based on the target point cloud coordinates, reference point cloud coordinates, and reference wave height data, data calculations are performed to obtain the target wave height data and generate wavefront information for the target detection point. This achieves high-precision wave height estimation and visualization output for any position on the wavefront. The method in this embodiment combines image processing and point cloud reconstruction techniques, which not only avoids the high cost problem caused by the dense deployment of traditional sensors but also breaks through the limitations of single-point detection. It can achieve simultaneous acquisition of multi-point wavefront information without increasing the number of hardware components, overcoming the technical limitations of traditional wave height meters in terms of spatial distribution, cost control, and multi-point synchronous measurement. This improves the efficiency of wavefront information acquisition while reducing hardware costs. Attached Figure Description
[0016] Figure 1 This is a flowchart of the wavefront information extraction method provided in the embodiments of this application; Figure 2 This is a schematic diagram of a scenario for implementing the wavefront information extraction method provided in the embodiments of this application; Figure 3 yes Figure 1 The flowchart of step S102 in the document; Figure 4 yes Figure 3 The flowchart of step S301 in the process; Figure 5 yes Figure 4 The flowchart of step S404 in the document; Figure 6 This is a schematic diagram of liquid surface curve recognition from a liquid surface sub-image; Figure 7 yes Figure 3 The flowchart of step S303 in the process; Figure 8 yes Figure 3 Another flowchart of step S303 in the process; Figure 9 yes Figure 2 The side view of the scene diagram shown; Figure 10 This is a schematic diagram of the wavefront information extraction device provided in the embodiments of this application; Figure 11 This is a schematic diagram of the hardware structure of the electronic device provided in the embodiments of this application; Figure 12 It is a relative wave height curve of a specific target detection point. Detailed Implementation
[0017] To make the objectives, technical solutions, and advantages of this application clearer, the following detailed description is provided in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative and not intended to limit the scope of this application.
[0018] It should be noted that although functional modules are divided in the device schematic diagram and a logical order is shown in the flowchart, in some cases, the steps shown or described may be performed in a different order than the module division in the device or the order in the flowchart. The terms "first," "second," etc., in the specification, claims, and the aforementioned drawings are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence.
[0019] Unless otherwise defined, 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 application belongs. The terminology used herein is for the purpose of describing embodiments of this application only and is not intended to limit this application.
[0020] First, let's analyze some of the terms used in this application: Computer vision (CV) is a technology that enables machines to simulate the human visual system. Through the automatic processing and understanding of images or videos, it identifies objects, understands scenes, analyzes motion, and makes decisions. It combines technologies from multiple fields such as image processing, machine learning, and artificial intelligence. Its core goal is to enable computers to "read" image or video content, thereby promoting better machine intelligence in perception and interaction in the real world.
[0021] 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 location in space and may include additional color, intensity or normal information.
[0022] In hydrodynamic experiments, the 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.
[0023] Currently, wave surface information measurement relies on traditional sensors (such as wave height meters). However, there may be multiple points in a water wave that need to be detected. Currently, sensors can only detect the value at one point at a time, limiting the measurement range and preventing the acquisition of wave surface information across the entire area, resulting in low efficiency in wave surface information acquisition. While multiple sensors can be used simultaneously, this is costly. Therefore, improving the efficiency of wave surface information acquisition while reducing costs has become an urgent technical problem to be solved.
[0024] Based on this, embodiments of this application provide a wavefront information extraction method and apparatus, electronic device and storage medium, aiming to improve the efficiency of wavefront information acquisition and reduce costs.
[0025] The wavefront information extraction method, apparatus, electronic device, and storage medium provided in this application are specifically described through the following embodiments. First, the wavefront information extraction method in this application is described.
[0026] This application can be used in a wide variety of general-purpose or special-purpose computer system environments or configurations. Examples include: 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, and distributed computing environments including any of the above systems or devices. This 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, etc., that perform specific tasks or implement specific abstract data types. This application can also be practiced in distributed computing environments where tasks are performed by remote processing devices connected via a communication network. In distributed computing environments, program modules can reside in local and remote computer storage media, including storage devices.
[0027] The wavefront information extraction method provided in this application embodiment is applied to a camera module for image acquisition of a water tank. 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 embodiments of this application. Figure 1 The method may include, but is not limited to, steps S101 to S106.
[0028] Step S101: The first camera acquires an image of the liquid surface in the pool, resulting in a liquid surface image. This image includes a view of the liquid surface curve, which represents the boundary between the liquid and air within the pool.
[0029] Step S102: Perform liquid surface recognition on the liquid surface image to obtain the coordinates of the liquid surface curve, and calculate the height of the liquid surface curve coordinates to obtain the reference wave height data of the liquid surface curve.
[0030] Step S103: The second camera acquires images of the wave surface in the pool to obtain wave surface images, and performs point cloud recognition on the wave surface images to obtain multiple original wave surface point cloud coordinates.
[0031] Step S104: Obtain the transformation matrix between the camera coordinate system of the first camera and the camera coordinate system of the second camera, and perform coordinate system transformation on each of the multiple original wavefront point cloud coordinates according to the transformation matrix to obtain multiple basic wavefront point cloud coordinates.
[0032] Step S105: Based on the preset detection point requirement information, select the target point cloud coordinates of the target detection point from multiple basic wavefront point cloud coordinates, and determine the reference liquid surface curve point associated with the target detection point in the liquid surface curve, and use the basic wavefront point cloud coordinates of the reference liquid surface curve point as the reference point cloud coordinates.
[0033] Step S106: Calculate the target wave height data corresponding to the target detection point based on the target point cloud coordinates, reference point cloud coordinates, and reference wave height data, and generate the wave surface information of the target detection point based on the target wave height data.
[0034] Steps S101 to S106 of this embodiment involve acquiring liquid surface images using a first camera, identifying the liquid surface curve coordinates through image processing, and calculating the height based on the spatial position of the liquid surface in the image to obtain physically meaningful reference wave height data, thereby providing a calibration benchmark required for wave height measurement. Then, a second camera is introduced to capture images of the wave surface within the pool from above. Multiple original wave surface point cloud coordinates are obtained through point cloud recognition, enabling spatial reconstruction of the large-scale, continuous three-dimensional morphology of the wave surface, thus improving the measurement coverage and information dimension. Next, a coordinate transformation matrix is established between the two cameras to convert the original 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, combined with preset detection point requirement information, target point cloud coordinates are selected from the basic wave surface point cloud coordinates, and a reference liquid surface curve point is determined within the liquid surface curve. The basic wave surface point cloud coordinates of this point are then used as the reference point cloud coordinates to construct the spatial measurement relationship between the target and the reference point. Finally, based on the target point cloud coordinates, reference point cloud coordinates, and reference wave height data, data calculations are performed to obtain the target wave height data and generate wavefront information for the target detection point. This achieves high-precision wave height estimation and visualization output for any position on the wavefront. The method in this embodiment combines image processing and point cloud reconstruction techniques, which not only avoids the high cost problem caused by the dense deployment of traditional sensors but also breaks through the limitations of single-point detection. It can achieve simultaneous acquisition of multi-point wavefront information without increasing the number of hardware components, overcoming the technical limitations of traditional wave height meters in terms of spatial distribution, cost control, and multi-point synchronous measurement. This improves the efficiency of wavefront information acquisition while reducing hardware costs.
[0035] Before further describing the specific steps of the wavefront information extraction method provided in the embodiments of this application, it is necessary to first explain the experimental scenarios to which this method is applicable. Please refer to... Figure 2 , Figure 2 This is a schematic diagram of a scenario implementing the wave surface information extraction method provided in the embodiments of this application. In this embodiment, the water tank is an open cylinder with a cuboid structure and is made of transparent material. The water tank is placed on a horizontal surface, and a certain amount of liquid is injected into the water tank. Wave motion can be generated in the water tank by a power device such as a wave generator. Figure 2 The colored curves shown are used to characterize the wave surface 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 perspective of the first camera.
[0036] To effectively acquire wavefront information, two shooting perspectives are set in this embodiment. The first camera is placed horizontally, with its optical axis parallel to the aforementioned horizontal plane. Preferably, the height of the optical axis of the first camera above the horizontal plane is set to be flush with the height of the liquid surface when the liquid in the pool is still, so as to better capture the changing characteristics of the liquid surface contour under this perspective. The second camera is arranged from a top-down angle, and its shooting range covers the entire wavefront range, thereby ensuring the complete spatial information input required for subsequent wavefront reconstruction or feature analysis.
[0037] In step S101 of some embodiments, the liquid surface image is any video frame in the video captured by the first camera of the liquid surface of the pool. It can be understood that the liquid surface curve is the boundary line between the liquid and the air in the pool, which is specifically manifested in the liquid surface image as a clear grayscale or color boundary formed at the interface between the liquid and the air, and this boundary forms a continuous or nearly continuous curve in the image.
[0038] In step S102 of some embodiments, the liquid surface curve coordinates refer to the pixel position corresponding to the liquid surface curve in the liquid surface image. The reference wave height data refers to the actual height data of the liquid surface curve in three-dimensional space.
[0039] Please see Figure 3 In some embodiments, step S102 may include, but is not limited to, steps S301 to S304: Step S301: Divide the liquid surface image vertically to obtain multiple liquid surface sub-images.
[0040] Step S302: For each liquid surface sub-image, perform pixel clustering on the pixels of the liquid surface sub-image based on the pixel color values of the liquid surface sub-image to obtain the average color values corresponding to multiple pixel categories.
[0041] Step S303: Select the smallest average color value from multiple average color values as the target color value, and determine the liquid surface category from multiple pixel categories based on the target color value.
[0042] Step S304: Integrate the pixel coordinates of all the sub-images of liquid surface corresponding to the liquid surface category to obtain the liquid surface curve coordinates.
[0043] 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, to enhance the stability of local feature recognition, the entire liquid surface image can be divided into several strip regions along the vertical direction, each strip being a sub-image of the liquid surface. The acquisition of sub-images can be achieved through manual selection or automatic segmentation by image processing of the liquid surface image. For details, please refer to... Figure 4Step S301 may include, but is not limited to, steps S401 to S404: Step S401: Acquire an initial image using the first camera. The initial image is an image of the liquid in the pool when it is still.
[0044] Step S402: Obtain the initial pixel color value of each pixel in the initial image, and obtain the reference pixel color value of each pixel in the liquid surface image.
[0045] Step S403: For each pair of pixels with a positional correspondence in the liquid surface image and the initial image, calculate the difference between the initial pixel color value and the reference pixel color value to obtain the color difference value.
[0046] Step S404: Pixels with a color difference value of 0 are identified as positioning pixels, and the liquid surface image is vertically segmented according to the pixel coordinates of the positioning pixels to obtain multiple liquid surface sub-images.
[0047] In step S401 of some embodiments, the initial image refers to an image frame taken when the waves have not yet been generated and the liquid in the pool is completely still. Since the liquid surface is flat and undisturbed at this time, this image can be used as a background reference image for subsequent liquid surface wave detection to capture the area of change in the liquid after the waves are generated. The timing of taking the initial image is usually set before the wave-generating equipment is started, and the image acquisition method is consistent with the method of acquiring the liquid surface image in step S101 to ensure spatial alignment of the images in subsequent processing.
[0048] In step S402 of some embodiments, since the liquid surface image and the initial image have the same resolution and viewing angle, each pixel of the initial image has a corresponding pixel in the liquid surface image. The initial pixel color value refers to the RGB value of a certain pixel in the initial image. The reference pixel color value refers to the RGB value of a certain pixel in the liquid surface image.
[0049] 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 certain location. Since only the liquid undulation area shows significant visual change in the captured video, the pixel color values in the stationary area remain almost unchanged between images. Specifically, for each color channel, the difference between the color value of a pixel at a certain location in the reference image and the color value in the initial image can be calculated, thereby accurately filtering out image areas with wave motion.
[0050] In step S404 of some embodiments, if the color difference value of a certain 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 has not been affected by fluctuations. Such pixels are called positioning pixels.
[0051] Steps S401 to S404, as illustrated in this embodiment, achieve adaptive segmentation of the liquid surface image region based on the difference in color changes between the initial image and the liquid surface image. This improves the intelligence, accuracy, and processing efficiency of the preprocessing stage for liquid surface recognition. The method in this embodiment uses the initial image acquired when the liquid is still as a background reference, and performs pixel-by-pixel comparison with the dynamic liquid surface image to accurately extract the effective regions where color changes occur due to fluctuations. By locating these significantly changing pixels, the active range of wave surface disturbance can be automatically determined, and a spatially close boundary to the wave region can be formed in the image, generating multiple liquid surface sub-images. This improves the targeting of region segmentation and avoids ineffective processing of a large number of irrelevant static regions.
[0052] Please see Figure 5 In some embodiments, step S404 may also include, but is not limited to, steps S501 to S504: Step S501: In the vertical direction, select the maximum value from the pixel coordinates of multiple positioning pixels as the first limit coordinate, and select the minimum value from the pixel coordinates of multiple positioning pixels as the second limit coordinate.
[0053] Step S502: In the horizontal direction, select the maximum value from the pixel coordinates of multiple positioning pixels as the third limiting coordinate, and select the minimum value from the pixel coordinates of multiple positioning pixels as the fourth limiting coordinate.
[0054] Step S503: The liquid surface image is cropped according to the first limit coordinate, the second limit coordinate, the third limit coordinate, and the fourth limit coordinate to obtain the wave area image.
[0055] Step S504: Calculate the mean value based on the third and fourth limit coordinates to determine the pixel sub-intervals. Then, vertically segment the wave region image based on the pixel sub-intervals to obtain multiple liquid surface sub-images.
[0056] In step S501 of some embodiments, the vertical direction refers to the longitudinal axis of the liquid surface image. Based on the image coordinates of all the positioning pixels in the liquid surface image identified in the previous steps, the coordinate distribution range (which can be the y-coordinate) of these positioning pixels in the vertical direction is extracted. The maximum value is selected as the first limiting coordinate, and the minimum value is selected as the second limiting coordinate, to define the boundary of the wave region in the image in the vertical direction. In this embodiment, the origin of the image coordinate system is the lower left corner of the liquid surface image, the positive direction of the y-axis is vertically upward, the first limiting coordinate corresponds to the highest wave peak, and the second limiting coordinate corresponds to the lowest wave trough.
[0057] 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 (which can be the x-coordinate) of these positioning pixels in the horizontal direction 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 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.
[0058] In step S503 of some embodiments, a quadrilateral sub-region 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 cropping region can be slightly larger than the quadrilateral sub-region formed based on the first to fourth limiting coordinates. The image cropping process can be implemented by image processing software or image array cropping operations.
[0059] In step S504 of some embodiments, a fixed number of segmentation segments can be set. The effective pixel length of the wave region image in the horizontal direction, i.e., the total span of the wave region on the horizontal axis of the image, is calculated based on the third and fourth limit coordinates. Subsequently, dividing this pixel length by the preset number of segmentation segments yields the pixel interval width of each liquid surface sub-image in the horizontal direction, i.e., the pixel sub-interval. Based on this pixel sub-interval, the starting and ending pixel coordinates of each segment can be determined sequentially in the horizontal direction, and the corresponding image content is completely preserved in the vertical direction, thereby extracting multiple liquid surface sub-images.
[0060] Steps S501 to S504, as illustrated in this embodiment, identify multiple localized pixels in the image based on color difference changes caused by liquid surface disturbance. The extreme values of these pixels in the horizontal and vertical directions are used as dynamic limiting coordinates to automatically generate bounding boxes for the undulating region, effectively cropping the original image and extracting image regions containing only wave information. Then, based on this wave region image, it is divided into multiple liquid surface sub-images according to a set sub-interval standard, allowing subsequent liquid surface recognition tasks to be completed independently in smaller, more locally consistent image units. This method not only avoids noise interference and imbalance problems caused by full-image clustering but also has strong adaptability, capable of adapting to changes in wave propagation range and image distribution characteristics. Overall, it achieves efficient focusing and structured extraction of the liquid surface disturbance region, laying a high-quality data foundation for subsequent wave height calculation.
[0061] In step S302 of some embodiments, K-Means or other unsupervised clustering algorithms can be used to perform clustering operations using the pixel color value (i.e., RGB value) of each pixel as the feature vector, outputting several pixel sets representing different color features. Pixel category refers to the category of the pixel set after the clustering algorithm. In this embodiment, pixel categories include: liquid surface, air, and water, but are not limited to these. The average color value corresponding to each pixel category is the average of the RGB values of all pixels within the same pixel set. In this embodiment, the K-Means clustering algorithm is used to implement pixel clustering, and the average color value is the cluster center corresponding to each pixel set.
[0062] In step S303 of some embodiments, since the liquid surface curve in the liquid surface sub-image represents a darker boundary formed by the interface between the liquid and air, while the air and liquid are lighter in color, the RGB values of the pixel set corresponding to the liquid surface boundary will be small. Therefore, the pixel set corresponding to the minimum average color value is the pixel set that best matches the characteristics of the liquid surface, and the pixel category corresponding to this pixel set is determined as the liquid surface category. The target color value is the color value with the smallest value among all average color values.
[0063] Please see Figure 6 , Figure 6 This is a schematic diagram of liquid surface curve recognition from a liquid surface sub-image. From top to bottom, the images show the scene of the first camera viewing the liquid surface at near eye level, the scene of the first camera capturing a trough, and the scene of the first camera capturing a peak.
[0064] It should be noted that the method described above for determining the pixel set corresponding to the liquid surface category is more suitable for scenarios where the liquid surface curve tends to be calm and is aligned with the optical axis of the first camera. Since the first camera's viewpoint is close to eye level with the liquid surface, the surface appears as a band, the RGB values are stable, and the pixel distribution has extremely low dispersion, with virtually no interference. However, the first camera views the troughs of the liquid surface from above, so the liquid surface sub-image will capture the three-dimensional liquid surface composition caused by the downward view, as well as water droplets remaining on the pool wall. In the aforementioned steps, these interfering pixels will be clustered into the same pixel set as the pixels corresponding to the liquid surface, thus interfering with the accuracy of liquid surface curve recognition.
[0065] In scenes where the first camera is looking down at the liquid surface, interfering pixels can be removed using the following steps. Please refer to... Figure 7 In some embodiments, step S303 includes, but is not limited to, steps S701 to S703: Step S701: Pixels corresponding to the pixel category of the target color value are selected as candidate pixels, and the dispersion between the target color value and each candidate pixel is calculated to obtain candidate dispersion data.
[0066] Step S702: Filter multiple candidate discrete data to obtain the target discrete data.
[0067] Step S703: Determine the pixel category of the pixel corresponding to the target discrete data as the liquid surface category.
[0068] In step S701 of some embodiments, candidate pixels refer to all pixels in the pixel set whose cluster center is the target color value. Candidate dispersion data is the variance of the distance between each candidate pixel and the target color value. A smaller candidate dispersion value indicates that the pixels in that category are concentrated in the color space, have strong color consistency, and conform to the imaging characteristics of a liquid surface appearing as a boundary band with a dark and stable color in the image. Conversely, a larger dispersion indicates that the category may contain multiple pixels with similar colors but inconsistent physical locations or imaging characteristics, and may include non-liquid surface areas.
[0069] In step S702 of some embodiments, the candidate discrete dataset is filtered to remove pixels that deviate significantly from the target color value, resulting in a set of target discrete data that meets the color consistency standard. Filtering methods may include setting a threshold (e.g., retaining only pixels with a discrete value less than a preset value), statistical distribution analysis (e.g., retaining the top percentile of color-similar pixels), or further refinement using adaptive clustering methods. The purpose of this step is to avoid boundary blurring or color extension effects during color clustering, excluding interfering pixels with similar colors but not belonging to the liquid surface region, thereby ensuring that the final liquid surface category has stronger color consistency and spatial stability.
[0070] In step S703 of some embodiments, the corresponding pixel is determined based on the finally selected target discrete data, and the pixel category corresponding to the pixel is confirmed as the liquid surface category.
[0071] Steps S701 to S703 of this embodiment, compared to methods that rely solely on color depth or brightness values for liquid surface category determination, effectively eliminate interfering pixels with similar colors but not actually belonging to the liquid surface area through discreteness calculation and filtering. Examples include surface reflections, pool edge shadows, and background color interference. Finally, the pixel category of the filtered pixels is determined as the liquid surface category, ensuring that the extracted liquid surface area has high consistency and continuity in color features. This two-layer filtering strategy not only enhances the accuracy of liquid surface category determination but also provides a clear and well-defined pixel foundation for subsequent coordinate extraction of the liquid surface curve.
[0072] When the first camera captures the wave crest, the liquid level at the crest is higher than the camera, meaning the camera is looking upwards at the wave crest. As the liquid level rises, the surface appearance gradually narrows from a band until it disappears. The interfering elements are those below the water surface, viewed from below by the camera. Please refer to [link / reference]. Figure 8 In some embodiments, after step S703, the wavefront information extraction method provided in this application may also include, but is not limited to, steps S801 to S804: Step S801: The pixel corresponding to the liquid surface category is used as the initial liquid surface pixel.
[0073] Step S802: Based on the comparison between the pixel coordinates of each pixel category and the pixel coordinates of the initial liquid surface pixel, the air category and the liquid category are determined from multiple pixel categories.
[0074] Step S803: Extract the target region excluding the initial liquid surface pixels from the liquid surface sub-image based on the pixel coordinates of the initial liquid surface pixels.
[0075] Step S804: For the target area, the pixel at the intersection of the pixel corresponding to the air category and the pixel corresponding to the liquid category is taken as the intermediate pixel, and the pixel category of the intermediate pixel is determined as the liquid surface category.
[0076] In step S801 of some embodiments, the initial liquid surface pixels are the set of pixels corresponding to the liquid surface category selected by filtering through RGB values and pixel dispersion.
[0077] In step S802 of some embodiments, based on the coordinate distribution of each pixel category in the liquid surface sub-image, and in conjunction with the pixel coordinates of the initial liquid surface pixel, a comparison and determination are performed 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 majority of pixels in the current pixel category are located above the initial liquid surface pixel, then the pixel category is determined to be the air category. If the majority of pixels in the current pixel category are located below the initial liquid surface pixel, then the pixel category is determined to be the liquid category. Figure 6 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. The pixels corresponding to the air layer are all higher than the initial liquid surface pixels, so their corresponding pixel category is air. The pixels corresponding to the impurity layer and water layer are all lower than the initial liquid surface pixels, so their corresponding pixel category can be determined as liquid.
[0078] In step S803 of some embodiments, because the peak region lacks a dark boundary, the initial liquid surface pixels obtained by filtering through RGB values and dispersion data cannot cover the entire peak boundary. If the peak region is not processed, the final obtained liquid surface curve will not be a complete line. Figure 6 Taking the original image in the third row as an example, the region in the clustered image from the leftmost point to the first initial liquid surface pixel on the left can be used as the target region.
[0079] In step S804 of some embodiments, the intermediate pixel refers to the pixel located at the boundary between pixels of the air category and pixels of the liquid category.
[0080] Steps S801 to S804 of this embodiment, based on preliminary identification, introduce spatial analysis of the pixel boundary between the air and liquid categories, actively identify the transition pixels between the two categories, and relabel them as the liquid surface category, thereby effectively repairing the lack of liquid surface boundary information. This method is particularly suitable for special scenarios where the liquid surface edge appears blurred, thinned, or even disappears when the first camera is looking up at the wave crest. While maintaining recognition accuracy, it enhances the adaptive processing capability for complex conditions such as rising wave crests and liquid surfaces exceeding the viewing angle, ensuring the spatial coherence and physical continuity of the liquid surface curve, and providing a more stable and reliable image input foundation for subsequent wave height calculation and wave surface modeling.
[0081] 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, in each liquid surface sub-image, all pixels belonging to the liquid surface category are found, their original image coordinates are restored to their corresponding positions in the entire 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.
[0082] Steps S301 to S304, as illustrated in this embodiment, divide the liquid surface image vertically into multiple sub-images. Each sub-image undergoes color clustering within a local area, avoiding clustering errors caused by uneven color distribution across the entire image. This improves the spatial resolution and local accuracy of liquid surface recognition. Finally, by integrating the coordinates of the identified liquid surface pixels from all sub-images, complete and coherent liquid surface curve coordinates can be efficiently recovered, laying a stable and reliable image foundation for subsequent liquid surface height calculation and reference wave height data generation.
[0083] Step S102 further 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 ruler perpendicular to the horizontal plane is set within the shooting range of the first camera. The reference wave height data can be obtained by calculating the liquid surface curve coordinates based on the ratio between the number of pixels in the liquid surface image captured by the first camera and the actual size data. Other methods can also be used to convert the liquid surface curve coordinates from image coordinates to actual size data; this embodiment does not strictly limit the specific implementation method.
[0084] 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. This yields the three-dimensional coordinates of each pixel in the camera coordinate system of the second camera, forming a discrete set of points 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. Their positional relationships only reflect the three-dimensional projection 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, meaning they only have geometric meaning from the current camera's perspective and do not directly reflect the absolute position or height information of each wavefront point in real physical space. It is understood that the second camera can be a monocular camera, a binocular camera, or a depth camera, and is not limited to these.
[0085] In step S104 of some embodiments, since the first and second cameras can be determined at the beginning of the experiment, the position and attitude relationship between the two cameras can be predetermined, thereby calculating the rotation matrix and translation vector between them, and combining the rotation matrix and translation vector to obtain the transformation matrix. The transformation matrix refers to the transformation relationship matrix from the camera coordinate system of the second camera to the camera coordinate system of the first camera. Applying this transformation matrix to each original wavefront point cloud coordinate can transform it from the second camera coordinate system to the first camera coordinate system, and the resulting coordinate point is the basic wavefront point cloud coordinate.
[0086] In step S105 of some embodiments, the detection point requirement information refers to user-preset information about the target location where wave height needs to be calculated. This typically includes one or more spatial points of interest on the wave surface within the pool, and can be set according to experimental setup, analysis requirements, or monitoring strategies. For example, when studying the impact of a reef on water movement, a reef can be placed in the pool. The detection point requirement information could be: "Set up multiple detection points in the wave surface areas corresponding to the water in front of, middle of, and tail of the reef to obtain information about the wave height changes in the wake region after encountering the reef, including flow around the reef, reflection, and wave height variations." Target point cloud coordinates refer to the three-dimensional coordinates of each target detection point selected from the basic wavefront point cloud coordinates based on the detection point requirement information, representing the specific location of the detection point in the wavefront.
[0087] Since the second camera captured the complete wavefront range, both the original wavefront point cloud coordinates and the base wavefront point cloud coordinates after coordinate system transformation obtained from the wavefront image include the liquid surface curve (e.g., Figure 2The reference liquid surface curve point is the spatial point cloud information shown in the red curve. The reference liquid surface curve point refers to a spatial point that corresponds to or is associated with the target detection point in real space and lies on the liquid surface curve. The reference liquid surface curve point is usually located on the same vertical projection line as the target detection point. The reference point cloud coordinates refer to the base wavefront point cloud coordinates corresponding to the reference liquid surface 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 towards the water pool, the positive x-axis is horizontal 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, and the corresponding reference point cloud coordinates are (x1, y1, z1), where x1 = x2.
[0088] In step S106 of some embodiments, please refer to Figure 9 , Figure 9 for Figure 2 The image shows a side view of the hydrodynamic experimental scenario. Target wave height data refers to the actual height of the target detection point, i.e., the distance from the target detection point to the horizontal plane. The calculation process for target wave height data includes the following steps: First, acquire the camera height data of the first camera. Camera height data refers to the vertical distance from the first camera to the horizontal plane. Figure 9 The value is designated as D0. 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 coordinates (x1, y1, z1) relative to the horizontal plane in the real world. Figure 9 The reference point cloud is identified as Dref. Since the coordinates of the liquid surface curve are two-dimensional positions in the image coordinate system, while the coordinates of the reference point cloud are three-dimensional points in the camera coordinate system, the two can be registered in the horizontal direction using their x-coordinates to achieve a coordinate correspondence. In other words, given x1, the corresponding reference wave height data can be directly obtained from the wave height data mapped by the liquid surface curve.
[0089] 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 points 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 ratio of the first distance to the reference point cloud coordinates is calculated to obtain the unit point cloud scale parameter. Since the positive direction of the y-axis is perpendicular to the horizontal plane and downwards, the values of y1 and y2 must be taken as absolute values. The unit point cloud scale parameter refers to the real physical distance corresponding to one unit point cloud coordinate (i.e., one unit in the y-axis direction) in the camera coordinate system of the first camera, usually expressed in meters, representing the scaling ratio from point cloud relative coordinates to world coordinate distance. Then, multiplying the unit point cloud scale parameter by the target point cloud coordinates yields the second distance. The second distance represents the vertical distance of the target detection point from the optical center of the first camera in real space. Finally, the second distance is added to the camera height data to obtain the target wave height data.
[0090] It is understandable that once the unit point cloud scale parameter is determined, there are multiple ways to calculate the target point cloud coordinate y value, and this embodiment does not impose a unique limitation on this.
[0091] Finally, based on the target wave height data, other physical parameters that reflect the wave characteristics at that point can be calculated, such as wavelength, amplitude, period, angular frequency, and phase velocity. Furthermore, through spectral analysis methods such as Fourier transform, the wave's energy spectrum and phase spectrum can be further extracted to reveal its frequency components and coherence characteristics. Based on spatial wavefront variation data, the wave group velocity can be calculated, thus more accurately describing the wave propagation characteristics. In situations involving structures, this method can also be used to analyze the radiated wave field characteristics around the structure. Wavefront information refers to the set of key physical parameters used to describe the wave state at the target detection point; its form can be text description or charts.
[0092] Please see Figure 12 , Figure 12 This is a relative wave height curve of 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 this embodiment. 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 centimeters. Figure 12The horizontal axis represents time (in seconds), and the vertical axis represents relative wave height (in mm). The upper left corner shows a magnified view of the curve peaks between 33.1s and 33.7s. It can be observed that the wave height meter data exhibits peak clipping at the peaks. The wave surface information extraction method provided in this application not only accurately reflects the wave height meter data but also avoids this peak clipping phenomenon. Therefore, this method can verify the accuracy of the wave height meter and eliminate errors caused by the movement of the wave-generating plate.
[0093] Please see Figure 10 This application also provides a wavefront information extraction device that can implement the above-described wavefront information extraction method. The device includes: The first image acquisition module 1001 is used to acquire images of the liquid surface in the pool using a first camera, thereby obtaining a liquid surface image. The liquid surface image includes an image of the liquid surface curve, which is the boundary between the liquid and air within the pool.
[0094] The liquid surface recognition module 1002 is used to recognize the liquid surface in the liquid surface image, obtain the coordinates of the liquid surface curve, and calculate the height of the liquid surface curve coordinates to obtain the reference wave height data of the liquid surface curve.
[0095] The second image acquisition module 1003 is used to acquire images of the wave surface in the pool through the second camera to obtain wave surface images.
[0096] The point cloud coordinate acquisition module 1004 is used to perform point cloud recognition on wavefront images to obtain multiple original wavefront point cloud coordinates.
[0097] The coordinate transformation module 1005 is used to obtain the transformation matrix between the camera coordinate system of the first camera and the camera coordinate system of the second camera, and to perform coordinate system transformation on each of the multiple original wavefront point cloud coordinates according to the transformation matrix to obtain multiple basic wavefront point cloud coordinates.
[0098] The point cloud selection module 1006 is used to select the target point cloud coordinates of the target detection point from multiple basic wavefront point cloud coordinates based on preset detection point requirement information, and to determine the reference liquid surface curve point associated with the target detection point in the liquid surface curve, and to use the basic wavefront point cloud coordinates of the reference liquid surface curve point as the reference point cloud coordinates.
[0099] The wavefront information generation module 1007 is used to perform data calculations based on the target point cloud coordinates, reference point cloud coordinates, and reference wave height data to obtain the target wave height data corresponding to the target detection point, and to generate the wavefront information of the target detection point based on the target wave height data.
[0100] The specific implementation of this wavefront information extraction device is basically the same as the specific implementation of the wavefront information extraction method described above, and will not be repeated here.
[0101] This application also provides an electronic device, which includes a memory and a processor. The memory stores a computer program, and the processor executes the computer program to implement the above-described wavefront information extraction method. This electronic device can be any smart terminal, including tablet computers, in-vehicle computers, etc.
[0102] Please see Figure 11 , Figure 11 The hardware structure of an electronic device according to another embodiment is illustrated. The electronic device includes: The processor 1101 can be implemented using a general-purpose CPU (Central Processing Unit), microprocessor, 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 this application. The memory 1102 can be implemented as a read-only memory (ROM), static storage device, dynamic storage device, or random access memory (RAM). The memory 1102 can store the operating system and other applications. 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 and executed by the processor 1101 using the wavefront information extraction method of the embodiments of this application. Input / output interface 1103 is used to implement information input and output; The communication interface 1104 is used to enable communication and interaction between this device and other devices. Communication can be achieved through wired means (such as USB, network cable, etc.) or wireless means (such as mobile network, WIFI, Bluetooth, etc.). Bus 1105 transmits information between various components of the device (e.g., processor 1101, memory 1102, input / output interface 1103, and communication interface 1104); The processor 1101, memory 1102, input / output interface 1103 and communication interface 1104 are connected to each other within the device via bus 1105.
[0103] This application also provides a computer-readable storage medium storing a computer program that, when executed by a processor, implements the above-described wavefront information extraction method.
[0104] Memory, as a non-transitory computer-readable storage medium, can be used to store non-transitory software programs and non-transitory computer-executable programs. Furthermore, memory may include high-speed random access memory, and may also include non-transitory memory, such as at least one disk storage device, flash memory device, or other non-transitory solid-state storage device. In some embodiments, memory may optionally include memory remotely located relative to the processor, and these remote memories can be connected to the processor via a network. Examples of such networks include, but are not limited to, the Internet, intranets, local area networks, mobile communication networks, and combinations thereof.
[0105] The wavefront information extraction method, device, electronic device, and storage medium provided in this application acquire liquid surface images using a first camera, 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 a calibration benchmark required for wave height measurement. Then, a second camera is introduced to capture images of the wavefront within the pool from above, obtaining multiple original wavefront point cloud coordinates through point cloud recognition, achieving spatial reconstruction of the large-scale, continuous three-dimensional morphology of the wavefront, thus improving the measurement coverage and information dimension. Next, a coordinate transformation matrix is established between the two cameras to convert the original wavefront point cloud coordinates into basic wavefront point cloud coordinates in the camera coordinate system of the first camera, thereby achieving geometric alignment of image data from different perspectives. Then, combined with preset detection point requirement information, target point cloud coordinates are selected from the basic wavefront point cloud coordinates, and a reference liquid surface curve point is determined for that target. The basic wavefront point cloud coordinates of this point are then used as the reference point cloud coordinates to construct the spatial measurement relationship between the target and the reference point. Finally, based on the target point cloud coordinates, reference point cloud coordinates, and reference wave height data, data calculations are performed to obtain the target wave height data and generate wavefront information for the target detection point. This achieves high-precision wave height estimation and visualization output for any position on the wavefront. The method in this embodiment combines image processing and point cloud reconstruction techniques, which not only avoids the high cost problem caused by the dense deployment of traditional sensors but also breaks through the limitations of single-point detection. It can achieve simultaneous acquisition of multi-point wavefront information without increasing the number of hardware components, overcoming the technical limitations of traditional wave height meters in terms of spatial distribution, cost control, and multi-point synchronous measurement. This improves the efficiency of wavefront information acquisition while reducing hardware costs.
[0106] The embodiments described in this application are for the purpose of more clearly illustrating 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. As those skilled in the art will know, with the evolution of technology and the emergence of new application scenarios, the technical solutions provided by the embodiments of this application are also applicable to similar technical problems.
[0107] Those skilled in the art will understand that the technical solutions shown in the figures do not constitute a limitation on the embodiments of this application, and may include more or fewer steps than shown, or combine certain steps, or different steps.
[0108] The device embodiments described above are merely illustrative. The units described as separate components may or may not be physically separate; that is, they may be located in one place or distributed across multiple network units. Some or all of the modules can be selected to achieve the purpose of this embodiment according to actual needs.
[0109] Those skilled in the art will understand that all or some of the steps in the methods disclosed above, as well as the functional modules / units in the systems and devices, can be implemented as software, firmware, hardware, or suitable combinations thereof.
[0110] The terms “first,” “second,” “third,” “fourth,” etc. (if present) in the specification and accompanying drawings of this application are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It should be understood that such data can be interchanged where appropriate so that the embodiments of this application described herein can be implemented in orders other than those illustrated or described herein. Furthermore, the terms “comprising” and “having,” and any variations thereof, are intended to cover non-exclusive inclusion; for example, a process, method, system, product, or apparatus that comprises a series of steps or units is not necessarily limited to those steps or units explicitly listed, but may include other steps or units not explicitly listed or inherent to such processes, methods, products, or apparatus.
[0111] It should be understood that in this application, "at least one (item)" means one or more, and "more than" means two or more. "And / or" is used to describe the relationship between related objects, indicating that three relationships can exist. For example, "A and / or B" can represent three cases: only A exists, only B exists, and both A and B exist simultaneously, where A and B can be singular or plural. The character " / " generally indicates that the preceding and following related objects are in an "or" relationship. "At least one (item) of the following" or similar expressions refer to any combination of these items, including any combination of single or plural items. For example, at least one (item) of a, b, or c can represent: a, b, c, "a and b", "a and c", "b and c", or "a and b and c", where a, b, and c can be single or multiple.
[0112] In the several embodiments provided in this application, it should be understood that the disclosed apparatus and methods can be implemented in other ways. For example, the apparatus embodiments described above are merely illustrative; for instance, the division of the units described above is only a logical functional division, and in actual implementation, there may be other division methods. For example, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed. Furthermore, the coupling or direct coupling or communication connection shown or discussed may be through some interfaces; the indirect coupling or communication connection between apparatuses or units may be electrical, mechanical, or other forms.
[0113] The units described above as separate components may or may not be physically separate. 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 the units can be selected to achieve the purpose of this embodiment according to actual needs.
[0114] Furthermore, the functional units in the various embodiments of this application can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The integrated unit can be implemented in hardware or as a software functional unit.
[0115] If the integrated unit is implemented as 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 this application, in essence, 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. This computer software product is stored in a storage medium and includes multiple instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods of the various embodiments of this application. The aforementioned storage medium includes various media capable of storing programs, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.
[0116] The preferred embodiments of the present application have been described above with reference to the accompanying drawings, but this does not limit the scope of the claims of the present application. Any modifications, equivalent substitutions, and improvements made by those skilled in the art without departing from the scope and substance of the embodiments of the present application shall be within the scope of the claims of the present application.
Claims
1. A method for extracting wavefront information, characterized in that, A camera module for acquiring images of a water tank, the camera module comprising a first camera and a second camera, the method comprising: The first camera captures an image of the liquid surface in the pool, which is a liquid surface image. The liquid surface image includes an image of the liquid surface curve, which is the boundary line between the liquid and the air in the pool. The first camera is placed horizontally with its optical axis parallel to the horizontal plane. The liquid surface image is subjected to liquid surface recognition to obtain liquid surface curve coordinates, and the height of the liquid surface curve coordinates is calculated to obtain reference wave height data of the liquid surface curve; The second camera captures images of the wave surface in the pool, and performs point cloud recognition on the wave surface images to obtain multiple original wave surface point cloud coordinates; wherein, the second camera is arranged at a top-down angle, and the shooting range covers the entire wave surface in the pool. Obtain the transformation matrix between the camera coordinate system of the first camera and the camera coordinate system of the second camera, and perform coordinate system transformation on each of the multiple original wavefront point cloud coordinates according to the transformation matrix to obtain multiple basic wavefront point cloud coordinates; Based on the preset detection point requirement information, the target point cloud coordinates of the target detection point are selected from multiple basic wavefront point cloud coordinates, and a reference liquid surface curve point associated with the target detection point is determined in the liquid surface curve, and the basic wavefront point cloud coordinates of the reference liquid surface curve point are used as the reference point cloud coordinates. Data calculations are performed 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 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 step of performing liquid surface recognition on the liquid surface image to obtain the liquid surface curve coordinates includes: The liquid surface image is divided vertically to obtain multiple liquid surface sub-images; For each of the liquid surface sub-images, the pixels of the liquid surface sub-images are clustered according to the pixel color values of the liquid surface sub-images to obtain the average color values corresponding to multiple pixel categories; The minimum average color value is selected from the plurality of average color values as the target color value, and the liquid surface category is determined from the plurality of pixel categories based on the target color value; The pixel coordinates of all the pixels in the liquid surface sub-images corresponding to the liquid surface category are integrated to obtain the liquid surface curve coordinates.
3. The method according to claim 2, characterized in that, Determining the liquid surface category from multiple pixel categories based on the target color value includes: Pixels corresponding to the pixel category of the target color value are selected as candidate pixels, and the dispersion between the target color value and each candidate pixel is calculated to obtain candidate dispersion data. Data filtering is performed on multiple candidate discrete data to obtain target discrete data; The pixel category of the pixel corresponding to the target discrete data is determined as the liquid surface category.
4. The method according to claim 3, characterized in that, After determining the pixel category of the pixel corresponding to the target discrete data as the liquid surface category, the method further includes: The pixel corresponding to the liquid surface category is used as the initial liquid surface pixel; By comparing the pixel coordinates of each pixel category with the pixel coordinates of the initial liquid surface pixel, the air category and the liquid category are determined from the multiple pixel categories; Based on the pixel coordinates of the initial liquid surface pixel, extract the target region excluding the initial liquid surface pixel from the liquid surface sub-image; For the target area, the pixel at the intersection of the pixel corresponding to the air category and the pixel corresponding to the liquid category is taken as the intermediate pixel, and the pixel category of the intermediate pixel is determined as the liquid surface category.
5. The method according to claim 2, characterized in that, The image of the liquid surface is divided vertically to obtain multiple sub-images of the liquid surface, including: An initial image is acquired by the first camera, and the initial image is an image of the liquid in the pool when it is still. Obtain the initial pixel color value of each pixel in the initial image, and obtain the 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 with a positional correspondence in the liquid surface image and the initial image, the difference between the color value of the initial pixel and the color value of the reference pixel is calculated to obtain a color difference value; The pixels with a color difference value of 0 are identified as positioning pixels, and the liquid surface image is segmented in the vertical direction according to the pixel coordinates of the positioning pixels to obtain multiple liquid surface sub-images.
6. The method according to claim 5, characterized in that, The step of segmenting the liquid surface image vertically based on the pixel coordinates of the positioned pixels to obtain multiple liquid surface sub-images includes: In the vertical direction, the maximum value is selected from the pixel coordinates of the plurality of positioning pixels as the first limiting coordinate, and the minimum value is selected from the pixel coordinates of the plurality of positioning pixels as the second limiting coordinate. In the horizontal direction, the maximum value is selected from the pixel coordinates of the plurality of positioning pixels as the third limiting coordinate, and the minimum value is selected from the pixel coordinates of the plurality of positioning pixels as the fourth limiting coordinate; wherein, the horizontal direction is perpendicular to the vertical direction; The liquid surface image is cropped based on the first limiting coordinate, the second limiting coordinate, the third limiting coordinate, and the fourth limiting coordinate to obtain a wave region image; The mean value is calculated based on the third and fourth limit coordinates to determine the pixel sub-intervals. The wave region image is then segmented vertically based on the pixel sub-intervals to obtain multiple liquid surface sub-images.
7. The method according to any one of claims 1 to 6, characterized in that, The step of calculating the target wave height data corresponding to the target detection point based on the target point cloud coordinates, the reference point cloud coordinates, and the reference wave height data includes: Obtain the camera height data of the first camera; The first distance is obtained by calculating the difference between the reference wave height data and the camera height data; The ratio between the first distance and the reference point cloud coordinates is calculated to obtain the unit point cloud ratio parameter. The second distance is obtained 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, A camera module for acquiring images of a water tank, the camera module comprising a first camera and a second camera, the device comprising: The first image acquisition module is used to acquire an image of the liquid surface of the pool through the first camera to obtain a liquid surface image; wherein, the liquid surface image includes an image of the liquid surface curve, the liquid surface curve being the boundary line between the liquid and the air in the pool, and the first camera is placed horizontally with its optical axis parallel to the horizontal plane. The liquid surface recognition module is used to recognize the liquid surface in the liquid surface image, obtain the liquid surface curve coordinates, and calculate the height of the liquid surface curve coordinates to obtain the reference wave height data of the liquid surface curve. The second image acquisition module is used to acquire images of the wave surface in the pool through the second camera to obtain a wave surface image; wherein the second camera is arranged at a top-down angle and the shooting range covers the entire wave surface in the pool. The point cloud coordinate acquisition module is used to perform point cloud recognition on the wavefront image to obtain multiple original wavefront point cloud coordinates; The coordinate transformation module is used to obtain the transformation matrix between the camera coordinate system of the first camera and the camera coordinate system of the second camera, and to perform coordinate system transformation on each of the multiple original wavefront point cloud coordinates according to the transformation matrix to obtain multiple basic wavefront point cloud coordinates. The point cloud selection module is used to select the target point cloud coordinates of the target detection point from multiple base wavefront point cloud coordinates based on preset detection point requirement information, and to determine a reference liquid surface curve point associated with the target detection point in the liquid surface curve, and to use the base wavefront point cloud coordinates of the reference liquid surface curve point as the reference point cloud coordinates. The wavefront information generation module is used to perform data calculations 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, and to generate 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 storing a computer program, and the processor executing the computer program to implement the method according to any one of claims 1 to 7.
10. A computer-readable storage medium storing a computer program, characterized in that, When the computer program is executed by a processor, it implements the method of any one of claims 1 to 7.
Citation Information
Patent Citations
Method for measuring height of wave surface of wave on deck
CN117146783A
Volume measurement method and apparatus and computer readable storage medium
WO2023097913A1