A method, system and storage medium for measuring multi-target distance on water surface based on deep learning and monocular vision
Using deep learning technology combined with external factors to generate comprehensive environmental evaluation coefficients, it solves the problem of inaccuracy in monocular visual ranging when measuring water targets, improves ranging accuracy and applicability, and ensures the accuracy and accuracy of ranging results. reliability.
Patent Information
- Application Number
- CN202410396318.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-04-03
- Publication Date
- 2024-09-06
- Estimated Expiration
- 2044-04-03
AI Technical Summary
Existing monocular visual ranging technology ignores the influence of external factors when measuring water targets, resulting in inaccurate ranging results, and lacks a feedback mechanism, making it difficult to determine the correctness of the ranging results.
Using deep learning methods, combined with external factors such as light intensity, air humidity, and wave intensity, a comprehensive environmental evaluation coefficient is generated and incorporated into the reward function of the ranging model to improve the accuracy and applicability of the ranging model.
It improves the accuracy and applicability of ranging in harsh environments and ensures the accuracy and reliability of ranging results.
Smart Images

Figure CN118135550B
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of water target ranging, and in particular to a water surface multi-target ranging method, system and storage medium based on deep learning and monocular vision. Background Art
[0002] In some water surface observation events, we need to quickly collect information such as the location in the water surface scene, and obtain real-time dynamic environmental information by combining and matching it with the information in the existing environmental database. Currently, the commonly used visual positioning method is mostly binocular visual ranging, but the accuracy of this method decreases rapidly as the measurement distance increases. In addition, binocular visual ranging is limited by the baseline length between the optical centers of the left and right cameras in application. If the binocular camera is installed in a limited space, its measurement distance is fundamentally difficult to break through the existing bottleneck.
[0003] In the prior art, a recognition and positioning method based on monocular vision with a publication number of "CN110009682B" can achieve ranging and positioning through monocular vision, and use a deep learning target detection neural network for target detection and positioning. It has the characteristics of identifying complex objects and multiple types of objects, breaking through the previous limitations of monocular vision ranging that can only identify simple targets and a limited number of target types; based on the monocular camera using the pinhole imaging principle to perform target ranging, compared with binocular vision ranging, it is theoretically not bound by the binocular vision parallax limit, and objects detectable within the line of sight can basically achieve positioning and ranging, and can achieve ranging of targets at different distances, with a wide range of applications; it can simultaneously detect multiple targets on a picture, and simultaneously obtain their relative positions in combination with prior information, and can very conveniently achieve monocular camera multi-target detection and ranging positioning.
[0004] However, the existing technology still has major defects. For example, when the existing technology uses monocular vision technology to measure the distance of the target object, it only considers the image characteristics and ignores the influence of external factors on the target image. For example, light intensity, air humidity, and water surface wave intensity will all affect the target imaging. Therefore, when the above technology is used to measure the distance of the surface target, there is a problem of inaccurate ranging results. In addition, in the application scenario of first measuring the distance to the surface target and then striking it, the above technology lacks feedback, and it is difficult to determine whether the ranging result is correct and applicable. Summary of the invention
[0005] The purpose of the present invention is to provide a method, system and storage medium for measuring multi-target distance on the water surface based on deep learning and monocular vision, so as to solve the problems raised in the above-mentioned background technology.
[0006] To achieve the above object, the present invention provides the following technical solutions:
[0007] A method for measuring distance between multiple targets on a water surface based on deep learning and monocular vision comprises the following steps:
[0008] S1, taking multiple monocular vision images of the surface target and striking based on each monocular vision image, marking the real distance of the surface target and whether the surface target is hit on the monocular vision image, and obtaining the light intensity, air humidity, and wave intensity level of the environment where the surface target is located;
[0009] S2, assigns values to light intensity, air humidity, and wave intensity levels and makes a comprehensive evaluation to generate a comprehensive environmental evaluation coefficient of the monocular vision image;
[0010] S3, marking the corresponding environmental comprehensive evaluation coefficient on the monocular vision image, and randomly dividing the monocular vision image into a training set and a test set;
[0011] S4, constructing a ranging model, and defining a state space, an action space, and a reward function of the ranging model, wherein the state space includes the image features of the surface target and the water cannon posture information, and the action space includes the water cannon action information, and the calculation formula of the reward function is composed of the absolute difference between the actual distance and the predicted distance output by the ranging model, the comprehensive environmental evaluation coefficient, and whether the surface target is hit;
[0012] S5, determining a learning algorithm of a ranging model, training the ranging model with a training set and a test set, and inputting a monocular visual image of the surface target to be measured, water cannon posture information, and water cannon motion information into the trained ranging model for ranging.
[0013] Furthermore, the specific logic of assigning values to the light intensity, air humidity, and wave intensity level and conducting a comprehensive evaluation to generate the environmental comprehensive evaluation coefficient of the monocular vision image is as follows:
[0014] S21, assigning a value to the light intensity to generate a light intensity influence value, wherein the light intensity influence value is between 0 and 1 and increases as the light intensity deviates from the optimal light intensity interval;
[0015] S22, assigning a value to the air humidity to generate an air humidity impact value between 0 and 1 and increasing as the air humidity increases;
[0016] S23, assigning a value to the wave intensity level to generate a wave intensity impact value between 0 and 1 and increasing as the wave intensity level increases;
[0017] S24, combining the light intensity impact value, the air humidity impact value, and the wave intensity impact value to generate a comprehensive environmental evaluation coefficient.
[0018] Furthermore, the light intensity, air humidity, and wave intensity level corresponding to the i-th monocular vision image are calibrated as E i RH i BL i , the illumination intensity impact value corresponding to the i-th monocular vision image is calibrated as f(E i ), the air humidity impact value corresponding to the i-th monocular vision image is calibrated as f(RH i ), the wave intensity impact value corresponding to the i-th monocular vision image is calibrated as f(BL i ), calibrate the comprehensive environmental evaluation coefficient corresponding to the i-th monocular vision image HJpj i , i represents the number of different monocular vision images, and i = 1, 2, 3, ..., m, and m represents the total number of monocular vision images, and m∈N + .
[0019] Furthermore, the light intensity influence value f(E i ) is as follows:
[0020] When 0≤E i <500, the light intensity affects the value f(E i )=0.9;
[0021] When 500≤E i <3000, the light intensity affects the value f(E i )=0.5;
[0022] When 3000≤E i <20000, the light intensity affects the value f(E i )=0.1;
[0023] When 20000≤E i <35000, the light intensity affects the value f(E i )=0.3;
[0024] When E is satisfied i >35000, the light intensity affects the value f(E i )=0.7.
[0025] Furthermore, the air humidity influence value f(RH i ) is as follows:
[0026] When 0≤RH i When the air humidity influence value f(RH <5, i )=0.1;
[0027] When 5≤RH iWhen the air humidity is less than 15, the air humidity influence value f(RH i )=0.3;
[0028] When 15≤RH i When the air humidity is less than 30, the air humidity influence value f(RH i )=0.5;
[0029] When 30≤RH i When <50, the air humidity influence value f(RH i )=0.7;
[0030] When E is satisfied i When the air humidity is >50, the air humidity influence value f(RH i )=0.9.
[0031] Furthermore, the wave intensity influence value f(BL i ) is as follows:
[0032] When the wave intensity level BL is met i When it is level 0, the wave intensity impact value f(BL i )=0.1;
[0033] When the wave intensity level BL is met i When it is level 1, the wave intensity impact value f(BL i )=0.3;
[0034] When the wave intensity level BL is met i When it is level 2, the wave intensity impact value f(BL i )=0.5;
[0035] When the wave intensity level BL is met i When it is level 3, the wave intensity impact value f(BL i )=0.7;
[0036] When the wave intensity level BL is met i When the wave intensity is level 4 or above, the wave intensity impact value f(BL i )=0.9.
[0037] Furthermore, the calculation formula of the comprehensive environmental evaluation coefficient is as follows:
[0038] HkDJ i =τ1*f(E i )+τ2*f(RH i )+τ3*f(BL i )
[0039] Among them, τ1, τ2, and τ3 are all preset proportional coefficients, and τ1+τ2+τ3=1, and 0<τ3<τ2<τ1<1.
[0040] Furthermore, the calculation formula of the reward function is as follows:
[0041] R i = -λ1*(1+HJpj i )*|L i '-L i |-λ2*f(JZ i )
[0042] Among them, R i represents the reward function corresponding to the i-th monocular visual image, L i , L i 'represent the real distance corresponding to the i-th monocular vision image and the predicted distance output by the ranging model, and the information of whether the i-th monocular vision image hits the surface target is calibrated as f(JZ i ), and when hitting the surface target information f(JZ i )=0, and when the surface target information is not hit, f(JZ i )=1, λ1 and λ2 are both preset proportional coefficients, and λ1+λ2=1, and 0<λ2<λ1<1.
[0043] A water surface multi-target ranging system based on deep learning and monocular vision, used for the above-mentioned water surface multi-target ranging method based on deep learning and monocular vision, comprising:
[0044] A data acquisition module is used to capture multiple monocular vision images of the surface target and strike based on each monocular vision image, and mark the real distance of the surface target and whether the surface target is hit on the monocular vision image, as well as obtain the light intensity, air humidity, and wave intensity level of the environment where the surface target is located;
[0045] The environmental comprehensive evaluation module is used to assign values to light intensity, air humidity, and wave intensity levels and conduct comprehensive evaluation to generate the environmental comprehensive evaluation coefficient of the monocular vision image;
[0046] A data processing module is used to mark the corresponding environmental comprehensive evaluation coefficient on the monocular vision image and randomly divide the monocular vision image into a training set and a test set;
[0047] A model building module is used to build a ranging model and define the state space, action space, and reward function of the ranging model, wherein the state space includes the image features of the surface target and the water cannon posture information, and the action space includes the water cannon action information, and the calculation formula of the reward function is composed of the absolute difference between the actual distance and the predicted distance output by the ranging model, the comprehensive environmental evaluation coefficient, and whether the surface target is hit;
[0048] The ranging module is used to determine the learning algorithm of the ranging model, train the ranging model with a training set and a test set, and input the monocular visual image of the surface target to be measured, the water cannon posture information and the water cannon action information into the trained ranging model for ranging.
[0049] A storage medium stores a computer program, which, when executed by a processor, implements the above-mentioned surface multi-target ranging method based on deep learning and monocular vision.
[0050] Compared with the prior art, the present invention has the following beneficial effects:
[0051] The surface multi-target ranging method, system and storage medium based on deep learning and monocular vision of the present invention assign values to light intensity, air humidity and surface wave intensity and combine them to generate an environmental comprehensive evaluation coefficient, and then incorporate the environmental comprehensive evaluation coefficient into the reward function of the ranging model, so as to improve the sensitivity of the ranging model to the ranging results in harsh environments, thereby improving the accuracy of the ranging model in ranging surface targets in harsh environments, and incorporating information on whether the surface target is hit as feedback information into the reward function of the ranging model, so as to improve the applicability of the ranging model in ranging in the application scenario of striking surface targets. BRIEF DESCRIPTION OF THE DRAWINGS
[0052] Figure 1 It is a flow chart of the method for measuring distance between multiple targets on the water surface based on deep learning and monocular vision in the present invention;
[0053] Figure 2 This is a module unit diagram of the surface multi-target ranging system based on deep learning and monocular vision in the present invention. DETAILED DESCRIPTION
[0054] In order to make the objectives, technical solutions and advantages of the present invention more clearly understood, the present invention is further described in detail below in conjunction with specific embodiments.
[0055] It should be noted that, unless otherwise defined, the technical terms or scientific terms used in the present invention should be understood by people with ordinary skills in the field to which the present invention belongs. The words "first", "second" and similar words used in the present invention do not indicate any order, quantity or importance, but are only used to distinguish different components. "Include" or "comprise" and similar words mean that the elements or objects appearing before the word include the elements or objects listed after the word and their equivalents, without excluding other elements or objects. "Connect" or "connected" and similar words are not limited to physical or mechanical connections, but may include electrical connections, whether direct or indirect. "Up", "down", "left", "right" and the like are only used to indicate relative positional relationships. When the absolute position of the described object changes, the relative positional relationship may also change accordingly.
[0056] Embodiment 1:
[0057] See also Figure 1 The present invention provides a method for measuring distance between multiple targets on a water surface based on deep learning and monocular vision, comprising the following steps:
[0058] S1, taking multiple monocular vision images of the surface target and striking based on each monocular vision image, marking the real distance of the surface target and whether the surface target is hit on the monocular vision image, and obtaining the light intensity, air humidity, and wave intensity level of the environment where the surface target is located;
[0059] It should be noted that, the attack based on the monocular vision image can use the existing monocular vision technology to process the monocular vision image, so as to calculate the predicted distance from the surface target, and attack the surface target based on the predicted distance, the monocular vision image is taken above the water surface by using the existing monocular vision equipment (such as a monocular vision camera), the marked real distance is measured and obtained by a rangefinder, the light intensity can be measured by a light intensity sensor, the air humidity can be measured by an air humidity sensor, and the wave intensity level can be obtained by a buoy sensor, that is, the acquisition of the above data can be obtained by those skilled in the art without paying creative labor, this is the existing technology, and it will not be elaborated here;
[0060] Among them, the light intensity, air humidity, and wave intensity level corresponding to the i-th monocular vision image are calibrated as E i RH i BL i , i represents the number of different monocular vision images, and i = 1, 2, 3, ..., m, and m represents the total number of monocular vision images, and m∈N + .
[0061] S2, assigning values to light intensity, air humidity, and wave intensity levels and making a comprehensive evaluation to generate an environmental comprehensive evaluation coefficient of a monocular vision image, including the following steps:
[0062] S21, assigning a value to the light intensity to generate a light intensity influence value, wherein the light intensity influence value is between 0 and 1 and increases as the light intensity deviates from the optimal light intensity interval;
[0063] Among them, the illumination intensity impact value corresponding to the i-th monocular vision image is calibrated as f(E i );
[0064] As an embodiment, the light intensity influence value f(E i ) is as follows:
[0065]
[0066]
[0067] It should be noted that the optimal light intensity range refers to the light intensity range in which the monocular vision image captured is clearest and has the best details (i.e., the best image quality) under the environment of this light intensity range. Here, the light intensity range of 3000-20000 lux is selected as the optimal light intensity range. The greater the degree of light intensity deviation from the optimal light intensity range, the worse the quality of the monocular vision image captured under this light intensity, and the greater the light intensity impact value;
[0068] S22, assigning a value to the air humidity to generate an air humidity impact value between 0 and 1 and increasing as the air humidity increases;
[0069] The air humidity impact value corresponding to the i-th monocular visual image is calibrated as f(RH i );
[0070] As an embodiment, the air humidity influence value f(RH i ) is as follows:
[0071] <![CDATA[Air humidity RH i (%)]]> <![CDATA[Air humidity influence value f(RH i )]]> <![CDATA[0≤RH i <5]]> 0.1 <![CDATA[5≤RH i <15]]> 0.3 <![CDATA[15≤RH i <30]]> 0.5 <![CDATA[30≤RH i <50]]> 0.7 <![CDATA[E i >50]]> 0.9
[0072] It should be noted that the greater the air humidity, the greater the water mist on the water surface, and the greater the degree to which the monocular vision image captured is blurred and blocked by the water mist, that is, the worse the quality of the monocular vision image captured, the greater the air humidity impact value;
[0073] S23, assigning a value to the wave intensity level to generate a wave intensity impact value between 0 and 1 and increasing as the wave intensity level increases;
[0074] Among them, the wave intensity impact value corresponding to the i-th monocular visual image is calibrated as f(BL i );
[0075] As an embodiment, the wave intensity influence value f(BL i ) is as follows:
[0076] <![CDATA[Wave intensity level BL i > <![CDATA[Wave intensity influence value f(BL i )]]> Level 0 0.1 Level 1 0.3 Level 2 0.5 Level 3 0.7 Level 4 and above 0.9
[0077] It should be noted that the greater the wave intensity level, the greater the degree of shaking of the surface target due to the influence of the waves, and the greater the degree of shaking and blurring of the monocular vision image due to the influence of water mist, that is, the worse the quality of the monocular vision image, the greater the wave intensity impact value;
[0078] S24, combining the light intensity impact value, air humidity impact value, and wave intensity impact value, generates the comprehensive environmental evaluation coefficient, and the calculation formula is as follows:
[0079] HkDJ i =τ1*f(E i )+τ2*f(RH i )+τ3*f(BL i )
[0080] It should be noted that HJpj i It represents the comprehensive environmental evaluation coefficient corresponding to the i-th monocular vision image. The comprehensive environmental evaluation coefficient is composed of the light intensity influence value, the air humidity influence value, and the wave intensity influence value. Based on the three external environmental factors of light intensity, air humidity and wave intensity level, the comprehensive environmental evaluation coefficient used to evaluate the external environment is generated;
[0081] It should be noted that τ1, τ2, and τ3 are all preset proportional coefficients, and τ1 represents the light intensity influence value f(E i ) in the comprehensive environmental evaluation coefficient HJpj i The weight in the calculation, τ2 represents the air humidity influence value f(RH i ) in the comprehensive environmental evaluation coefficient HJpj i The weight in the calculation, τ3 represents the wave intensity impact value f(BL i ) in the comprehensive environmental evaluation coefficient HJpj i The weights in the calculation, and τ1+τ2+τ3=1, and 0<τ3<τ2<τ1<1, the specific values of τ1, τ2, τ3 are generally determined by those skilled in the art according to actual conditions;
[0082] As an implementation mode, the value range of τ1 is 0.4-0.5, the value range of τ2 is 0.3-0.4, and the value range of τ3 is 0.1-0.3;
[0083] It should be noted that the greater the light intensity impact value, air humidity impact value, and wave intensity impact value, the worse the external environmental factors are, the worse the monocular vision image taken under the influence of harsh environmental factors, and the greater the comprehensive environmental evaluation coefficient.
[0084] S3, marking the corresponding environmental comprehensive evaluation coefficient on the monocular vision image, and randomly dividing the monocular vision image into a training set and a test set;
[0085] It should be noted that randomly dividing multiple monocular vision images marked with real distances and comprehensive environmental evaluation coefficients into training sets and test sets is a routine work step in the early stage of model training and will not be elaborated here. In addition, the ratio between the monocular vision images in the training set and the test set can be 70 / 30 or 80 / 20, which is not limited here.
[0086] S4, constructing a ranging model, and defining the state space, action space, and reward function of the ranging model, wherein the state space includes the image features of the surface target and the water cannon posture information, and the action space includes the water cannon action information, and the calculation formula of the reward function is composed of the absolute difference between the actual distance and the predicted distance output by the ranging model, the comprehensive environmental evaluation coefficient, and whether the surface target is hit, including the following steps:
[0087] S41, defining a state space, the state space including surface target image features, water cannon attitude information, and surface target coordinates, wherein the water cannon attitude information includes a pitch angle and a yaw angle, and the surface target coordinates include a horizontal coordinate and a vertical coordinate;
[0088] Among them, the state space, surface target image features, water cannon posture information, surface target coordinates, pitch angle, yaw angle, horizontal coordinates and vertical coordinates corresponding to the i-th monocular vision image are calibrated as S i 、s i ,θ i 、p i ,φ i , i 、x i and i , and S i =(s i ,θ i ,p i ), and θ i =(φ i ,ψ i ), and p i =(x i ,y i );
[0089] It should be noted that the image features of the surface target can be obtained from the monocular vision image using a convolutional neural network (CNN), the pitch angle and the yaw angle can be obtained by an inertial measurement unit, the inertial measurement unit includes but is not limited to a gyroscope and an accelerometer, and the coordinates in the horizontal direction and the vertical direction can be obtained by a laser rangefinder, which is not limited here;
[0090] S42, defining an action space, wherein the water cannon action information in the action space includes a water cannon displacement length, a water cannon displacement direction, a water cannon rotation angle, and a water cannon rotation angle;
[0091] Among them, the action space, water cannon displacement length, water cannon displacement direction, water cannon rotation angle, and water cannon rotation angle corresponding to the i-th monocular vision image are calibrated as A i 、a1 i 、a2 i 、a3 i 、a4 i , and A i =(a1 i ,a2 i ,a3 i ,a4 i );
[0092] It should be noted that the water monitor displacement length, water monitor displacement direction, water monitor rotation angle, and water monitor rotation angle are all collected and counted by the staff and will not be elaborated here;
[0093] S43, combining the absolute difference between the actual distance and the estimated distance output by the distance measurement model, the comprehensive environmental evaluation coefficient, and the information on whether the surface target is hit, a calculation formula of the reward function is defined as follows:
[0094] R i = -λ1*(1+HJpj i )*|L i '-L i |-λ2*f(JZ i )
[0095] It should be noted that L i , L i 'represent the real distance corresponding to the i-th monocular vision image and the predicted distance output by the ranging model, and the information of whether the i-th monocular vision image hits the surface target is calibrated as f(JZ i ), and when hitting the surface target information f(JZ i )=0, and when the surface target information is not hit, f(JZ i )=1;
[0096] It should be noted that Ri represents the reward function corresponding to the i-th monocular visual image. The reward function is composed of the absolute difference between the actual distance and the estimated distance output by the ranging model, the comprehensive environmental evaluation coefficient, and whether the surface target is hit. First, pass -|L i '-L i |Calculate the negative value of the absolute difference between the actual distance and the estimated distance output by the distance measurement model. The larger the absolute difference, the lower the accuracy of the distance measurement model. The smaller the negative value of the absolute difference, the smaller the reward value given (that is, the larger the penalty value). Then -|L i '-L i |Multiply by (1+HJpj i ), so as to combine the absolute difference between the real distance and the estimated distance output by the ranging model and the comprehensive environmental evaluation coefficient, so that when the comprehensive environmental evaluation coefficient is larger (that is, the worse the shooting environment is), -|L i '-L i |Multiply by (1+HJpj i ) is smaller, the reward value is smaller (that is, the penalty value is larger), so as to improve the sensitivity of the ranging model to the ranging results in harsh environments, thereby improving the accuracy of the ranging model for surface targets in harsh environments. Finally, -|L i '-L i |Multiply by (1+HJpj i ) plus the value of -f(JZ i ), so as to combine the information of whether the surface target is hit into the reward function, so as to incorporate the information of whether the surface target is hit when hitting the surface target based on the monocular visual image into the ranging model as feedback information. When the surface target is not hit, the smaller the reward value given (that is, the larger the penalty value), the applicability of the ranging model in hitting the surface target is improved;
[0097] It should be noted that λ1 and λ2 are both preset proportional coefficients, and λ1 represents -(1+HJpj i )*L i '-L i In the reward function R i The weight in the calculation, λ2 represents -f(JZ i ) In the reward function R i The weights in the calculation, and λ1+λ2=1, and 0<λ2<λ1<1, the specific values of λ1 and λ2 are generally determined by those skilled in the art according to actual conditions;
[0098] As an implementation mode, the value range of λ1 is 0.6-0.7, and the value range of λ2 is 0.3-0.4.
[0099] S5, determining a learning algorithm for a ranging model, training the ranging model with a training set and a test set, and inputting a monocular visual image of a surface target to be measured, water cannon posture information, and water cannon motion information into the trained ranging model for ranging;
[0100] It should be noted that the learning algorithm of the distance measurement model and the use of the training set and the test set to train the distance measurement model can adopt existing technologies. For example, the learning algorithm can adopt the deep Q learning algorithm and the actor-critic algorithm, etc. Considering the image information provided by the monocular vision technology, the deep Q learning algorithm that is more suitable for image input is taken as an example below:
[0101] S51, define the update formula of the Q value function, the update formula of the target Q value function, and the loss function, as follows:
[0102]
[0103] It should be noted that Q i (s i ,θ i ,A i ) represents the Q value function, which is used to estimate the cumulative reward for executing the water cannon action information under the current surface target image features and water cannon posture information. The cumulative reward is composed of multiple reward functions R i The value of (i.e., single-step reward) is accumulated to obtain, Q i '(s i ,θ i ,A i ) represents the target Q value function, which is used to estimate the cumulative reward for executing the next water cannon action information under the next surface target image feature and water cannon posture information, which will not be described in detail here;
[0104] It should be noted that the loss function can use the mean square error loss function to minimize the difference between the Q value function and the target Q value function, which will not be described in detail here;
[0105] It should be noted that α represents the learning rate, which is used to control the speed of updating; γ represents the discount factor, which is used to control the importance of future rewards; β is a parameter used to control the update speed of the target Q-value function. The specific values of α, γ, and β are determined by those skilled in the art according to actual conditions. This is common knowledge in model training and will not be elaborated here.
[0106] S52, initializing the parameters of the ranging model, and extracting the image features of the surface target and the water cannon posture information of the monocular vision image in the training set;
[0107] It should be noted that the parameters of the ranging model may be initialized by a random initialization method, which is a prior art and will not be described in detail here;
[0108] S53, using the surface target image feature and water cannon posture information of a monocular visual image in the training set as the current surface target image feature and the current water cannon posture information, selecting the current water cannon action information according to the ε-greedy strategy and executing the current water cannon action information, and observing the cumulative reward value obtained by the Q value function, the next surface target image feature and the next water cannon posture information;
[0109] The Q value function is updated according to the update formula of the Q value function, and the difference between the Q value function and the target Q value function is calculated using the loss function. The parameters of the ranging model are updated using the back propagation algorithm to minimize the loss function, and the target Q value function is updated according to the update formula of the target Q value function.
[0110] It should be noted that the algorithm in step S53 is used to update the ranging model parameters as a conventional operation of the deep Q learning algorithm, which is a prior art and will not be described in detail here;
[0111] S54, repeating step S53 until the model converges or reaches a predetermined number of iterations. The determination of model convergence and the selection of the predetermined number of iterations are both set by those skilled in the art according to actual conditions and are not described in detail herein.
[0112] S55, inputting the surface target image features, water cannon posture information and water cannon motion information of the monocular vision image in the test set into the trained distance measurement model for testing. When the distance measurement model performance reaches the test standard, it is determined that the distance measurement model training is completed. If the distance measurement model performance does not reach the test standard, repeating steps S53 and S54, retraining the distance measurement model until the distance measurement model performance reaches the test standard;
[0113] It should be noted that the test standard can be defined as: the relative error between the distance measurement result output by the distance measurement model and the actual distance does not exceed 1%, 3%, 5%, etc., which is not limited here;
[0114] S56, inputting the monocular visual image of the surface target to be measured, the water cannon posture information and the water cannon motion information into the trained distance measurement model for distance measurement.
[0115] Embodiment 2:
[0116] See also Figure 2 The present invention provides a surface multi-target ranging system based on deep learning and monocular vision according to an embodiment of the present invention, which is used in the surface multi-target ranging method based on deep learning and monocular vision according to the first embodiment of the present invention, comprising:
[0117] A data acquisition module is used to capture multiple monocular vision images of the surface target and strike based on each monocular vision image, and mark the real distance of the surface target and whether the surface target is hit on the monocular vision image, as well as obtain the light intensity, air humidity, and wave intensity level of the environment where the surface target is located;
[0118] The environmental comprehensive evaluation module is used to assign values to light intensity, air humidity, and wave intensity levels and conduct comprehensive evaluation to generate the environmental comprehensive evaluation coefficient of the monocular vision image;
[0119] A data processing module is used to mark the corresponding environmental comprehensive evaluation coefficient on the monocular vision image and randomly divide the monocular vision image into a training set and a test set;
[0120] A model building module is used to build a ranging model and define the state space, action space, and reward function of the ranging model, wherein the state space includes the image features of the surface target and the water cannon posture information, and the action space includes the water cannon action information, and the calculation formula of the reward function is composed of the absolute difference between the actual distance and the predicted distance output by the ranging model, the comprehensive environmental evaluation coefficient, and whether the surface target is hit;
[0121] The ranging module is used to determine the learning algorithm of the ranging model, train the ranging model with a training set and a test set, and input the monocular visual image of the surface target to be measured, the water cannon posture information and the water cannon action information into the trained ranging model for ranging.
[0122] Embodiment three:
[0123] The present invention provides a storage medium storing a computer program, which, when executed by a processor, implements the above-mentioned surface multi-target ranging method based on deep learning and monocular vision.
[0124] The above formulas are all dimensionless and numerical calculations. The formula is a formula for the most recent real situation obtained by collecting a large amount of data and performing software simulation. The preset parameters in the formula are set by technicians in this field according to actual conditions.
[0125] The above embodiments may be implemented in whole or in part by software, hardware, firmware or any other combination thereof. When implemented by software, the above embodiments may be implemented in whole or in part in the form of a computer program product. Those skilled in the art may appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein may be implemented by electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are performed by hardware or software methods depends on the specific application and design constraints of the technical solution.
[0126] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, and may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
[0127] The above is only a specific implementation of the present application, but the protection scope of the present application is not limited thereto. Any technician familiar with the technical field can easily think of changes or substitutions within the technical scope disclosed in the present application, which should be covered by the protection scope of the present application.
Claims
1. A method for measuring multi-target distance on water surface based on deep learning and monocular vision. It is characterized in that The steps include: S1, taking multiple monocular vision images of the surface target and striking based on each monocular vision image, marking the real distance of the surface target and whether the surface target is hit on the monocular vision image, and obtaining the light intensity, air humidity, and wave intensity level of the environment where the surface target is located; S2, assigns values to light intensity, air humidity, and wave intensity levels and makes a comprehensive evaluation to generate a comprehensive environmental evaluation coefficient of the monocular vision image; S3, marking the corresponding environmental comprehensive evaluation coefficient on the monocular vision image, and randomly dividing the monocular vision image into a training set and a test set; S4, constructing a ranging model, and defining a state space, an action space, and a reward function of the ranging model, wherein the state space includes the image features of the surface target and the water cannon posture information, and the action space includes the water cannon action information, and the calculation formula of the reward function is composed of the absolute difference between the actual distance and the predicted distance output by the ranging model, the comprehensive environmental evaluation coefficient, and whether the surface target is hit; S5, determining a learning algorithm for a ranging model, training the ranging model with a training set and a test set, and inputting a monocular visual image of a surface target to be measured, water cannon posture information, and water cannon motion information into the trained ranging model for ranging; The calculation formula of the reward function is as follows: R i =-λ1*(1+HJpj i )*|L i '-L i |-λ2*f(JZ i ) Among them, the comprehensive environmental evaluation coefficient corresponding to the i-th monocular vision image is calibrated as HJpj i , i represents the number of different monocular vision images, and i = 1, 2, 3, ..., m, and m represents the total number of monocular vision images, and m∈N + , R i represents the reward function corresponding to the i-th monocular visual image, L i , L i 'represent the real distance corresponding to the i-th monocular vision image and the predicted distance output by the ranging model, and the information of whether the i-th monocular vision image hits the surface target is calibrated as f(JZ i ), and when hitting the surface target information f(JZ i )=0, and when the surface target information is not hit, f(JZ i )=1, λ1 and λ2 are both preset proportional coefficients, and λ1+λ2=1, and 0<λ2<λ1<1.
2. The method for measuring multi-target distance on the water surface based on deep learning and monocular vision according to claim 1, Features: The specific logic of assigning values to light intensity, air humidity, and wave intensity levels and conducting a comprehensive evaluation to generate the environmental comprehensive evaluation coefficient of the monocular vision image is as follows: S21, assigning a value to the light intensity to generate a light intensity influence value, wherein the light intensity influence value is between 0 and 1 and increases as the light intensity deviates from the optimal light intensity interval; S22, assigning a value to the air humidity to generate an air humidity impact value between 0 and 1 and increasing as the air humidity increases; S23, assigning a value to the wave intensity level to generate a wave intensity impact value between 0 and 1 and increasing as the wave intensity level increases; S24, combining the light intensity impact value, the air humidity impact value, and the wave intensity impact value to generate a comprehensive environmental evaluation coefficient.
3. The method for measuring multi-target distance on the water surface based on deep learning and monocular vision according to claim 1, Features: The light intensity, air humidity, and wave intensity level corresponding to the i-th monocular vision image are calibrated as E i RH i BL i , the illumination intensity impact value corresponding to the i-th monocular vision image is calibrated as f(E i ), the air humidity impact value corresponding to the i-th monocular vision image is calibrated as f(RH i ), the wave intensity impact value corresponding to the i-th monocular vision image is calibrated as f(BL i ).
4. The method for measuring multi-target distance on the water surface based on deep learning and monocular vision according to claim 3, Features: The light intensity influence value f(E i ) is as follows: When 0≤E i When <500, the light intensity influence value f(E i )=0.9; When 500≤E i When <3000, the light intensity influence value f(E i )=0.5; When 3000≤E i When <20000, the light intensity influence value f(E i )=0.1; When 20000≤E i When <35000, the light intensity influence value f(E i )=0.3; When E is satisfied i When >35000, the light intensity influence value f(E i )=0.
7.
5. The method for measuring distance between multiple targets on the water surface based on deep learning and monocular vision according to claim 3, Features: The air humidity influence value f(RH i ) is as follows: When 0≤RH i When RH < 5, the air humidity influence value f(RH i )=0.1; When 5≤RH i When <15, the air humidity influence value f(RH i )=0.3; When 15≤RH i When <30, the air humidity influence value f(RH i )=0.5; When 30≤RH i When <50, the air humidity influence value f(RH i )=0.7; When E is satisfied i When >50, the air humidity influence value f(RH i )=0.
9.
6. The method for measuring distance between multiple targets on the water surface based on deep learning and monocular vision according to claim 3, Features: The wave intensity influence value f(BL i ) is as follows: When the wave intensity level BL is met i When it is level 0, the wave intensity impact value f(BL i )=0.1; When the wave intensity level BL is met i When it is level 1, the wave intensity impact value f(BL i )=0.3; When the wave intensity level BL is met i When it is level 2, the wave intensity impact value f(BL i )=0.5; When the wave intensity level BL is met i When it is level 3, the wave intensity impact value f(BL i )=0.7; When the wave intensity level BL is met i When the wave intensity is level 4 or above, the wave intensity impact value f(BL i )=0.
9.
7. The method for measuring distance between multiple targets on the water surface based on deep learning and monocular vision according to claim 3, Features: The calculation formula of the comprehensive environmental evaluation coefficient is as follows: HJpj i =τ1*f(E i )+τ2*f(RH i )+τ3*f(BL i ) Among them, τ1, τ2, and τ3 are all preset proportional coefficients, and τ1+τ2+τ3=1, and 0<τ3<τ2<τ1<1.
8. A surface multi-target ranging system based on deep learning and monocular vision, used in the surface multi-target ranging method based on deep learning and monocular vision as described in any one of claims 1 to 7, It is characterized in that include: A data acquisition module is used to capture multiple monocular vision images of the surface target and strike based on each monocular vision image, and mark the real distance of the surface target and whether the surface target is hit on the monocular vision image, as well as obtain the light intensity, air humidity, and wave intensity level of the environment where the surface target is located; The environmental comprehensive evaluation module is used to assign values to light intensity, air humidity, and wave intensity levels and conduct comprehensive evaluation to generate the environmental comprehensive evaluation coefficient of the monocular vision image; A data processing module is used to mark the corresponding environmental comprehensive evaluation coefficient on the monocular vision image and randomly divide the monocular vision image into a training set and a test set; A model building module is used to build a ranging model and define the state space, action space, and reward function of the ranging model, wherein the state space includes the image features of the surface target and the water cannon posture information, and the action space includes the water cannon action information, and the calculation formula of the reward function is composed of the absolute difference between the actual distance and the predicted distance output by the ranging model, the comprehensive environmental evaluation coefficient, and whether the surface target is hit; The ranging module is used to determine the learning algorithm of the ranging model, train the ranging model with a training set and a test set, and input the monocular visual image of the surface target to be measured, the water cannon posture information and the water cannon action information into the trained ranging model for ranging.
9. A storage medium having a computer program stored therein, Features: When the computer program is executed by a processor, the method for measuring multi-target distance on the surface of water based on deep learning and monocular vision as described in any one of claims 1 to 7 is implemented.
