Sea wave height prediction method and device, storage medium and computer program product
The method enhances sea wave height prediction accuracy by using image processing and Fourier transform analysis to improve data coverage and precision in wave forecasting.
Patent Information
- Application Number
- CN202510314592.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-03-17
- Publication Date
- 2025-07-15
AI Technical Summary
The traditional wave height monitoring method relies on fixed-position measurement equipment, resulting in insufficient data coverage for the vast ocean area and low prediction accuracy.
The wave image is extracted through image processing technology, combined with Fourier transform to analyze wave features, and predict wave heights using prediction models, including denoising processing, edge detection, texture analysis and long-term and short-term memory network applications.
It improves the accuracy of wave height prediction, can accurately predict wave conditions in a vast ocean area, and activates the alarm device when necessary to ensure safe response.
Smart Images

Figure CN120318293A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of ocean engineering, and more particularly, to a method and apparatus for predicting wave height, a storage medium, and a computer program product. Background Art
[0002] Traditional wave height monitoring systems mainly rely on fixed-position measurement devices, such as buoys, radars, or pressure sensors, etc., to obtain wave height data. However, fixed-position monitoring devices can only provide wave information in a limited area around them. For vast sea areas, the data coverage is insufficient, which easily leads to the problem of low prediction accuracy.
[0003] In view of the problem in the related art that the traditional wave height monitoring method easily leads to low prediction accuracy, no effective solution has been proposed yet.
[0004] Therefore, it is necessary to improve the related technology to overcome the above-mentioned defects in the related technology. Summary of the Invention
[0005] Embodiments of the present application provide a method and apparatus for predicting wave height, a storage medium, and a computer program product, so as to at least solve the problem in the related technology that the traditional wave height monitoring method easily leads to low prediction accuracy.
[0006] According to an aspect of the embodiments of the present application, a method for predicting wave height is provided, including: extracting features of a first wave image within a target time period through image processing technology to obtain first wave features, where the target time period is a period of time before the current time; performing waveform analysis on the first wave features through Fourier transform to determine second wave features of the first wave features in the frequency domain; inputting the second wave features into a prediction model for processing to predict the wave height at a target time, where the target time is a time after the current time.
[0007] In an exemplary embodiment, before extracting features of the first wave image within the target time period through image processing technology to obtain first wave features, the method further includes: acquiring the first wave image within the target time period, and performing denoising processing on the first wave image to obtain a second wave image; determining the target pixel value f new (x,y), where w(i,j) is the weight function of the Gaussian filter, m is the radius of the Gaussian filter, and f(x+i,y+j) is the initial pixel value of the first wave image.
[0008] In an exemplary embodiment, feature extraction is performed on the first sea wave image within a target time period through image processing technology to obtain first sea wave features, including: determining the wave crests and wave troughs of the sea waves in the second sea wave image through an edge detection algorithm, and extracting the texture features of the sea waves in the second sea wave image through a texture analysis algorithm; determining the amplitude of the sea waves according to the distance between the wave crests and the wave troughs; and determining the wave crests, the wave troughs, the texture features, and the amplitude as the first sea wave features.
[0009] In an exemplary embodiment, waveform analysis is performed on the first sea wave features through Fourier transform to determine second sea wave features of the first sea wave features in the frequency domain, including: determining the second sea wave feature F(k) according to the following Fourier transform formula: where f(t) is the first sea wave feature and k is the frequency variable.
[0010] In an exemplary embodiment, the second sea wave features are input into a prediction model for processing to predict the sea wave height at a target time, including: determining the sea wave height h according to the following formula t : i t =σ(W i ·[h t-1 , x t +b i ); f t =σ(W f ·[h t-1 , x t +b f ); o t =σ(W o ·[h t-1 , x t +b o ); C t =f t ·C t-1 +i t ·tanh(W C ·[h t-1 , x t +b C ); h t =o t ·tanh(C t ), where i t is the activation value of the input gate in the prediction model, f t is the activation value of the forget gate in the prediction model, o t is the activation value of the output gate in the prediction model, C t is the cell state in the prediction model, and W i is the weight matrix corresponding to the input gate, Wf is the weight matrix corresponding to the forget gate, W o is the weight matrix corresponding to the output gate, W C is the weight matrix corresponding to the cell state, b i is used to adjust the activation value of the input gate, b f is used to adjust the activation value of the forget gate, b o is used to adjust the activation value of the output gate, b C is used to adjust the activation value of the cell state, h t-1 is the output of the prediction model at the previous time, x t is the input of the prediction model at the current time, and the previous time is a period of time before the current time.
[0011] In an exemplary embodiment, after the second sea wave feature is input into the prediction model for processing to predict the sea wave height at the target time, the method further includes: continuously monitoring the sea wave height when the sea wave height is less than a preset value; starting an alarm device when the sea wave height is greater than or equal to the preset value, where the alarm device is used to remind the target object to initiate an emergency response.
[0012] According to another aspect of the embodiments of the present application, there is also provided a prediction device for sea wave height, including: an extraction module, configured to extract features from a first sea wave image within a target time period through image processing technology to obtain a first sea wave feature, where the target time period is a period of time before the current time; an analysis module, configured to perform waveform analysis on the first sea wave feature through Fourier transform to determine a second sea wave feature of the first sea wave feature in the frequency domain; a prediction module, configured to input the second sea wave feature into a prediction model for processing to predict the sea wave height at the target time, where the target time is a time after the current time.
[0013] According to yet another aspect of the embodiments of the present application, there is also provided a computer-readable storage medium, in which a computer program is stored, where the computer program is configured to execute the above-mentioned prediction method for sea wave height when running.
[0014] According to yet another aspect of the embodiments of the present application, there is also provided an electronic device, including a memory, a processor, and a computer program stored on the memory and executable on the processor, where the above-mentioned processor executes the above-mentioned prediction method for sea wave height through the computer program.
[0015] According to yet another aspect of the embodiments of the present application, there is also provided a computer program product, including a computer program, where the steps of the methods described in the various embodiments of the present application are implemented when the computer program is executed by a processor.
[0016] Through this application, feature extraction is performed on the first sea wave image within a target time period through image processing technology to obtain the first sea wave feature, where the target time period is a period of time before the current time; waveform analysis is performed on the first sea wave feature through Fourier transform to determine the second sea wave feature of the first sea wave feature in the frequency domain; the second sea wave feature is input into a prediction model for processing to predict the sea wave height at the target time, where the target time is a time after the current time. Thus, the problem that the traditional sea wave height monitoring method in the related art is prone to low prediction accuracy is solved. BRIEF DESCRIPTION OF THE DRAWINGS
[0017] The accompanying drawings here are incorporated into the specification and form a part of this specification, showing embodiments consistent with this application, and are used together with the specification to explain the principles of this application.
[0018] In order to more clearly illustrate the technical solutions in the embodiments of this application or the prior art, the following will briefly introduce the accompanying drawings required for use in the description of the embodiments or the prior art. Obviously, for those of ordinary skill in the art, without creative efforts, other drawings can also be obtained based on these drawings.
[0019] Figure 1 is a hardware structure block diagram of a computer terminal for a method of predicting sea wave height according to an embodiment of this application;
[0020] Figure 2 is a flowchart of a method of predicting sea wave height according to an embodiment of this application;
[0021] Figure 3 is a structure block diagram of a device for predicting sea wave height according to an embodiment of this application. DETAILED DESCRIPTION OF THE EMBODIMENTS
[0022] In order to enable those skilled in the art of this technology to better understand the solutions of this application, the following will clearly and completely describe the technical solutions in the embodiments of this application with reference to the accompanying drawings in the embodiments of this application. Obviously, the described embodiments are only a part of the embodiments of this application, rather than all the embodiments. Based on the embodiments in this application, all other embodiments obtained by those of ordinary skill in the art without creative efforts shall fall within the scope of protection of this application.
[0023] It should be noted that the terms "first", "second", etc. in the description, claims and above-mentioned drawings of this application are used to distinguish similar objects, and do not necessarily describe a specific order or sequence. It should be understood that the data used in this way can be interchanged under appropriate circumstances, so that the embodiments of this application described here can be implemented in an order other than those illustrated or described here. In addition, the terms "comprising" and "having" and any variations thereof are intended to cover non-exclusive inclusion. For example, a process, method, system, product or device comprising a series of steps or units does not necessarily have to be limited to those steps or units clearly listed, but may include other steps or units not clearly listed or inherent to these processes, methods, products or devices.
[0024] The method embodiments provided in the embodiments of this application can be executed on a computer terminal or a similar computing device. Taking the operation on a computer terminal as an example, Figure 1 is a hardware structure block diagram of a computer terminal for a method of predicting sea wave height according to an embodiment of this application. As Figure 1 shown, the computer terminal may include one or more ( Figure 1 only one is shown in the figure) processors 102 (the processor 102 may include, but is not limited to, a processing device such as a microprocessor (Central Processing Unit, MCU) or a field programmable gate array (Field Programmable Gate Array, FPGA)), and a memory 104 for storing data. Among them, the above computer terminal may further include a transmission device 106 for communication functions and an input / output device 108. Those of ordinary skill in the art can understand that Figure 1 the structure shown is only schematic and does not limit the structure of the above computer terminal. For example, the computer terminal may further include more or fewer components than those shown in Figure 1 the figure, or have a different configuration from that shown in Figure 1 the figure.
[0025] The memory 104 can be used to store computer programs, for example, software programs and modules of application software, such as the computer program corresponding to the method of predicting sea wave height in the embodiments of this application. The processor 102 executes various functional applications and data processing by running the computer program stored in the memory 104, that is, implements the above method. The memory 104 may include a high-speed random access memory, and may also include a non-volatile memory, such as one or more magnetic storage devices, flash memories, or other non-volatile solid state memories. In some instances, the memory 104 may further include a memory remotely provided with respect to the processor 102, and these remote memories can be connected to the computer terminal through a network. Examples of the above network include, but are not limited to, the Internet, an enterprise intranet, a local area network, a mobile communication network, and combinations thereof.
[0026] The wireless network provided by the communication provider of the computer terminal. In one example, the transmission device 106 includes a network adapter (Network Interface Controller, abbreviated as NIC), which can be connected to other network devices through a base station and thus communicate with the Internet. In one example, the transmission device 106 can be a Radio Frequency (RF) module, which is used to communicate with the Internet wirelessly.
[0027] In this embodiment, a method for predicting the sea wave height is provided, which is applied to the above computer terminal. Figure 2 It is a flowchart of a method for predicting the sea wave height according to an embodiment of the present application, as Figure 2 shown, and the process includes the following steps:
[0028] Step S202, extracting features from the first sea wave image within the target time period through image processing technology to obtain the first sea wave feature, where the target time period is a period of time before the current time;
[0029] Step S204, performing waveform analysis on the first sea wave feature through Fourier transform to determine the second sea wave feature of the first sea wave feature in the frequency domain;
[0030] Step S206, inputting the second sea wave feature into a prediction model for processing to predict the sea wave height at the target time, where the target time is a time after the current time.
[0031] Through the above steps, extracting features from the first sea wave image within the target time period through image processing technology to obtain the first sea wave feature, where the target time period is a period of time before the current time; performing waveform analysis on the first sea wave feature through Fourier transform to determine the second sea wave feature of the first sea wave feature in the frequency domain; inputting the second sea wave feature into a prediction model for processing to predict the sea wave height at the target time, where the target time is a time after the current time. Thus, the problem that the traditional sea wave height monitoring method in the related technology is prone to low prediction accuracy is solved.
[0032] In an exemplary embodiment, before extracting features from the first sea wave image within the target time period through image processing technology to obtain the first sea wave feature, the method further includes: acquiring the first sea wave image within the target time period, and performing denoising processing on the first sea wave image to obtain a second sea wave image; determining the target pixel value f new (x,y) Wherein, w(i,j) is the weight function of the Gaussian filter, m is the radius of the Gaussian filter, and f(x+i,y+j) is the initial pixel value of the first sea wave image.
[0033] Determine the radius m of the Gaussian filter as needed, and then calculate the corresponding weight function w(i,j) of the Gaussian filter. w(i,j) is a two-dimensional matrix, where the value of each element is calculated from the Gaussian distribution, and the value at the center position is the largest, and the value gradually decreases away from the center. For each pixel point (x,y) in the first sea wave image, the Gaussian filter multiplies all the pixel values f(x+i,y+j) in its neighborhood by their corresponding weights w(i,j), and then sums them up. Specifically, the filter slides on the image, performs a convolution operation on each pixel point, and calculates the new pixel value f new (x,y). This process can be understood as smoothing the image, where the values of neighboring pixels have a greater impact on the center pixel value, while the pixel values at a greater distance have a smaller impact. After the above processing, the new values f new (x,y) together constitute the second sea wave image. The second sea wave image will appear smoother visually, random noise and spiky changes in pixel points are suppressed, making the sea wave features in the image clearer and facilitating subsequent feature extraction and analysis.
[0034] In an exemplary embodiment, feature extraction is performed on the first sea wave image in a target time period through image processing techniques to obtain first sea wave features, including: determining the wave peaks and wave troughs of the sea waves in the second sea wave image through an edge detection algorithm, and extracting the texture features of the sea waves in the second sea wave image through a texture analysis algorithm; determining the amplitude of the sea waves according to the distance between the wave peaks and the wave troughs; and determining the wave peaks, the wave troughs, the texture features, and the amplitude as the first sea wave features.
[0035] Optionally, the gradient of the second sea wave image is calculated through Canny edge detection. The gradient calculation can determine the direction and magnitude of the intensity change of each pixel in the image, that is, the local brightness change rate of the image. In the sea wave image, the areas corresponding to the wave crests and troughs usually have large brightness changes (i.e., high contrast), so their gradient values will also be relatively high. In the image after gradient calculation, each pixel may be regarded as a potential edge point, but many are caused by noise or discontinuous brightness changes. Therefore, non-maximum suppression and double-threshold techniques are needed to determine the true edges. Among them, the Canny algorithm can effectively highlight the edges corresponding to the wave crests and troughs in the second sea wave image, forming a clear and coherent edge contour. Since the wave crests and troughs are the places where the edges are most obvious in the sea wave image, these prominent edges correspond to the positions of the wave crests and troughs, thus realizing their positioning. After determining the positions of the wave crests and troughs, the amplitude can be calculated by measuring the vertical distance between the wave crest and the trough, or in the grayscale image, estimated by the difference in grayscale values between the wave crest and the trough. At the same time, the texture features of the sea waves in the second sea wave image, such as the size, shape, and direction of the ripples, are extracted through a texture analysis algorithm (such as the gray-level co-occurrence matrix). Combining the wave crest and trough information obtained from edge detection, the texture features extracted by texture analysis, and the calculated amplitude, a multi-dimensional feature vector containing the sea wave amplitude, wave crest and trough positions, and texture features is formed, that is, the first sea wave feature.
[0036] In an exemplary embodiment, waveform analysis is performed on the first sea wave feature through Fourier transform to determine the second sea wave feature of the first sea wave feature in the frequency domain, including: determining the second sea wave feature F(k) according to the following Fourier transform formula: where f(t) is the first sea wave feature and k is the frequency variable.
[0037] Wave extraction is performed on the sea wave signal through Fourier transform to obtain the wave frequency, amplitude, and phase information corresponding to various different frequencies. The signal F(k) in the frequency domain can be used to analyze the periodicity, frequency distribution, and energy distribution of the sea waves. For example, the frequency components with higher amplitudes in the frequency domain may correspond to the main waves, while the components with lower amplitudes may correspond to the secondary fluctuations or noise of the waves. In practical applications, since the sea wave features in remote sensing images exist in a spatial form, the Fourier transform in the spatial domain is usually applied to analyze the periodicity and directionality of the sea waves. By converting the sea wave features from the spatial domain to the frequency domain, the wave patterns and characteristics of the sea waves can be more effectively identified and analyzed.
[0038] In an exemplary embodiment, the second sea wave feature is input into a prediction model for processing to predict the sea wave height at the target time, including: determining the sea wave height h according to the following formula t : it = σ(W i · [h t-1 , x t + b i ); f t = σ(W f · [h t-1 , x t + b f ); o t = σ(W o · [h t-1 , x t + b o ); C t = f t · C t-1 + i t · tanh(W C · [h t-1 , x t + b C ); h t = o t · tanh(C t ), where i t is the activation value of the input gate in the prediction model, f t is the activation value of the forget gate in the prediction model, o t is the activation value of the output gate in the prediction model, C t is the cell state in the prediction model, W i is the weight matrix corresponding to the input gate, W f is the weight matrix corresponding to the forget gate, W o is the weight matrix corresponding to the output gate, W C is the weight matrix corresponding to the cell state, b i is used to adjust the activation value of the input gate, b f is used to adjust the activation value of the forget gate, b o is used to adjust the activation value of the output gate, b C is used to adjust the activation value of the cell state, h t-1 is the output of the prediction model at the previous time, x t is the input of the prediction model at the current time, and the previous time is a period of time before the current time.
[0039] Optionally, the wave height at the target time is predicted by a long short-term memory network. In the formula i t = σ(W i · [h t-1 , x t + b i ), the activation value i tFrom the hidden state h at the previous time t-1 and the input data x at the current time t After multiplying by the matrix W i and adding the bias b i it is obtained after being activated by the Sigmoid function σ. The Sigmoid function maps the input value to the range of 0 to 1, and i t Controls the amount of new information written into the cell state C t In the formula f t =σ(W f ·[h t-1 ,x t +b f ), the activation value f of the forget gate t is also obtained by multiplying h t-1 and x t by the matrix W f and adding the bias b f and then being activated by the Sigmoid function. f t Determines how much historical information should be forgotten from the cell state. A value of f t close to 1 means most of the historical information is retained, and close to 0 means most of the information will be forgotten. In the formula o t =σ(W o ·[h t-1 ,x t +b o ), o t Determines the contribution ratio of the cell state C t in the current time output h t . In the formula C t =f t ·C t-1 +i t ·tanh(W C ·[h t-1 ,x t +b C ), the cell state C t is jointly determined by the outputs of the forget gate and the input gate. On the one hand, by multiplying f t and the cell state C t-1 from the previous step, it determines how much historical information to retain; on the other hand, i t is multiplied by the result activated by the hyperbolic tangent function tanh to determine the amount of new information written. The tanh function maps the input value to the range of -1 to 1, which helps to maintain the numerical stability of the cell state. The final output h t is jointly determined by the activation value o t of the output gate and the hyperbolic tangent value of the current cell state C t . h tIt will be the output of the current time step and be passed to the input gate and forget gate of the next time step, so that the long short-term memory network can remember the long-term dependencies in the time series.
[0040] In an exemplary embodiment, after inputting the second sea wave feature into a prediction model for processing to predict the sea wave height at a target time, the method further includes: continuously monitoring the sea wave height when the sea wave height is less than a preset value; and activating an alarm device when the sea wave height is greater than or equal to the preset value, where the alarm device is used to remind a target object to initiate an emergency response.
[0041] When the monitored sea wave height is less than a preset value (for example, less than 3 meters), the system will continuously monitor the sea wave state and record data for subsequent analysis. In this case, the sea wave conditions are considered to be within the safe range and the alarm will not be immediately activated. When the monitored sea wave height reaches or exceeds the preset value (for example, equal to or greater than 3 meters), the system will be triggered into a warning state. It will activate the alarm device, which can be a visual or auditory alarm, or automatically send an alarm message to the handheld device or monitoring center of the operator. The alarm message usually includes the current sea wave height, the expected future change trend, and the possible impact range. After receiving the alarm, the operator or the monitoring center will immediately initiate an emergency response procedure including but not limited to: stopping or decelerating the operation of the wind farm to prevent equipment damage; sending an evacuation instruction to the offshore operation personnel to ensure personnel safety; adjusting the maintenance plan of the wind farm to avoid operating under high-risk conditions; and notifying relevant agencies of the early warning information about the sea conditions so that they can take corresponding measures.
[0042] Through the description of the above embodiments, those skilled in the art can clearly understand that the method according to the above embodiments can be implemented by means of software plus a necessary general hardware platform. Of course, it can also be implemented by hardware, but in many cases the former is a better implementation method. Based on such an understanding, the technical solution of the present application, in essence, or the part that contributes to the prior art, can be embodied in the form of a software product. The computer software product is stored in a storage medium (such as ROM / RAM, magnetic disk, optical disc) and includes several instructions for causing a terminal device (which can be a mobile phone, computer, server, or network device, etc.) to execute the methods of the various embodiments of the present application.
[0043] In this embodiment, a prediction device for the sea wave height is also provided. The device is used to implement the above embodiments and preferred implementation manners, and those that have been described will not be repeated. As used hereinafter, the term "module" can be a combination of software and / or hardware that can achieve a predetermined function. Although the devices described in the following embodiments are preferably implemented in software, implementation in hardware, or a combination of software and hardware is also possible and contemplated.
[0044] Figure 3 It is a structural block diagram of a device for predicting sea wave height according to an embodiment of the present application. The device includes:
[0045] An extraction module 30, configured to extract features of a first sea wave image within a target time period through image processing technology to obtain first sea wave features, where the target time period is a period of time before the current time;
[0046] An analysis module 32, configured to perform waveform analysis on the first sea wave features through Fourier transform to determine second sea wave features of the first sea wave features in the frequency domain;
[0047] A prediction module 34, configured to input the second sea wave features into a prediction model for processing to predict the sea wave height at a target time, where the target time is a time after the current time.
[0048] Through the above device, features of a first sea wave image within a target time period are extracted through image processing technology to obtain first sea wave features, where the target time period is a period of time before the current time; waveform analysis is performed on the first sea wave features through Fourier transform to determine second sea wave features of the first sea wave features in the frequency domain; the second sea wave features are input into a prediction model for processing to predict the sea wave height at a target time, where the target time is a time after the current time. Thus, the problem that the traditional sea wave height monitoring method in the related art is prone to low prediction accuracy is solved.
[0049] In an exemplary embodiment, the extraction module 30 is further configured to obtain the first sea wave image within the target time period, and perform denoising processing on the first sea wave image to obtain a second sea wave image; determine the target pixel value f new (x, y) of the second sea wave image through the following Gaussian filtering formula, where w(i, j) is the weight function of the Gaussian filter, m is the radius of the Gaussian filter, and f(x + i, y + j) is the initial pixel value of the first sea wave image.
[0050] In an exemplary embodiment, the extraction module 30 is further configured to determine the wave crests and wave troughs of the sea waves in the second sea wave image through an edge detection algorithm, and extract the texture features of the sea waves in the second sea wave image through a texture analysis algorithm; determine the amplitude of the sea waves according to the distance between the wave crests and the wave troughs; determine the wave crests, the wave troughs, the texture features, and the amplitude as the first sea wave features.
[0051] In an exemplary embodiment, the analysis module 32 is further configured to determine the second ocean wave feature F(k) according to the following Fourier transform formula: where f(t) is the first ocean wave feature and k is the frequency variable.
[0052] In an exemplary embodiment, the prediction module 34 is further configured to determine the ocean wave height h according to the following formula t : i t = σ(W i ·[h t-1 ,x t +b i ); f t = σ(W f ·[h t-1 ,x t +b f ); o t = σ(W o ·[h t-1 ,x t +b o ); C t = f t ·C t-1 + i t ·tanh(W C ·[h t-1 ,x t +b C ); h t = o t ·tanh(C t ), where i t is the activation value of the input gate in the prediction model, f t is the activation value of the forget gate in the prediction model, o t is the activation value of the output gate in the prediction model, C t is the cell state in the prediction model, W i is the weight matrix corresponding to the input gate, W f is the weight matrix corresponding to the forget gate, W o is the weight matrix corresponding to the output gate, W C is the weight matrix corresponding to the cell state, b i is used to adjust the activation value of the input gate, b f is used to adjust the activation value of the forget gate, b o is used to adjust the activation value of the output gate, b C is used to adjust the activation value of the cell state, h t-1 is the output of the prediction model at the previous time, x tis the input of the prediction model at the current time, and the previous time is a period of time before the current time.
[0053] In an exemplary embodiment, the prediction module 34 is further configured to continuously monitor the sea wave height when the sea wave height is less than a preset value; and activate an alarm device when the sea wave height is greater than or equal to the preset value, where the alarm device is used to remind the target object to initiate an emergency response.
[0054] An embodiment of the present application further provides a computer-readable storage medium, in which a computer program is stored, and the computer program is configured to execute the steps in any one of the above method embodiments when running.
[0055] Optionally, in this embodiment, the above storage medium may be configured to store a computer program for executing the following steps:
[0056] S1, extract features from the first sea wave image within a target time period through image processing technology to obtain first sea wave features, where the target time period is a period of time before the current time;
[0057] S2, perform waveform analysis on the first sea wave features through Fourier transform to determine second sea wave features of the first sea wave features in the frequency domain;
[0058] S3, input the second sea wave features into the prediction model for processing to predict the sea wave height at the target time, where the target time is the time after the current time.
[0059] In an exemplary embodiment, the above computer-readable storage medium may include, but is not limited to: various media such as USB flash drives, read-only memories (ROM), random access memories (RAM), mobile hard disks, magnetic disks, or optical discs that can store computer programs.
[0060] The specific examples in this embodiment may refer to the examples described in the above embodiments and exemplary embodiments, and will not be repeated here.
[0061] An embodiment of the present application further provides an electronic device, including a memory and a processor, where a computer program is stored in the memory, and the processor is configured to run the computer program to execute the steps in any one of the above method embodiments.
[0062] Optionally, in this embodiment, the above processor may be configured to execute the following steps through a computer program:
[0063] S1. Extract features from the first ocean wave image within the target time period through image processing technology to obtain the first ocean wave features, where the target time period is a period of time before the current time;
[0064] S2. Perform waveform analysis on the first ocean wave features through Fourier transform to determine the second ocean wave features of the first ocean wave features in the frequency domain;
[0065] S3. Input the second ocean wave features into a prediction model for processing to predict the ocean wave height at the target time, where the target time is a time after the current time.
[0066] In an exemplary embodiment, the above electronic device may further include a transmission device and an input / output device, where the transmission device is connected to the above processor, and the input / output device is connected to the above processor.
[0067] An embodiment of the present application also provides a computer program product, including a non-volatile computer-readable storage medium, where the non-volatile computer-readable storage medium stores a computer program product, and when the computer program is executed by a processor, the steps of the methods described in various embodiments of the present application are implemented.
[0068] Optionally, in this embodiment, the above computer program may be set to implement the following steps when executed by a processor:
[0069] S1. Extract features from the first ocean wave image within the target time period through image processing technology to obtain the first ocean wave features, where the target time period is a period of time before the current time;
[0070] S2. Perform waveform analysis on the first ocean wave features through Fourier transform to determine the second ocean wave features of the first ocean wave features in the frequency domain;
[0071] S3. Input the second ocean wave features into a prediction model for processing to predict the ocean wave height at the target time, where the target time is a time after the current time.
[0072] Specific examples in this embodiment may refer to the examples described in the above embodiments and exemplary embodiments, and will not be elaborated here.
[0073] Obviously, those skilled in the art should understand that the above-mentioned modules or steps of the present application can be implemented by a general-purpose computing device. They can be concentrated on a single computing device or distributed on a network composed of multiple computing devices. They can be implemented by program codes executable by the computing device. Thus, they can be stored in a storage device and executed by the computing device. And in some cases, the steps shown or described can be executed in a sequence different from that here, or they can be separately fabricated into individual integrated circuit modules, or multiple modules or steps among them can be fabricated into a single integrated circuit module for implementation. In this way, the present application is not limited to any specific combination of hardware and software.
[0074] The above are only the preferred embodiments of the present application. It should be noted that for those of ordinary skill in the art, without departing from the principle of the present application, several improvements and refinements can still be made, and these improvements and refinements should also be regarded as the protection scope of the present application.
Claims
1. A method for predicting the wave height, characterized in that, Including: Performing feature extraction on a first sea wave image within a target time period through an image processing technique to obtain first sea wave features, where the target time period is a period of time before the current time; Performing waveform analysis on the first sea wave features through Fourier transform to determine second sea wave features of the first sea wave features in the frequency domain; Inputting the second sea wave features into a prediction model for processing to predict the sea wave height at a target time, where the target time is a time after the current time.
2. The prediction method of the sea wave height according to claim 1, wherein Before performing feature extraction on a first sea wave image within a target time period through an image processing technique to obtain first sea wave features, the method further includes: Obtaining the first sea wave image within the target time period and performing denoising processing on the first sea wave image to obtain a second sea wave image; Determine the target pixel value f of the second ocean wave image through the following Gaussian filtering formula new (x, y), where w(i, j) is the weight function of the Gaussian filter, m is the radius of the Gaussian filter, and f(x + i, y + j) is the initial pixel value of the first ocean wave image.
3. The prediction method of the sea wave height according to claim 2, wherein, Performing feature extraction on a first sea wave image within a target time period through an image processing technique to obtain first sea wave features, including: Determining the wave crests and wave troughs of the sea waves in the second sea wave image through an edge detection algorithm, and extracting the texture features of the sea waves in the second sea wave image through a texture analysis algorithm; Determining the amplitude of the sea waves according to the distance between the wave crests and the wave troughs; Determining the wave crests, the wave troughs, the texture features, and the amplitude as the first sea wave features.
4. The method for predicting the sea wave height according to claim 1, characterized in that, Performing waveform analysis on the first sea wave features through Fourier transform to determine second sea wave features of the first sea wave features in the frequency domain, including: Determine the second ocean wave feature F(k) according to the following Fourier transform formula: Wherein, f(t) is the first ocean wave feature, and k is a frequency variable.
5. The method for predicting the wave height according to claim 1, wherein Inputting the second sea wave features into a prediction model for processing to predict the sea wave height at a target time, including: Determine the sea wave height h according to the following formula t :[[]]END]] i t = σ(W i · [h t-1 , x t + b i ); f t = σ(W f · [h t-1 , x t + b f ); o t = σ(W o · [h t-1 , x t + b o ); C t = f t · C t-1 + i t · tanh(W C · [h t-1 , x t + b C ) h t = o t ·tanh(C t ), where i t is the activation value of the input gate in the prediction model, f t is the activation value of the forget gate in the prediction model, o t is the activation value of the output gate in the prediction model, C t is the cell state in the prediction model, W i is the weight matrix corresponding to the input gate, W f is the weight matrix corresponding to the forget gate, W o is the weight matrix corresponding to the output gate, W C is the weight matrix corresponding to the cell state, b i is used to adjust the activation value of the input gate, b f is used to adjust the activation value of the forget gate, b o is used to adjust the activation value of the output gate, b C is used to adjust the activation value of the cell state, h t-1 is the output of the prediction model at the previous time, x t is the input of the prediction model at the current time, and the previous time is a period of time before the current time.
6. The prediction method of wave height according to claim 1, characterized in that, After inputting the second sea wave features into a prediction model for processing to predict the sea wave height at a target time, the method further includes: Continuously monitoring the sea wave height when the sea wave height is less than a preset value; Starting an alarm device when the sea wave height is greater than or equal to the preset value, where the alarm device is used to remind a target object to initiate an emergency response.
7. A device for predicting the height of ocean waves, characterized in that, Including: An extraction module for performing feature extraction on a first sea wave image within a target time period through an image processing technique to obtain first sea wave features, where the target time period is a period of time before the current time; An analysis module for performing waveform analysis on the first sea wave features through Fourier transform to determine second sea wave features of the first sea wave features in the frequency domain; A prediction module for inputting the second sea wave features into a prediction model for processing to predict the sea wave height at a target time, where the target time is a time after the current time.
8. A computer-readable storage medium, characterized in that, The computer-readable storage medium includes a stored program, where the program, when running, executes the method according to any one of claims 1 to 6.
9. An electronic device, comprising a memory, a processor, and a computer program stored on the memory and executable on the processor, characterized in that, When the processor executes the computer program, it implements the steps of the method according to any one of claims 1 to 6.
10. A computer program product, comprising a computer program, characterized in that, When the computer program is executed by a processor, it implements the steps of the method according to any one of claims 1 to 6.