Underwater image processing method and device, computer equipment and storage medium
By measuring the underwater light attenuation coefficient and extracting depth information, and combining the Jaffe-McGlamery model to process underwater images, the problems of high computational complexity and ignoring depth information in the prior art are solved, and high-quality near-real-time underwater image processing are achieved.
Patent Information
- Application Number
- CN202510094349.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-01-21
- Publication Date
- 2025-05-13
AI Technical Summary
The existing underwater image processing algorithm has high computational complexity, is not suitable for real-time or near-real-time processing, and ignores the influence of the depth information of the target object and the underwater attenuation coefficient, resulting in low image quality.
The underwater light attenuation coefficient is obtained by measuring the optical power changes of the laser emitted by the laser in the underwater medium transmission using an optical power meter, and the underwater image is obtained by a binocular camera and the background light value and depth information are extracted. The underwater image is processed in combination with the Jaffe-McGlamery model to obtain the target image.
It significantly improves the visual quality of underwater images, simplifies the algorithm, and realizes near-real-time underwater image processing to meet the real-time processing needs of dynamic underwater environments.
Smart Images

Figure CN119996847A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of image processing technology, and in particular to an underwater image processing method, device, computer equipment and storage medium. Background Art
[0002] The acquisition and processing of underwater images is a key technology in the fields of ocean exploration, environmental monitoring, underwater engineering and military reconnaissance. Due to the complexity of the underwater environment, including light attenuation and scattering, and the dynamic changes of underwater objects, the acquired images often have problems such as blur, color distortion and reduced contrast. These problems seriously affect the quality of the image and limit the effectiveness of underwater images in practical applications.
[0003] Most of the existing image processing algorithms have high computational complexity and are not suitable for real-time or near real-time underwater image processing needs. Moreover, these image processing algorithms ignore the depth information of the target and use various approximate methods to ignore the influence of the underwater attenuation coefficient, thus failing to accurately improve the visual quality of underwater images. Summary of the invention
[0004] Based on this, it is necessary to provide an underwater image processing method, device, computer equipment and storage medium that can improve the visual quality of underwater images in response to the above technical problems.
[0005] In a first aspect, the present application provides an underwater image processing method. The method comprises:
[0006] The optical power meter is used to measure the optical power change of the laser emitted by the laser during the transmission process of the underwater medium to obtain the underwater light attenuation coefficient;
[0007] Use a binocular camera to obtain underwater images and extract background light values and depth information from the underwater images;
[0008] According to the light attenuation coefficient, background light value and depth information, the underwater image is processed in combination with the Jaffe-McGlamery model to obtain the target image.
[0009] In one embodiment, using an optical power meter to measure the optical power change of laser emitted by a laser during the transmission process of an underwater medium to obtain the underwater optical attenuation coefficient includes:
[0010] Obtaining a first optical power reading when the laser emitted by the laser reaches the optical power meter in a transmission environment without an underwater medium;
[0011] Obtain a second optical power reading when the laser emitted by the laser reaches the optical power meter in an underwater medium transmission environment;
[0012] Based on the Lambert-Beer law, a first optical power degree corresponding equation and a second optical power degree corresponding equation are constructed, and the light attenuation coefficient is obtained by the simultaneous equations.
[0013] In one embodiment, an underwater image is acquired using a binocular camera, and extracting a background light value in the underwater image includes:
[0014] Obtaining grayscale distribution characteristics of underwater images;
[0015] The underwater image is divided into several local areas based on the grayscale distribution characteristics using a quadtree, the grayscale histogram is calculated for each local area, and the adaptive threshold corresponding to each local area is determined according to the distribution of the grayscale histogram;
[0016] If the absolute average deviation of the grayscale value of the local area is greater than the adaptive threshold, the local area is recursively divided until the absolute average deviation of the grayscale value of the divided area is less than the adaptive threshold. If the difference between the grayscale mean of the area corresponding to the adaptive threshold and the grayscale mean of the adjacent area meets the preset conditions, it is marked as a candidate area;
[0017] Calculate the gray consistency weight and regional area weight for each candidate region, and combine the gray consistency weight and regional area weight to obtain the comprehensive weight;
[0018] Based on the comprehensive weight, each candidate area is weighted averaged to obtain the background light value.
[0019] In one embodiment, determining the adaptive threshold corresponding to each local area according to the distribution of the grayscale histogram includes:
[0020] If the grayscale histogram presents a bimodal distribution, the valley value between the two peaks is used as the basic threshold. Otherwise, the basic threshold is obtained based on the OTSU algorithm.
[0021] The overall grayscale mean value and the grayscale mean value of each local area of the underwater image are calculated according to the grayscale distribution characteristics;
[0022] If the grayscale mean value of the local area is lower than the first preset value, the first multiple of the basic threshold value is used as the adaptive threshold value; if the grayscale mean value of the local area is higher than the second preset value, the second multiple of the basic threshold value is used as the adaptive threshold value; if the grayscale mean value of the local area is not lower than the first preset value and not higher than the second preset value, the basic threshold value is used as the adaptive threshold value;
[0023] The first preset value and the second preset value are both determined according to the overall grayscale mean of the underwater image.
[0024] In one embodiment, the gray consistency weight is determined according to the absolute average deviation of the candidate region, and the region area weight is determined according to the proportion of the candidate region area in the underwater image area.
[0025] In one embodiment, an underwater image is acquired using a binocular camera, and extracting depth information from the underwater image includes:
[0026] Compare underwater images from two perspectives acquired by the binocular camera;
[0027] Match the feature points of underwater images from two perspectives and calculate the disparity of the feature points in the two images;
[0028] Calculate depth information by combining the geometric configuration and parallax of the binocular cameras;
[0029] Among them, the geometric configuration includes focal length and baseline distance.
[0030] In a second aspect, the present application also provides an underwater image processing device. The device comprises:
[0031] The attenuation coefficient measurement module is used to obtain the underwater light attenuation coefficient by measuring the optical power change of the laser emitted by the laser in the underwater medium transmission process using an optical power meter;
[0032] An image parameter extraction module is used to obtain underwater images using a binocular camera and extract background light values and depth information from the underwater images;
[0033] The image processing module is used to process underwater images according to the light attenuation coefficient, background light value and depth information in combination with the Jaffe-McGlamery model to obtain the target image.
[0034] In a third aspect, the present application further provides a computer device, which includes a memory and a processor, wherein the memory stores a computer program, and the processor implements the steps in the underwater image processing method when executing the computer program.
[0035] In a fourth aspect, the present application further provides a computer-readable storage medium having a computer program stored thereon, which implements the steps in the above-mentioned underwater image processing method when executed by a processor.
[0036] In a fifth aspect, the present application further provides a computer program product, which includes a computer program, and when the computer program is executed by a processor, the steps in the underwater image processing method are implemented.
[0037] The underwater image processing method, device, computer equipment and storage medium described above use an optical power meter to measure the change in optical power of the laser emitted by the laser during the transmission process of the underwater medium to obtain the underwater light attenuation coefficient; use a binocular camera to obtain underwater images, extract background light values and depth information in the underwater images; process underwater images based on the light attenuation coefficient, background light value and depth information in combination with the Jaffe-McGlamery model to obtain the target image. This application significantly improves the visual quality of underwater images by combining the binocular camera with the measured data of the light attenuation coefficient for image processing; at the same time, the algorithm is simple and can achieve near-real-time underwater image processing, meeting the real-time processing requirements of dynamic underwater environments. BRIEF DESCRIPTION OF THE DRAWINGS
[0038] Figure 1 is a schematic flow chart of an underwater image processing method in one embodiment;
[0039] Figure 2 A schematic diagram of a binocular camera improving underwater image quality in one embodiment;
[0040] Figure 3 Schematic diagram of the structure of an attenuation coefficient measurement module in an embodiment. DETAILED DESCRIPTION
[0041] In order to make the purpose, technical solution and advantages of the present application more clearly understood, the present application is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and are not used to limit the present application.
[0042] The present application embodiment provides an underwater image processing method, such as Figure 1 As shown, the following steps are included:
[0043] Step 102: Use an optical power meter to measure the optical power change of the laser emitted by the laser during the transmission process in the underwater medium to obtain the underwater light attenuation coefficient.
[0044] When light passes through a homogeneous medium, the attenuation of the light intensity is proportional to the initial intensity of the light, the concentration of the light-absorbing substance in the medium, and the distance the light propagates in the medium. This relationship is an exponential relationship, which means that the attenuation of light intensity is continuous and cumulative, which can be expressed as:
[0045] I=I0*e -βL ,
[0046] I is the light intensity at a point in the medium (transmitted light intensity), I0 is the incident light intensity (initial light intensity), e is the natural base, β is the light attenuation coefficient, and L is the path length that the light travels through the medium.
[0047] Using the above relationship between light intensity and medium, calculate the underwater light attenuation coefficient.
[0048] Step 104: Acquire an underwater image using a binocular camera, and extract background light value and depth information from the underwater image.
[0049] The background light value generally refers to the light intensity or brightness level of the background area when taking photos or videos. This value is very important for correct exposure and achieving ideal image quality.
[0050] Depth information is determined by capturing two images of the same scene from different positions using the two cameras of a stereo camera and then calculating the difference between the two images.
[0051] Step 106 , processing the underwater image according to the light attenuation coefficient, the background light value and the depth information in combination with the Jaffe-McGlamery model to obtain a target image.
[0052] According to the Jaffe-McGlamery model, the imaging process of underwater images satisfies:
[0053] S(x)=J(x)*e -βd(x) +B(x)*(1-e -βd(x) )
[0054] S is the underwater blurred image obtained after scattering attenuation, J is the clear image without scattering attenuation, e is the natural base, β is the underwater light attenuation coefficient, B is the background light value of the underwater image, d is the depth information, and x is the position of each pixel.
[0055] The light attenuation coefficient, background light value and depth information obtained in step 102 and step 104 are substituted into the Jaffe-McGlamery model to process the original underwater image obtained by the binocular camera and obtain a target image with higher visual quality.
[0056] In one embodiment, a binocular camera can also be used to obtain the three-dimensional depth information of the target object through stereo vision technology, shield the scattered light signal, retain the ballistic light signal, and combine the defogging algorithm to defog and fuse the two-dimensional blurred images obtained by the left and right cameras to obtain a three-dimensional clear image, thereby further improving the optical imaging quality. The principle diagram is shown in FIG. Figure 2 shown.
[0057] In one embodiment, step 102 includes: obtaining a first optical power reading when the laser emitted by the laser reaches the optical power meter in an environment without underwater medium transmission; obtaining a second optical power reading when the laser emitted by the laser reaches the optical power meter in an environment with underwater medium transmission; constructing a corresponding equation for the first optical power degree and a corresponding equation for the second optical power degree based on the Lambert-Beer law, and obtaining the light attenuation coefficient by the simultaneous equations.
[0058] This embodiment uses a self-made attenuation coefficient measurement module to measure the light attenuation coefficient. Figure 3 As shown, the experimental platform includes a laser on the left side of the experimental platform, a medium cabin with a length of L and transparent at both ends in the middle, water inlets and outlets on the upper and lower parts of the medium cabin, and an optical power meter, an FPGA development board and an LED display screen on the right side.
[0059] The principle of measuring the attenuation coefficient is based on the Lambert-Beer law. Assuming that the light transmittance of the transparent glass sheets at both ends of the medium cabin is α, and the initial stable power of the laser is I0, when the medium cabin is empty, the laser passes through the two transparent glass sheets of the medium cabin and hits the optical power meter in a straight line. At this time, the first optical power reading X of the optical power meter should be X=I0*α*α. When the medium cabin is full (filled with underwater media), the laser passes through the two transparent glass sheets of the medium cabin and the water body and hits the optical power meter in a straight line. At this time, the second optical power reading Y of the optical power meter should be Y=I0*α*e -βL *α. β represents the light attenuation coefficient. Arranging the above two equations, we get X / Y=e βL Taking the logarithm of the above equation, we get ln(X / Y) = βL. Finally, we can get the expression of the light attenuation coefficient β: β = ln(X / Y) / L.
[0060] The output signal of the optical power meter is connected to the ADC (Analog-to-Digital Converter) module of the FPGA. According to the above formula, Verilog code is written to implement data reading of the ADC module, calculation of the light attenuation coefficient value, and driving of the LED display, so that real-time light attenuation coefficient value acquisition and display can be achieved.
[0061] Before using the attenuation coefficient measurement module, you need to place the blue-green laser, the medium cabin with a length of L and the optical power meter on a stable platform, calibrate the laser, medium cabin and optical power meter on the same straight line, and use the optical power meter to measure the optical power emitted by the laser to ensure that the equipment is calibrated to the same reference. In addition, take appropriate safety measures when operating the laser, wear laser protection glasses, and ensure that no one will look directly at the laser beam during the experiment.
[0062] When using the attenuation coefficient measurement module, take a water sample on-site in the imaging environment, add it to the medium chamber of the homemade attenuation coefficient measuring instrument, and slowly add the water sample through the water inlet until the medium chamber is full, taking care to avoid bubbles. After the medium chamber is full, let it stand for a few minutes to eliminate bubbles and fluctuations caused by adding water. Turn on the laser and let it run stably for 5-10 minutes. At the same time, make sure that the laser beam passes through the water in the medium chamber and directly hits the sensor of the optical power meter. Check the reading results of the optical power meter and the LED display reading results to ensure that the data is accurate and record the optical attenuation coefficient.
[0063] In one embodiment, in step 104, extracting the background light value in the underwater image includes: obtaining the grayscale distribution characteristics of the underwater image; dividing the underwater image into a number of local areas based on the grayscale distribution characteristics using a quadtree, calculating a grayscale histogram for each local area, and determining an adaptive threshold corresponding to each local area according to the distribution of the grayscale histogram; if the absolute average deviation of the grayscale value of the local area is greater than the adaptive threshold, recursively dividing the local area until the absolute average deviation of the grayscale value of the divided area is less than the adaptive threshold, and marking the area that meets the adaptive threshold as a candidate area if the difference between the grayscale mean value of the area corresponding to the grayscale mean of the adjacent area meets the preset conditions; calculating the grayscale consistency weight and the area area weight for each candidate area, combining the grayscale consistency weight and the area area weight to obtain a comprehensive weight; weighted averaging the candidate areas based on the comprehensive weight to obtain the background light value.
[0064] Quadtree hierarchical search is an image processing technique that recursively divides an image into four parts (quadrants) to construct a tree structure, with each node representing an area of the image. In the estimation of background light values in underwater images, this method refines the search layer by layer from macro to micro, first estimating the background light in a large area, then gradually going deeper into smaller sub-areas, and optimizing the estimated value of the background light by analyzing the brightness distribution of each area. This method can effectively reduce the amount of calculation while maintaining sensitivity to changes in background light, so that the background light value can be estimated more accurately in complex underwater environments.
[0065] Based on the traditional quadtree hierarchical search, this application proposes an improved quadtree hierarchical search algorithm with adaptive threshold adjustment to accurately estimate the background light value of underwater images. The algorithm first performs statistical analysis on the blurred original underwater image, calculates its grayscale mean and standard deviation, and then initializes the root node of the quadtree, taking the entire image as the starting area. Then, the algorithm divides the image into multiple local areas, calculates the grayscale histogram for each area, and determines the adaptive threshold.
[0066] Specifically, first, perform basic statistical analysis on the original underwater image and calculate its overall grayscale mean μ and standard deviation σ to understand the grayscale distribution characteristics of the image. Initialize the root node of the quadtree, take the entire image as the area represented by the root node, and divide it into several non-overlapping local areas, such as square areas with a fixed size of 16×16 pixels. For each local area, calculate its grayscale histogram, and determine the adaptive threshold based on the distribution of the histogram.
[0067] Then, recursively divide each region into four sub-regions until the grayscale standard deviation within the sub-region is less than the adaptive threshold. For the region represented by each leaf node, calculate the mean absolute deviation (MAD) of its internal grayscale value. If MAD is less than the adaptive threshold, the grayscale stability of the region is considered to be high. Calculate the percentage difference between the grayscale mean of the region and the grayscale mean of the surrounding area. If the difference is less than 10%, it is considered that the region has a high correlation with the background light. For regions that meet the above conditions, they are marked as background light candidate regions and given priority. For each background light candidate region, calculate its grayscale consistency weight w1=1-MAD / adaptive threshold, and calculate the region area weight w2. Combine the grayscale consistency weight and the region size weight to obtain the comprehensive weight w of each region. For all regions marked as background light candidates, use the comprehensive weight to calculate the weighted average of the background light value B. The specific formula is: Among them, w i is the comprehensive weight of the ith region, mean(I i ) is the grayscale mean of the ith region.
[0068] In one embodiment, determining the adaptive threshold corresponding to each local area according to the distribution of the grayscale histogram includes: if the grayscale histogram presents a bimodal distribution, taking the valley value between the two peaks as the basic threshold, otherwise obtaining the basic threshold based on the OTSU algorithm; calculating the overall grayscale mean of the underwater image and the grayscale mean of each local area according to the grayscale distribution characteristics; if the grayscale mean of the local area is lower than a first preset value, taking a first multiple of the basic threshold as the adaptive threshold; if the grayscale mean of the local area is higher than a second preset value, taking a second multiple of the basic threshold as the adaptive threshold; if the grayscale mean of the local area is not lower than the first preset value and not higher than the second preset value, taking the basic threshold as the adaptive threshold; wherein the first preset value and the second preset value are both determined according to the overall grayscale mean of the underwater image.
[0069] If the grayscale histogram presents a bimodal distribution, the valley value between the two peaks is used as the basic threshold; otherwise, the OTSU algorithm principle is applied to find the threshold that maximizes the inter-class variance as the basic threshold.
[0070] Then, the threshold is quantitatively adjusted according to the grayscale mean of the local area: if the average grayscale of the area is lower than 80% of the overall mean (i.e., the first preset value), the threshold is adjusted to 90% of the basic threshold (i.e., the first multiple); if it is higher than 120% of the overall mean (i.e., the second preset value), it is adjusted to 110% of the basic threshold (i.e., the second multiple).
[0071] The specific formula is:
[0072] Where T0 is the basic threshold, μ r is the regional grayscale mean.
[0073] In MATLAB, you can use the graythresh function to implement the OTSU algorithm, calculate the basic threshold, and use the mean function to calculate the grayscale mean of each area.
[0074] In this example, the adaptive threshold takes into account the bimodal distribution of the histogram, the OTSU algorithm, and the adjustment of the average grayscale of the region. This adaptive threshold determination method enables the algorithm to better adapt to different image regions and changes in the underwater environment, thereby more accurately estimating the background light value. In this way, the algorithm can more effectively handle complex situations in underwater images and improve the accuracy of background light value estimation.
[0075] In one embodiment, in step 104, extracting depth information from the underwater image includes: comparing underwater images from two perspectives respectively acquired by the binocular camera; performing feature point matching on the underwater images from the two perspectives, and calculating the parallax of the feature points in the two images; and calculating the depth information in combination with the geometric configuration and parallax of the binocular camera; wherein the geometric configuration includes the focal length and the baseline distance.
[0076] The key steps to obtain depth information include: first, image capture, using a binocular camera to simultaneously shoot the same scene to obtain images from two perspectives. Then feature matching, finding matching feature points in the two images, these feature points are some unique points in the image, such as corners, edges or texture points, they can be identified and matched in both perspectives. The second is disparity calculation, calculating the horizontal pixel difference between the matching feature points in the two images. This difference is called disparity, and the size of the disparity is inversely proportional to the distance from the feature point to the camera. Finally, depth calculation, using the geometric configuration of the camera (including the baseline distance and focal length between the cameras) and the disparity value, the depth information of the feature point is calculated through the principle of triangulation.
[0077] The depth information Z can be calculated by the following formula: Z = B*f / D, where f is the focal length of the camera, B is the baseline distance between the two cameras, and D is the parallax. After the depth of all matching feature points is calculated, a depth map can be generated to represent the depth information of each point in the scene.
[0078] In this embodiment, feature matching can use the SIFT feature point detection algorithm to identify key points in the image, use the SIFT descriptor to generate feature vectors for the filtered feature points, and then match the feature points of the left and right views, usually by comparing the similarity of the feature vectors.
[0079] In MATLAB, you can use the functions in the Stereo Vision Toolbox to implement binocular vision feature matching, disparity calculation, and depth map generation.
[0080] The present invention innovatively combines a binocular camera with actual measurement of the attenuation coefficient, fully considers the depth information of the target object and the influence of underwater attenuation, and proposes an improved quadtree hierarchical search algorithm with adaptive threshold adjustment to obtain the background light value. Starting from multiple angles, a new algorithm to improve imaging quality is formed.
[0081] In addition, the attenuation coefficient measurement module can measure the attenuation coefficient in the underwater environment in real time, while the existing image processing technology often relies on empirical models or preset values and cannot adapt to the dynamically changing underwater environment. At the same time, the attenuation coefficient measurement module reduces the cost of attenuation coefficient measurement, making underwater image quality improvement technology more economical and easy to popularize.
[0082] It should be understood that, although the various steps in the flowcharts involved in the above-mentioned embodiments are displayed in sequence according to the indication of the arrows, these steps are not necessarily executed in sequence according to the order indicated by the arrows. Unless there is a clear explanation in this article, the execution of these steps does not have a strict order restriction, and these steps can be executed in other orders. Moreover, at least a part of the steps in the flowcharts involved in the above-mentioned embodiments can include multiple steps or multiple stages, and these steps or stages are not necessarily executed at the same time, but can be executed at different times, and the execution order of these steps or stages is not necessarily to be carried out in sequence, but can be executed in turn or alternately with other steps or at least a part of the steps or stages in other steps.
[0083] Based on the same inventive concept, the embodiment of the present application also provides an underwater image processing device for implementing the underwater image processing method involved above. The implementation solution provided by the device to solve the problem is similar to the implementation solution recorded in the above method, so the specific limitations in one or more underwater image processing device embodiments provided below can refer to the limitations of the underwater image processing method above, and will not be repeated here.
[0084] In one embodiment, an underwater image processing device is provided, comprising:
[0085] The attenuation coefficient measurement module is used to obtain the underwater light attenuation coefficient by measuring the optical power change of the laser emitted by the laser in the underwater medium transmission process using an optical power meter;
[0086] An image parameter extraction module is used to obtain underwater images using a binocular camera and extract background light values and depth information from the underwater images;
[0087] The image processing module is used to process underwater images according to the light attenuation coefficient, background light value and depth information in combination with the Jaffe-McGlamery model to obtain the target image.
[0088] In one embodiment, the attenuation coefficient measurement module is also used to: obtain a first optical power reading when the laser emitted by the laser reaches the optical power meter in an environment without underwater medium transmission; obtain a second optical power reading when the laser emitted by the laser reaches the optical power meter in an environment with underwater medium transmission; construct a corresponding equation for the first optical power degree and a corresponding equation for the second optical power degree based on the Lambert-Beer law, and obtain the optical attenuation coefficient by using the simultaneous equations.
[0089] In one embodiment, the image parameter extraction module is also used to: obtain the grayscale distribution characteristics of the underwater image; divide the underwater image into several local areas based on the grayscale distribution characteristics using a quadtree, calculate the grayscale histogram for each local area, and determine the adaptive threshold corresponding to each local area according to the distribution of the grayscale histogram; if the absolute average deviation of the grayscale value of the local area is greater than the adaptive threshold, recursively divide the local area until the absolute average deviation of the grayscale value of the divided area is less than the adaptive threshold, and mark the area that meets the adaptive threshold as a candidate area if the difference between the grayscale mean value of the area corresponding to the grayscale mean of the adjacent area meets the preset conditions; calculate the grayscale consistency weight and the area area weight for each candidate area, and obtain the comprehensive weight by combining the grayscale consistency weight and the area area weight; weighted average the candidate areas based on the comprehensive weight to obtain the background light value.
[0090] In one embodiment, if the grayscale histogram presents a bimodal distribution, the valley between the two peaks is used as the basic threshold, otherwise the basic threshold is obtained based on the OTSU algorithm. The image parameter extraction module is also used to: calculate the overall grayscale mean of the underwater image and the grayscale mean of each local area according to the grayscale distribution characteristics; if the grayscale mean of the local area is lower than the first preset value, the first multiple of the basic threshold is used as the adaptive threshold; if the grayscale mean of the local area is higher than the second preset value, the second multiple of the basic threshold is used as the adaptive threshold; if the grayscale mean of the local area is not lower than the first preset value and not higher than the second preset value, the basic threshold is used as the adaptive threshold; wherein the first preset value and the second preset value are both determined according to the overall grayscale mean of the underwater image.
[0091] In one embodiment, the gray consistency weight is determined according to the absolute average deviation of the candidate region, and the region area weight is determined according to the proportion of the candidate region area in the underwater image area.
[0092] In one embodiment, the image parameter extraction module is also used to: compare underwater images from two perspectives respectively acquired by the binocular camera; perform feature point matching on the underwater images from the two perspectives, and calculate the parallax of the feature points in the two images; calculate depth information by combining the geometric configuration and parallax of the binocular camera; wherein the geometric configuration includes focal length and baseline distance.
[0093] Each module in the underwater image processing device can be implemented in whole or in part by software, hardware, or a combination thereof. Each module can be embedded in or independent of a processor in a computer device in the form of hardware, or can be stored in a memory in a computer device in the form of software, so that the processor can call and execute operations corresponding to each module.
[0094] In one embodiment, a computer device is provided, including a memory and a processor, wherein a computer program is stored in the memory, and the processor implements the steps in all the above method embodiments when executing the computer program.
[0095] In one embodiment, a computer-readable storage medium is provided, on which a computer program is stored. When the computer program is executed by a processor, the steps in all the above method embodiments are implemented.
[0096] In one embodiment, a computer program product is provided, including a computer program, which implements the steps in all the above method embodiments when executed by a processor.
[0097] Those of ordinary skill in the art can understand that all or part of the processes in the above-mentioned embodiment methods can be completed by instructing the relevant hardware through a computer program, and the computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, any reference to the memory, database or other medium used in the embodiments provided in the present application can include at least one of non-volatile and volatile memory. Non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory, optical memory, high-density embedded non-volatile memory, resistive random access memory (ReRAM), magnetic random access memory (MRAM), ferroelectric random access memory (FRAM), phase change memory (PCM), graphene memory, etc. Volatile memory can include random access memory (RAM) or external cache memory, etc. As an illustration and not limitation, RAM can be in various forms, such as static random access memory (SRAM) or dynamic random access memory (DRAM). The database involved in each embodiment provided in this application may include at least one of a relational database and a non-relational database. Non-relational databases may include distributed databases based on blockchains, etc., but are not limited thereto. The processors involved in each embodiment provided in this application may be general-purpose processors, central processing units, graphics processors, digital signal processors, programmable logic devices, data processing logic devices based on quantum computing, etc., but are not limited thereto.
[0098] The technical features of the above embodiments may be arbitrarily combined. To make the description concise, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.
[0099] The above-described embodiments only express several implementation methods of the present application, and the descriptions thereof are relatively specific and detailed, but they cannot be understood as limiting the scope of the present application. It should be pointed out that, for a person of ordinary skill in the art, several variations and improvements can be made without departing from the concept of the present application, and these all belong to the protection scope of the present application. Therefore, the protection scope of the present application shall be subject to the attached claims.
Claims
1. An underwater image processing method, characterized in that: The method comprises: The optical power meter is used to measure the optical power change of the laser emitted by the laser during the transmission process of the underwater medium to obtain the underwater light attenuation coefficient; Acquire an underwater image using a binocular camera, and extract background light value and depth information from the underwater image; The underwater image is processed according to the light attenuation coefficient, the background light value and the depth information in combination with a Jaffe-McGlamery model to acquire a target image.
2. The method according to claim 1, characterized in that The method of using an optical power meter to measure the optical power change of the laser emitted by the laser during the transmission process of the underwater medium to obtain the underwater light attenuation coefficient includes: Obtaining a first optical power reading when the laser emitted by the laser reaches the optical power meter in a transmission environment without an underwater medium; Obtaining a second optical power reading when the laser emitted by the laser reaches the optical power meter in an underwater medium transmission environment; An equation corresponding to the first optical power degree and an equation corresponding to the second optical power degree are constructed based on the Lambert-Beer law, and the light attenuation coefficient is obtained by using the simultaneous equations.
3. The method according to claim 1, characterized in that Acquiring an underwater image using a binocular camera, extracting a background light value in the underwater image includes: Acquiring grayscale distribution characteristics of the underwater image; Dividing the underwater image into a plurality of local areas based on the grayscale distribution characteristics using a quadtree, calculating a grayscale histogram for each of the local areas, and determining an adaptive threshold corresponding to each of the local areas according to the distribution of the grayscale histogram; If the absolute average deviation of the grayscale value of the local area is greater than the adaptive threshold, the local area is recursively divided until the absolute average deviation of the grayscale value of the divided area is less than the adaptive threshold, and the grayscale mean difference between the grayscale mean of the area corresponding to the adaptive threshold and the adjacent area meets the preset condition, and is marked as a candidate area; Calculating the grayscale consistency weight and the regional area weight for each of the candidate regions, and combining the grayscale consistency weight and the regional area weight to obtain a comprehensive weight; The candidate regions are weighted averaged based on the comprehensive weight to obtain the background light value.
4. The method according to claim 3, characterized in that The step of determining the adaptive threshold corresponding to each of the local areas according to the distribution of the grayscale histogram comprises: If the grayscale histogram presents a bimodal distribution, the valley value between the two peaks is used as the basic threshold, otherwise the basic threshold is obtained based on the OTSU algorithm; Calculate the overall grayscale mean of the underwater image and the grayscale mean of each of the local areas according to the grayscale distribution characteristics; If the grayscale mean value of the local area is lower than the first preset value, the first multiple of the basic threshold value is used as the adaptive threshold value; if the grayscale mean value of the local area is higher than the second preset value, the second multiple of the basic threshold value is used as the adaptive threshold value; if the grayscale mean value of the local area is not lower than the first preset value and not higher than the second preset value, the basic threshold value is used as the adaptive threshold value; Wherein, the first preset value and the second preset value are both determined according to the overall grayscale mean value of the underwater image.
5. The method according to claim 3, characterized in that: The grayscale consistency weight is determined according to the absolute average deviation of the candidate region, and the region area weight is determined according to the proportion of the candidate region area in the underwater image area.
6. The method according to claim 1, characterized in that Acquiring an underwater image using a binocular camera, and extracting depth information from the underwater image includes: Comparing the underwater images from two perspectives respectively acquired by the binocular camera; Performing feature point matching on the underwater images of two viewing angles, and calculating the parallax of the feature points in the two images; Calculating the depth information by combining the geometric configuration of the binocular camera and the parallax; Wherein, the geometric configuration includes focal length and baseline distance.
7. An underwater image processing device, characterized in that: The device comprises: The attenuation coefficient measurement module is used to obtain the underwater light attenuation coefficient by measuring the optical power change of the laser emitted by the laser in the underwater medium transmission process using an optical power meter; An image parameter extraction module is used to obtain an underwater image using a binocular camera and extract background light value and depth information from the underwater image; The image processing module is used to process the underwater image according to the light attenuation coefficient, the background light value and the depth information in combination with the Jaffe-McGlamery model to obtain a target image.
8. A computer device comprising a memory and a processor, wherein the memory stores a computer program, wherein: When the processor executes the computer program, the steps of the method according to any one of claims 1 to 6 are implemented.
9. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 6 are implemented.
10. A computer program product, comprising a computer program, characterized in that When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 6 are implemented.