Target positioning method, apparatus and electronic device
By performing data augmentation and quantization on raw binocular images in the underwater environment, the problem of insufficient robustness of parallax estimation in turbid water was solved, and real-time and efficient depth estimation was achieved on a low-computing-power platform, improving the accuracy and speed of underwater target localization.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- CHINA TELECOM CORP LTD
- Filing Date
- 2026-05-06
- Publication Date
- 2026-06-05
AI Technical Summary
In turbid water bodies, existing technologies rely on complex neural networks for disparity estimation, which makes it difficult to achieve real-time and efficient depth estimation in environments with limited computing resources.
By acquiring raw binocular image pairs in the underwater environment, data augmentation processing is performed, including transmittance estimation and reflectance restoration. A lightweight quantized model is used for disparity estimation to reduce computational overhead and achieve real-time, high-precision target localization.
Without relying on complex neural networks, the computational overhead of image enhancement and depth estimation is significantly reduced, enabling real-time, stable, and high-precision underwater binocular visual positioning on low-computing-power embedded platforms.
Smart Images

Figure CN122156309A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of spatial positioning technology, and more specifically, to a target positioning method, apparatus, and electronic device. Background Technology
[0002] For underwater ranging and reconstruction, related technologies rely on complex neural networks to improve the robustness of disparity estimation in turbid water. The depth estimation network has a high number of parameters and is computationally intensive, resulting in high inference latency and large memory consumption. In environments with limited computing resources, it is difficult to perform efficient and accurate depth estimation in real time.
[0003] There is currently no effective solution to the above problems. Summary of the Invention
[0004] This application provides a target localization method, apparatus, and electronic device to at least solve the technical problem that related technologies rely on complex neural networks to improve the robustness of disparity estimation in turbid water bodies, and it is difficult to perform efficient and accurate depth estimation in real time under environments with limited computing resources.
[0005] According to one aspect of the embodiments of this application, a target localization method is provided, comprising: acquiring an original binocular image pair of a target object in an underwater environment; performing data augmentation on the original binocular image pair to obtain a target binocular image pair, wherein the target binocular image pair is obtained by performing transmittance estimation and reflectance recovery on each color channel of the original binocular imaging based on the underwater environment; performing disparity estimation processing on the target binocular image pair using a target model to obtain a disparity map, wherein the weight parameters of the output channels of the convolutional layers in the target model are quantized based on a corresponding quantization scale, the quantization scale being used to map the weight parameters to integer values within a preset range; and performing underwater localization of the target object based on the disparity map.
[0006] In this embodiment, a channel separation enhancement method is adopted. By estimating the transmittance of each color channel in the underwater environment and restoring its scene reflectance, the original binocular image pair is corrected to obtain the target binocular image pair. Then, through a lightweight model of channel quantization, the weight parameters of the output channels of the convolutional layer are independently quantized to integer values within a preset range for each channel, and the disparity of the target binocular image pair is efficiently estimated. Finally, the target object is spatially located based on the disparity map. This achieves the goal of significantly reducing the computational overhead of image enhancement and depth estimation without relying on complex end-to-end neural networks. This achieves the technical effect of real-time, stable, and high-precision underwater binocular visual positioning on a low-computing-power embedded platform. This solves the technical problem that related technologies rely on complex neural networks to improve the robustness of disparity estimation in turbid water and are difficult to perform efficient and accurate depth estimation in real time under environments with limited computing resources. Attached Figure Description
[0007] The accompanying drawings, which are included to provide a further understanding of this application and form part of this application, illustrate exemplary embodiments and are used to explain this application, but do not constitute an undue limitation of this application. In the drawings:
[0008] Figure 1 This is a hardware structure block diagram of a computer terminal for a target positioning method according to an embodiment of this application;
[0009] Figure 2 This is a flowchart of a target localization method according to an embodiment of this application;
[0010] Figure 3 This is a flowchart of model training for a target localization method according to an embodiment of this application;
[0011] Figure 4 This is a schematic diagram of a target localization method according to an embodiment of this application;
[0012] Figure 5 This is a schematic diagram of the structure of a target positioning device according to an embodiment of this application. Detailed Implementation
[0013] To enable those skilled in the art to better understand the present application, the technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present application, and not all embodiments. Based on the embodiments in the present application, all other embodiments obtained by those of ordinary skill in the art without creative effort should fall within the scope of protection of the present application.
[0014] It should be noted that the terms "first," "second," etc., in the specification, claims, and accompanying drawings of this application are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It should be understood that such data can be interchanged where appropriate so that the embodiments of this application described herein can be implemented in orders other than those illustrated or described herein. Furthermore, the terms "comprising" and "having," and any variations thereof, are intended to cover non-exclusive inclusion; for example, a process, method, system, product, or apparatus that comprises a series of steps or units is not necessarily limited to those steps or units explicitly listed, but may include other steps or units not explicitly listed or inherent to such processes, methods, products, or apparatus.
[0015] To better understand the embodiments of this application, the technical terms involved in the embodiments of this application are explained below:
[0016] CLAHE (Contrast Limited Adaptive Histogram Equalization): A local contrast enhancement algorithm for image processing that divides an image into small regions and performs histogram equalization on each region while limiting the contrast amplification to suppress noise. In this embodiment, CLAHE is used to further enhance local brightness and contrast on the image after physical optical model reconstruction, thereby enhancing the edge and texture details of underwater scenes.
[0017] GRU (Gate Recurrent Unit): A recurrent neural network architecture that controls information flow through update and reset gate mechanisms to capture long-term dependencies in sequential data. In this embodiment, GRU is used to iteratively optimize sub-pixel disparity maps during multi-scale disparity estimation.
[0018] MACs (Multiply Accumulate operations) refer to the number of times a microprocessor performs multiplication and accumulation operations, and are the core unit for measuring the computational complexity of an algorithm. In the embodiments of this application, MACs are used to quantitatively evaluate the reduction in computational load before and after network pruning, serving as a key indicator for measuring the lightweighting effect and ensuring that the model can run in real time on embedded platforms.
[0019] INT8 (8-bit Integer): An 8-bit signed integer data type used to represent quantized weights or activation values. In this embodiment, INT8 is used to perform post-training quantization on the weights and activations in the trained FP32 depth estimation model, significantly reducing model storage usage and inference power consumption, and enabling efficient deployment on low-computing-power platforms.
[0020] FP32 (32-bit Floating Point): A single-precision floating-point number type with a length of 32 bits, it is a commonly used numerical format for training and inference of deep learning models. In the embodiments of this application, FP32 is used as a baseline precision for model training to generate high-quality disparity maps, and as a reference standard before INT8 quantization to evaluate whether the precision loss after quantization is within an acceptable range.
[0021] BF16 (Brain Floating Point 16): A 16-bit half-precision floating-point number type that maintains a large dynamic range by retaining the same 8-bit exponent as FP32. In this embodiment, BF16 is used as the core computational format for mixed-precision training. While ensuring the model does not experience numerical overflow, it significantly reduces memory usage and increases computational throughput, thereby accelerating the model convergence process while maintaining accuracy comparable to the FP32 benchmark.
[0022] Underwater high-precision autonomous positioning and measurement provides a passive, low-cost, and high-resolution means for the 3D reconstruction and precise positioning of underwater targets. It can obtain relative depth information at the meter or even millimeter level without relying on acoustic positioning or expensive inertial systems, greatly reducing equipment complexity and operating costs. For tasks such as subsea pipeline inspection, shipwreck site exploration, marine habitat monitoring, and nearshore wind power foundation inspection, visual positioning can provide intuitive dense point cloud and geometric semantic information, assisting in automated defect detection, fixed-point sampling, and long-term observation, thereby improving safety and decision-making efficiency.
[0023] Compared to visual perception in air, underwater optical imaging is affected by multiple factors, including light absorption and scattering, color shift, optical turbulence, and reduced visibility due to suspended particles. These factors directly lead to decreased image contrast, loss of feature information, and unstable parallax estimation. Therefore, achieving stable, accurate, and real-time depth recovery under conditions of low visibility, high noise, and non-uniform illumination is one of the core challenges in the field of underwater visual positioning.
[0024] Binocular vision-based localization methods, with their passive, lightweight nature and ability to directly generate dense depth maps, have become an important direction for underwater ranging and reconstruction. Related technologies employ attention-based underwater image enhancement, mask self-training mechanisms, and specialized matching cost and cost aggregation strategies at the algorithmic level to improve matching robustness in turbid waters. Meanwhile, in recent years, deep learning methods have significantly improved the matching ability for low-contrast and repetitive texture regions through end-to-end disparity regression, feature-level domain adaptation, and self-supervised training. However, these methods still face challenges in practical engineering deployments, such as limited computational resources, difficulties in online calibration, and poor inter-domain generalization. Furthermore, in practical applications, due to the need to comprehensively consider factors such as power consumption and long standby times, the computational resources available for binocular localization are limited, making it difficult to perform efficient and accurate depth estimation under real-time conditions.
[0025] To address the aforementioned technical problems, this application provides corresponding solutions, which are detailed below.
[0026] The target positioning method embodiments provided in this application can be executed on mobile terminals, computer terminals, or similar computing devices. Figure 1 A hardware structure block diagram of a computer terminal for implementing a target localization method is shown. Figure 1As shown, the computer terminal 10 may include one or more processors (shown as 102a, 102b, ..., 102n in the figure) (the processor may include, but is not limited to, a microprocessor MCU or a programmable logic device FPGA, etc.), a memory 104 for storing data, and a transmission module 106 for communication functions connected via wired and / or wireless networks. In addition, it may also include: a display, a keyboard, a cursor control device, an input / output interface (I / O interface), a universal serial bus (USB) port (which may be included as one of the ports of the I / O interface), a network interface, and a BUS bus. Those skilled in the art will understand that... Figure 1 The structure shown is for illustrative purposes only and does not limit the structure of the aforementioned electronic device. For example, computer terminal 10 may also include... Figure 1 The more or fewer components shown, or having the same Figure 1 The different configurations shown.
[0027] It should be noted that the aforementioned one or more processors and / or other data processing circuits are generally referred to herein as "data processing circuits". These data processing circuits may be embodied, in whole or in part, in software, hardware, firmware, or any other combination thereof. Furthermore, the data processing circuits may be a single, independent processing module, or may be integrated, in whole or in part, into any other element within the computer terminal 10. As involved in the embodiments of this application, the data processing circuits serve as a processor control mechanism (e.g., selection of a variable resistor termination path connected to an interface).
[0028] The memory 104 can be used to store software programs and modules of application software, such as the program instructions / data storage device corresponding to the target positioning method in this embodiment. The processor executes various functional applications and data processing by running the software programs and modules stored in the memory 104, thereby realizing the target positioning method described above. The memory 104 may include high-speed random access memory, and may also include non-volatile memory, such as one or more magnetic storage devices, flash memory, or other non-volatile solid-state memory. In some instances, the memory 104 may further include memory remotely located relative to the processor, and these remote memories can be connected to the computer terminal 10 via a network. Examples of such networks include, but are not limited to, the Internet, corporate intranets, local area networks, mobile communication networks, and combinations thereof.
[0029] The transmission module 106 is used to receive or send data via a network. Specific examples of the network described above may include a wireless network provided by the communication provider of the computer terminal 10. In one example, the transmission module 106 includes a network interface controller (NIC), which can connect to other network devices via a base station to communicate with the Internet. In another example, the transmission module 106 may be a radio frequency (RF) module, used for wireless communication with the Internet.
[0030] The display can be, for example, a touchscreen liquid crystal display (LCD) that allows the user to interact with the user interface of the computer terminal 10.
[0031] It should be noted here that, in some optional embodiments, the above... Figure 1 The computer terminal shown may include hardware elements (including circuitry), software elements (including computer code stored on a computer-readable medium), or a combination of both hardware and software elements. It should be noted that... Figure 1 This is only one instance of a specific particular instance, and is intended to illustrate the types of components that may exist in the aforementioned computer terminal.
[0032] In the above operating environment, this application provides an embodiment of a target localization method. It should be noted that the steps shown in the flowchart in the accompanying drawings can be executed in a computer system such as a set of computer-executable instructions. Although a logical order is shown in the flowchart, in some cases, the steps shown or described may be executed in a different order than that shown here.
[0033] Figure 2 This is a flowchart of a target localization method according to an embodiment of this application, such as... Figure 2 As shown, the method includes the following steps:
[0034] Step S202: Obtain the original binocular image pair of the target object in the underwater environment.
[0035] In step S202 above, the target object refers to an entity that needs to be located in three-dimensional space in the underwater environment, such as submarine pipelines, shipwreck structures, underwater structures or organisms. The target object does not refer to any object in general, but specifically refers to a rigid or semi-rigid target that has geometric structural features and can be recognized by a visual system and whose spatial position can be reconstructed.
[0036] The original binocular image pair refers to the pair of data consisting of left and right view images captured at the same time by a pair of calibrated, spatially fixed and synchronously acquired underwater cameras. It contains the projection information of the target object under different viewpoints. It should be noted that due to underwater light absorption and scattering effects, the original image pair generally suffers from degradation phenomena such as low contrast, color shift and texture blur.
[0037] The underwater environment refers to a complex optical propagation space that includes water, suspended particles, light attenuation, and color shift effects. It can be modeled as a physical system with channel-specific light attenuation coefficients. Its absorption rates for the red, green, and blue color channels differ significantly, directly affecting the brightness distribution and contrast structure of each channel in the image.
[0038] In some embodiments of this application, in underwater communication infrastructure inspection tasks, the target object can be, for example, communication node equipment deployed on the seabed or underwater structures, such as underwater optical communication terminals, fiber optic junction boxes, repeaters, or underwater interface compartments. These devices are exposed to the high-pressure, high-salinity, low-light, and strongly scattering marine environment for extended periods. Their surfaces are susceptible to biological adhesion, sediment coverage, and seawater corrosion, leading to blurred optical windows, structural deformation, loose connections, or sealing failure. It should be noted that communication node equipment is often a precision assembly of metal and composite materials, with surfaces containing numerous repetitive structures (such as bolt arrays, flange grooves, cable perforations), specular reflection areas, and deep recessed areas. These areas are highly prone to forming "pseudo-textures" under scattered light, meaning that different physical areas have similar brightness due to differences in light reflection angles, surface materials, or water turbidity. This results in spatially similar but actually uncorrelated grayscale patterns in the image, severely interfering with the stereo matching algorithm's identification of the true structural boundaries.
[0039] Specifically, for image acquisition of communication node equipment, a binocular industrial camera can be mounted on an underwater inspection robot. During the acquisition process, triple interference suppression can be achieved through band selection and dynamic exposure.
[0040] (1) Red light illumination: penetrates the metal oxide layer and biological attachments, reduces the brightness of the mirror surface, and separates the real edge from the reflection artifact;
[0041] (2) Blue light illumination: Utilizing its strong penetrability, deep recessed structures (such as sealing grooves and bolt holes) form stable dark areas due to the lack of light entering, forming a clear boundary with highly reflective areas;
[0042] (3) White light + red light combined dynamic exposure: The image is partitioned and the exposure is shortened for high reflective areas (flange surface) and extended for low reflective areas (threads, holes). Local brightness balance is achieved within a single frame to avoid texture blurring and information loss caused by global exposure.
[0043] After each round of acquisition, the binocular camera directly outputs 12-bit RAW format image pairs. Finally, in a controlled underwater optical environment, the industrial camera directly captures the photoelectric sensing data set that reflects the physical reality under precise timing and lighting conditions, resulting in the original binocular image pairs.
[0044] Step S204: Perform data augmentation on the original binocular image pair to obtain the target binocular image pair, wherein the target binocular image pair is obtained by estimating the transmittance and restoring the reflectance of each color channel of the original binocular imaging based on the underwater environment.
[0045] In step S204 above, data augmentation is a preprocessing procedure used in this application to restore the true optical properties of underwater images. Through physical modeling, ambient light interference is suppressed, channel attenuation differences are corrected, and the true reflectivity of the scene is restored, thereby constructing a high-quality input image pair with geometric and photometric consistency, including but not limited to transmittance estimation and reflectivity restoration.
[0046] Transmittance estimation refers to estimating the proportion of light that is not absorbed or scattered during its propagation from a scene point to the camera in an underwater optical model. Since the transmittance of each color channel (red, green, and blue) varies independently due to different absorption coefficients in the water, for example, red light attenuates extremely quickly in deep water, resulting in a much lower transmittance than blue light. In some embodiments of this application, transmittance distribution is estimated channel by channel through dark channel priors and guided filtering, accurately characterizing the propagation characteristics of different wavelengths in water. Reflectance recovery refers to the process of inferring the intrinsic reflectance of a scene from an observed image, ambient light, and transmittance using a physical model. This directly restores the intrinsic color and brightness distribution of the scene, eliminating color shifts caused by water (such as an overall bluish tint or missing red light).
[0047] In some embodiments of this application, the local minimum brightness value of each color channel (red, green, blue) of the original binocular image can be extracted first to form a channel-independent "dark channel map". This dark channel map can effectively reflect the areas in the image most likely to be blocked or attenuated by water; the lower the brightness value, the lower the transmittance of that area. Subsequently, by statistically analyzing the top percentage of pixels with the highest brightness in the dark channel map, the global ambient light component is estimated inversely. Based on this, an initial transmittance estimate is constructed using an empirical scaling factor and the dark channel value. Furthermore, using a grayscale image as a guide map, a guided filtering algorithm is employed to smooth the edges of the transmittance of each channel, avoiding abrupt changes in transmittance due to local noise, thereby obtaining a channel-independent transmittance map that highly matches the actual water propagation characteristics.
[0048] Furthermore, after obtaining the channel-by-channel transmittance, reflectance inversion can be performed on each color channel according to the physical imaging model to obtain a preliminary restored reflectance image. Due to the strong absorption of red light by water, the restored red channel may still have significant brightness deficiency. Therefore, a priori-driven channel gain correction mechanism can be introduced: the mean of the three channels is calculated, and the average of the green and blue channels is used as a reference to apply nonlinear gain amplification to the red channel, but an upper limit is set to prevent over-enhancement leading to artifacts. Furthermore, combined with a gray-scale world white balance strategy, overall color normalization is performed on the entire image to ensure that the restored image conforms to the perceptual consistency of the natural scene in terms of overall color temperature.
[0049] In some embodiments of this application, the original stereo image pair can be augmented to obtain a target stereo image pair by: determining a dark channel map corresponding to each color channel in the original stereo image pair, wherein the dark channel value corresponding to each pixel position in the dark channel map is used to reflect the local minimum brightness corresponding to a preset area in the original stereo image pair; determining an initial transmittance based on the dark channel value, wherein the initial transmittance is the ratio of light at each pixel point that is not attenuated when propagating in the underwater environment, estimated based on the dark channel prior; smoothing the initial transmittance based on guided filtering to obtain the target transmittance; determining the reflectance corresponding to the original stereo image based on the target transmittance, wherein the reflectance is used to reflect the original reflected light intensity and color information of the target object when removing interference from the underwater environment; and determining the target stereo image pair based on the reflectance corresponding to multiple color channels respectively.
[0050] It should be noted that the dark channel map is a spatial mapping formed by taking the minimum brightness values of the red, green, and blue color channels in the neighborhood of each pixel in the original stereo image pair, and then taking the global minimum value in the same neighborhood. It reflects the transmission information contained in the darkest pixel in a local area under the influence of suspended particles and light scattering in water. The dark channel map can be used as an unsupervised prior to indirectly estimate the attenuation of light during underwater propagation, without relying on depth sensors or environmental parameters. Guided filtering uses a "guide image" (such as a grayscale brightness map) that is strongly correlated with the target image as a structural prior to perform local linear fitting on the initial transmittance, thereby smoothing noise while preserving object edges and texture details.
[0051] Specifically, for each input frame of the image, a local neighborhood (such as a 7×7 window) is constructed centered on each pixel. Within this neighborhood, the minimum brightness value is extracted for each of the red, green, and blue channels. The smallest of these three minimum values is then used as the dark channel value of that pixel. This results in a single-channel mapping map with the same size as the original image. Subsequently, a normalized weight coefficient w (ranging from 0 to 1) is obtained. Each pixel value in the dark channel map is multiplied by this coefficient and then subtracted from 1 to obtain the initial transmittance distribution. This reflects the physical intuition that "the higher the dark channel value, the lower the transmittance." Furthermore, the dynamic range of transmittance can be flexibly adjusted through the weight w to avoid outliers such as negative values or values greater than 1 in extreme cases.
[0052] Furthermore, using the grayscale image of the original image as the guide image, a local linear model is constructed, and a weighted linear interpolation is performed on the initial transmittance of each pixel. Within each sliding window, the covariance and variance of the grayscale image and the initial transmittance are calculated to obtain the optimal linear coefficients a and b. Then, the results of all windows containing that pixel are integrated by weighted averaging to finally obtain a continuous target transmittance map with preserved edges.
[0053] Furthermore, based on the classic underwater imaging model, the reflectance corresponding to the original binocular image is determined based on the target transmittance. Subsequently, independent white balance correction is performed on the reflectance of the red, green, and blue channels. The gain is dynamically adjusted according to the ratio of the mean of each channel to the global mean, with selective enhancement of the red channel (because water absorbs red light most strongly), while limiting the upper limit of the gain to avoid artifacts. Then, contrast adaptive histogram equalization, gamma correction, and Laplacian sharpening are performed sequentially, finally outputting a pair of target binocular images that conform to human visual perception and retain texture details.
[0054] In some embodiments of this application, after determining the dark channel map corresponding to each color channel in the original binocular image pair, the following steps may be performed: sorting multiple dark channel values in the dark channel map to form a dark channel value sequence; determining a target dark channel value with a preset ratio from the dark channel value sequence, and determining the original pixel corresponding to the pixel position of the target dark channel value; determining the ambient light corresponding to the underwater environment based on the original pixel; and determining the reflectivity based on the ambient light and the target transmittance.
[0055] It should be noted that ambient light refers to the background light component from distant, indirect light sources during underwater imaging, which appears as a uniformly bright background with an overall bluish or greenish tint in the image due to the scattering effect of water.
[0056] Specifically, the dark channel values corresponding to each pixel in the dark channel image are sorted in ascending order from low to high, forming a one-dimensional sequence containing the brightness ranking information of all pixels. Based on experience, a preset proportion (e.g., 0.1% to 1% of the total number of pixels in the image) is set, and the highest-ranking value in the sorted dark channel value sequence is selected as the "target dark channel value," and its spatial position in the original image is recorded. Subsequently, based on these position indices, the red, green, and blue channel values of the corresponding pixels are extracted from the original RGB image.
[0057] Furthermore, the extracted original pixels (such as the top 1% of pixels) are arithmetically averaged across the red, green, and blue channels to obtain the ambient light component values for each of the three channels. Subsequently, based on the classic underwater optical imaging model, the observed image, ambient light, and refined transmittance are substituted into the physical equations for algebraic inversion, and the reflectance of the real scene is calculated pixel by pixel.
[0058] In some embodiments of this application, before determining the dark channel image corresponding to each color channel in the original stereo image pair, the following steps may be performed: determining the average pixel value corresponding to each color channel in the original stereo image pair; comparing the average pixel value corresponding to the first color channel with the average pixel value corresponding to the second color channel to obtain a comparison result, wherein the first color channel includes color channels whose attenuation rate in the underwater environment meets a preset threshold, and the second color channel is a color channel other than the first color channel; and determining color correction for each average pixel value and the second color channel based on the comparison result.
[0059] Specifically, for each frame of the input binocular image pair, the brightness values of all pixels in the red, green, and blue channels are accumulated and averaged channel by channel to obtain the global pixel average value for each channel. To improve robustness, this average value can be limited to the effective area of the image (such as removing edge noise or black border areas), or a sliding window local averaging can be used followed by global aggregation to avoid interference from local strong light or shadow on the statistical results.
[0060] Furthermore, the red channel can be selected as the first color channel (because its attenuation is most significant underwater), and its pixel average value can be compared with the average values of the green and blue second color channels to form a ratio pair. For example, if the red / green ratio is less than a preset threshold (e.g., 0.3) and the red / blue ratio is less than another threshold (e.g., 0.4), it is determined that the red channel has severe attenuation, and a correction mechanism needs to be activated.
[0061] Furthermore, when the average value of the first color channel (e.g., the red channel) is detected to be significantly lower than that of the second color channel (e.g., green, blue), a gain compensation mechanism based on the channel ratio is activated. It should be noted that this process is performed synchronously in the binocular image pair to ensure that the color correction amplitude of the left and right images is consistent and to maintain the photometric consistency of stereo matching.
[0062] The aforementioned color correction mechanism based on channel average value comparison significantly improves the physical rationality of color reproduction. By actively sensing the attenuation difference between channels, it avoids the failure problem of traditional gray-world white balance methods in strong color-biased scenes. Furthermore, it can enhance the reliability of binocular matching by simultaneously correcting the color distribution of the left and right images, ensuring the effectiveness of the photometric consistency constraint in disparity calculation and reducing the mismatch rate. In addition, it can reduce the dependence on training data. This mechanism is entirely based on physical imaging models and statistical features, and does not require end-to-end learning based on a large number of labeled underwater images, thus possessing good generalization and engineering portability.
[0063] In some embodiments of this application, color correction can be performed as follows: when the comparison result indicates that the difference between the average value of the first pixel and the average value of the second pixel is less than a preset threshold, a first target value is determined based on the average pixel values corresponding to multiple color channels, and color correction is performed on multiple color channels based on the first target value, wherein the first target value is used to characterize the neutral grayscale reference value of the original binocular image pair in the grayscale world; when the comparison result indicates that the difference between the average value of the first pixel and the average value of the second pixel is greater than or equal to a preset threshold, a second target value is determined based on the average value of the first pixel and the average pixel value of the second pixel, and color correction is performed on the first color channel using the second target value and on the second color channel using the first target value.
[0064] It should be noted that the first pixel average value refers to the arithmetic mean of the brightness values of all pixels for a specific color channel (such as the red channel) within a local area or the entire image in a binocular vision system. This value reflects the overall brightness response intensity of that color channel in the current underwater environment. The second pixel average value refers to the pixel average value of the other color channels (such as the green and blue channels) in the binocular image pair, excluding the first color channel (such as the red channel). For example, the average value of the green and blue channels can be used as a reference benchmark because its attenuation is less in the underwater environment and it is closer to the neutral grayscale response of the real scene.
[0065] The first target value is a unified reference value calculated from the pixel average of all color channels when the overall color distribution of the image is close to neutral gray (i.e., the difference in average values between channels is small). It is used to characterize the neutral gray level under ideal gray-scale conditions. The second target value is a differentiated correction target constructed based on the difference between the average values of the red channel and the green / blue channels when the red channel is significantly weaker than the other channels (i.e., there is a significant color shift). Its function is to apply non-uniform enhancement only to the red channel, while maintaining a neutral gray reference for the other channels. This accurately compensates for the selective absorption of long-wavelength light by water and avoids artifacts or noise amplification in the green and blue channels.
[0066] Specifically, under conditions of clear water, moderate lighting, or uniform illumination, the absorption of light of different wavelengths by the water body is relatively small, and the image as a whole tends to be neutral gray. At this time, the system performs a weighted average of the pixel values of the red, green, and blue channels as the first target value, that is, the desired ideal neutral gray level. Subsequently, the pixel value of each channel is multiplied by a normalized gain coefficient (the target value divided by the current average value of the channel) to achieve global white balance.
[0067] In turbid, deep-water, or strongly scattering environments, red light is severely attenuated due to intense absorption, while the green and blue channels maintain a high response. In this case, instead of using global uniform correction, the system constructs a second target value. This value is an asymmetric compensation target based on the average values of the red and green / blue channels, serving as the target enhancement amplitude for the red channel. Subsequently, only the red channel is subjected to nonlinear gain amplification driven by this target value (such as using logarithmic mapping or piecewise linear stretching), while the green and blue channels are still corrected for standard grayscale world values according to the first target value.
[0068] To facilitate understanding of the data augmentation process described above, the following explanation will be provided in conjunction with some specific examples.
[0069] It should be noted that the classical atmospheric-oceanic decoherence model can be used as a theoretical basis. Through channel separation, dark channel prior estimation, guided filtering to refine transmittance, physical reflectance recovery, and low-complexity brightness / color correction and local contrast enhancement, the true reflectance of the scene is gradually recovered, while ensuring real-time performance on embedded or computationally limited platforms. For example, a color-channel-wise underwater imaging model can be used, processing each color channel... pixel position ,have:
[0070]
[0071] in, To observe the image, For scene reflectivity, For ambient light, Transmittance. To characterize the different absorption bands in water, each channel is allowed to have independent propagation attenuation characteristics, typically modeled as follows:
[0072]
[0073] in, This is the channel attenuation coefficient. To achieve underwater depth of field for the camera. In actual restoration, and The explicit separation is difficult to estimate directly. This invention employs an indirect estimation based on dark channel priors and a proportional correction strategy for channel separation to achieve low-overhead approximation. .
[0074] Specifically, in some embodiments of this application, for each input pair of original stereo images, the following steps are performed:
[0075] (1) Convert the input to floating-point [0,1] format.
[0076] (2) Perform grayscale world white balance.
[0077] (3) Implement red channel compensation.
[0078] Specifically, for steps (2) and (3), to address the strong selective absorption of red light underwater, this invention proposes a priori-driven channel separation correction strategy combined with simple gray-world white balance. First, the mean value of each channel is calculated. Let the target mean The channel gain is And multiply the image by channel. When the mean value of the red channel is significantly lower than the mean values of the green and blue channels, the red channel is scaled up proportionally, but the maximum gain is limited.
[0079]
[0080] in, The strength coefficient, This is the upper limit of the gain. This strategy compensates for red light loss through simple scaling adjustments, while avoiding over-enhancement that could cause artifacts or disrupt the local texture of binocular matching.
[0081] (4) Calculate the dark channel D(x).
[0082] (5) Estimate ambient light A, i.e., the aforementioned section B.
[0083] Specifically, for steps (4) and (5), the dark channel is used to estimate the local minimum brightness to detect the pixels affected by the weakest transmission:
[0084]
[0085] in, Let be the brightness value at pixel y, color channel c. For a single pixel y, the minimum value among the R, G, and B channels is taken to obtain the "darkest channel brightness" of that pixel. To obtain the "darkest pixel brightness" of a local region, we take the minimum value of the "darkest channel brightness" of all pixels y in the neighborhood Ω(x) centered at x. For The square neighborhood centered on the dark channel. Based on the dark channel sorting method, starting from the largest dark channel... Select the corresponding original pixel from the fractional pixels and calculate its color average to estimate the ambient light. :
[0086]
[0087] here, This is the set of pixels with the highest dark channel values. .
[0088] (6) Calculate the initial transmittance t (x)=1-wD(x).
[0089] Specifically, based on the prior information of the dark channel, the initial transmittance is approximated, and the scaling parameter is used. To mitigate:
[0090]
[0091] To account for the attenuation differences between different channels, this invention employs channel separation or subsequent channel gain correction at the channel level for the initial transmittance, thereby preserving the differences between channels during recovery rather than globally scaling.
[0092] (7) Use guided filtering with grayscale image as guide for t The refinement yields t(x).
[0093] Specifically, to preserve edges and details, a guided filter is used based on the grayscale brightness map to adjust the initial transmittance. Perform smoothing and edge-preserving processing. Let the guiding image be... Then the local linear model of the guided filter is:
[0094]
[0095] In the window Inside, The solution is given by least squares:
[0096]
[0097] The final solution is:
[0098]
[0099] in, To ensure numerical stability, division by zero errors are avoided. The guided filter is implemented as a constant-time convolutional box filter combination, which has low complexity and can be easily and efficiently implemented on both CPUs and GPUs.
[0100] (8) Clip and restore scene reflectivity J.
[0101] Specifically, the corrected and cropped transmittance (with a set lower limit) is used. Restore scene reflectivity:
[0102]
[0103]
[0104] in, To ensure numerical stability and reduce noise amplification when reconstructing shallow transmission regions.
[0105] (9) Perform CLAHE, gamma and sharpening on the recovery results.
[0106] Specifically, the restored image is first subjected to adaptive histogram-limited CLAHE to enhance local brightness contrast, followed by gamma correction and Laplacian sharpening to restore perceptual details.
[0107] (10) If the input is uint8, return uint8 format; otherwise, return floating-point format.
[0108] For example, for underwater communication infrastructure inspection tasks, data augmentation can be achieved through the following steps:
[0109] S1, Input Conversion: Normalize the original binocular image (uint8) to the floating-point range [0,1], retain the original high dynamic range information, avoid edge breakage caused by quantization truncation in metallic highlights and shadow areas, and provide a complete brightness response for subsequent processing.
[0110] S2, Gray World White Balance: Calculates the mean of each channel, sets the target mean to be the average of the three channels, relaxes the upper limit of the gain of the red / blue channels, especially suppresses the excessive enhancement of the blue and green channels, avoids suppressing the low-reflection textures such as weak rust and paint peeling on the surface of the equipment, and improves the sensitivity of defect detection.
[0111] S3, Red Channel Compensation (Mask Guidance): Based on Canny edge detection, a communication node structure mask is generated. Red channel gain compensation is performed only inside the mask (i.e., the device area), while the original value is maintained in the area outside the mask. This prevents the water background from being falsely enhanced and reduces matching noise.
[0112] S4, Dark Channel Estimation (Structure Awareness): Since the traditional minimum dark channel is easily misjudged as low transmittance by local highlights of metal, the local mean can be used instead of the minimum, and morphological opening operations can be applied to remove isolated noise points, retaining only dark areas consistent with the background, ensuring that the transmittance estimation is not interfered with by device reflections.
[0113] S5, Ambient Light Estimation (Background Sampling): Only the first p% of dark channel pixels in the background region outside the structure mask are selected as the candidate set, and candidate points less than 5 pixels from the device edge are excluded to ensure that the ambient light only reflects the real water spectrum and avoids global color shift caused by metal reflection pollution.
[0114] S6, Initial transmittance estimation (regional adaptive w): Within the device mask, reduce the w value to the first value (conservative attenuation suppression) to avoid excessive recovery that would cause distortion of the metal surface texture; maintain the original w value (second value, greater than the first value) in the background region to accurately model the turbidity of the water.
[0115] S7, Guided Filter Refinement (Edge Preservation): The guide image is a weighted fusion of the grayscale image and the Canny edge image (weight 0.7:0.3), which keeps the filter sharp at the device edges and smoothly transitions in the background area, avoiding blurring of the transmittance at the target boundary and ensuring pixel-level geometric consistency of binocular stereo matching.
[0116] S8, Reflectivity Recovery (Region Adaptive Lower Bound) ): Set a lower limit for the equipment area (within the mask) The third value suppresses noise amplification in highly reflective metallic areas; the background area maintains the lower limit. The fourth value (less than the third value) preserves the water depth structure.
[0117] S9, CLAHE + Gamma + Sharpening (Detail Enhancement Control):
[0118] CLAHE: Within the device mask, reduce the contrast limit parameter (e.g., from 40→20) to prevent specular artifacts; in areas with dense microstructures such as bolts and welds, increase the weight of high-frequency components in the local histogram to enhance the contrast of minute defects such as rust spots and cracks.
[0119] Gamma correction: A non-linear piecewise function is used to gently increase the γ value in the low-illuminance area (<0.3) of the equipment (γ=1.2), while keeping γ=1.0 in the high-illuminance area (>0.7) to avoid overexposure of the metal.
[0120] Laplacian sharpening: Applied only in the low-frequency region within the mask, enhancing surface micro-texture without enhancing background water.
[0121] It should be noted that the specific values mentioned above are for illustrative purposes only.
[0122] S10, Output format: Output binocular image pairs while maintaining the original resolution, channel alignment and sub-pixel registration accuracy (error < 0.3 pixels), directly adapting to subsequent depth estimation networks to meet the millimeter-level positioning requirements of communication nodes.
[0123] The above embodiments introduce prior knowledge of the physical structure of communication nodes into underwater visual enhancement, enabling precise control of fine enhancement of the device area and conservative processing of the background area. This significantly improves the detectability of metal surface defects. Furthermore, the transmittance weight w and the cutoff threshold... The CLAHE parameters and gain range are all dynamically adjusted based on the mask, which can break through the limitations of traditional global parameters.
[0124] Step S206: The target model is used to perform disparity estimation on the target binocular image pair to obtain a disparity map. The weight parameters of the output channels of the convolutional layer in the target model are quantized based on the corresponding quantization scale. The quantization scale is used to map the weight parameters to integer values within a preset range.
[0125] In step S206 above, the quantization scale refers to a scaling factor used to map floating-point weight parameters to a preset integer range, thereby establishing a linear mapping relationship between the floating-point domain and the integer domain. In some embodiments of this application, the quantization scale can be calculated independently for each output channel of the convolutional layer. The calculation is based on the maximum absolute value of the weight parameters within that channel. For example, for the c-th output channel, the quantization scale is equal to the ratio of the maximum absolute value of the weights in that channel to the maximum representable value of the INT8 integer (127). This can effectively address the problem of uneven weight magnitude distribution between different channels and avoid precision loss caused by global uniform scaling.
[0126] In some embodiments of this application, the system first loads the trained full-precision floating-point weights. For each convolutional layer, the system iterates through all weight elements channel by channel and calculates the maximum absolute value of the weights in that channel. This value is used as the denominator of the channel-level quantization scale. Subsequently, each weight in that channel is divided by this scale to obtain a normalized floating-point value, which is then rounded and truncated to an integer range of [-128, 127] as the final quantization weight. This process does not depend on fine-tuning of the training data and only requires one forward propagation statistics, which is the post-training quantization strategy.
[0127] During the inference phase, the quantized integer weights are stored in low-power memory, but the actual convolution operation still needs to be completed in the floating-point domain. Before performing convolution, the system multiplies the quantized weights of each channel by their corresponding quantization scale to restore them to approximate floating-point weights (i.e., dequantization), and then performs convolution operation with the input features. This process does not change the network structure, but only inserts a lightweight dequantization step before the calculation. Therefore, it can be seamlessly integrated into existing embedded inference frameworks. This approach avoids the precision collapse and hardware compatibility issues caused by all-integer convolution, while still utilizing integer storage to reduce memory bandwidth pressure.
[0128] In some embodiments of this application, the target model processes the target binocular image pair to obtain a disparity map in the following manner: Multi-scale features of the target binocular image pair are extracted using the feature extractor of the target model, and a cost body is constructed based on the multi-scale features. The cost body records the matching similarity between corresponding pixel blocks of the left and right images in the target binocular image pair at multiple spatial locations and multiple preset disparity values. The cost body is convolved using the quantized convolutional layer of the target model to obtain a geometric code body. The convolution operation dequantizes the weight parameters of the convolutional layer based on the quantization scale and then convolves them with the cost body. The geometric code body is a feature representation that fuses the contextual semantics of the target binocular image pair. The target model iteratively updates the disparity map based on the geometric code body multiple times. During each iteration, the initial disparity map estimated on the first resolution feature map is upsampled to the original resolution and fused with the contextual weights of the second resolution feature map. The resolution of the first resolution feature map is smaller than the resolution of the second resolution feature map.
[0129] It should be noted that the cost volume refers to a four- or five-dimensional data structure that systematically stores the matching similarity between corresponding pixel blocks in the left and right images across multiple spatial locations and multiple preset disparity values. Each dimension corresponds to a batch of samples, a channel group, a disparity level, and height and width, respectively. In some embodiments of this application, the cost volume serves as an intermediate representation carrier for binocular matching. Its construction is based on multi-scale features, ensuring that sufficient matching cues are retained for underwater regions with sparse textures and low contrast at different scales. For example, in turbid water, traditional pixel-level matching is prone to failure due to local texture degradation, while the cost volume, through feature-level similarity aggregation, can capture the semantic consistency encoded by the feature extractor.
[0130] The geometric code volume refers to the high-dimensional feature representation after processing by the context aggregation module. It is an enhanced expression of the cost volume after fusing global contextual semantic information in the spatial and disparity dimensions. The cost volume is subjected to nonlinear transformation and feature fusion through quantized convolutional layers, thereby suppressing noise interference, enhancing the real disparity structure, and restoring the local geometric distortion caused by water scattering.
[0131] Specifically, the feature extractor employs four downsampling units, outputting feature maps at resolutions of 1 / 4, 1 / 8, 1 / 16, and 1 / 32 of the original image, respectively. Each layer uses a depthwise separable convolutional structure to reduce computational burden. The cost body is constructed using a group convolutional channel separation strategy: the feature channels are divided into several groups, and the cross-correlation similarity between the left and right images within a preset disparity range is calculated independently within each group, forming a group-constrained cost body. For example, at 1 / 8 resolution, for each group of 16-channel features, the local cross-correlation value is calculated within a disparity range of ±64 pixels, ultimately constructing a cost body with dimensions B×G×D×H×W, where G is the number of groups and D is the number of disparity layers.
[0132] Furthermore, low-bit inference is achieved through a three-stage process of "dequantization-convolution-weighting". Specifically, during the inference stage, the INT8 convolution kernel weights stored on the embedded platform are dequantized to floating-point intermediate values by their channel-level quantization scale before computation. These weights are then subjected to a standard convolution operation with the cost volume, and the output is uniformly scaled and requantized to INT8 format to save memory. For example, in the 3D Hourglass aggregation module, each 3D convolution layer is encapsulated using a channel-level symmetric quantization wrapper. Without altering the network topology, this allows 3D convolutions that would normally require FP32 computation to run on edge computing chips that only support INT8 acceleration.
[0133] Furthermore, in the first iteration, an initial disparity map is generated at 1 / 16 resolution, which is then bilinearly upsampled and mapped back to the original resolution. At this point, the system extracts local gradient weights from the 1 / 8 resolution feature map. These weights represent the texture confidence of each pixel (such as edge response intensity) and are used as fusion coefficients to be weighted and superimposed onto the high-resolution disparity map. The second iteration updates the disparity at 1 / 8 resolution and fuses it with the context features from 1 / 4 resolution, and so on.
[0134] In some embodiments of this application, the convolutional layers of the target model include a first convolutional layer, a second convolutional layer, and a third convolutional layer. Based on this, the quantized convolutional layers of the target model can perform convolution operations on the cost body in the following manner to obtain a geometric code body: The first convolutional layer of the target model is used to perform channel dimensionality reduction on the cost body to obtain a first intermediate feature, wherein the first convolutional layer is used to reduce the number of channels in the cost body to the median rank, and the median rank is determined by the rank ratio; the second convolutional layer is used to perform spatial filtering on each channel of the first intermediate feature to obtain a second intermediate feature, wherein the second convolutional layer includes depthwise convolution; the third convolutional layer is used to perform channel recovery on the second intermediate feature to obtain a geometric code body, wherein the number of channels in the geometric code body is the same as the number of channels in the cost body, and the third convolutional layer has the same structure as the first convolutional layer.
[0135] It should be noted that the first, second, and third convolutional layers together constitute a staged combination of convolutional operators, belonging to the depthwise separable convolutional structure in structured pruning. The first convolutional layer is a 1×1 point convolution, responsible for channel dimensionality reduction, compressing the high-dimensional cost volume to an intermediate rank, reducing the computational scale of subsequent layers. The second convolutional layer is a depthwise convolution, performing independent spatial filtering on each channel, preserving the original receptive field and avoiding aliasing between channels; it is the core of spatial feature extraction. The third convolutional layer has the same structure as the first convolutional layer, used to restore the compressed intermediate features to the original channel dimension, ensuring that the output geometric code volume is consistent with the original input dimension, maintaining the integrity of the network structure and the compatibility of subsequent modules.
[0136] Specifically, a linear projection is performed on the channel dimension using a 1×1 convolutional kernel to compress the high-dimensional channels of the original cost body (e.g., 256 channels) to an intermediate rank (e.g., 64 channels). Further, a spatial convolutional kernel (e.g., 3×3) is configured independently for each input channel, and local sliding convolution is performed only on that channel without cross-channel aggregation. Subsequently, a 1×1 convolution is used again to remap the low-channel intermediate features (64 channels) output by the depthwise convolution back to the original channel dimension (256 channels), thereby recovering a geometric encoding body with the same number of channels as the original cost body.
[0137] As the core acceleration module of the binocular depth estimation network, the staged depth separable convolutional structure achieves a dual compression of computational overhead and model size. Through the three-stage collaboration of channel dimensionality reduction, independent spatial filtering and channel restoration, the number of multiply-accumulate operations and the total number of parameters in the convolutional layer are significantly reduced. While maintaining the integrity of disparity map details and stereo consistency, it significantly reduces inference latency and memory usage, enabling the entire binocular localization system to run in near real-time on an embedded platform.
[0138] To facilitate understanding of the disparity estimation process described above, the following explanation uses specific examples. Addressing the computational and memory constraints of deploying binocular depth estimation networks underwater, a structured pruning method based on channel separation and low-rank decomposition of convolutional kernels can be employed to significantly reduce parameters and computational complexity while preserving disparity details and stereo consistency as much as possible. Specifically, for underwater images enhanced by binocular imaging, the following steps are performed sequentially to estimate the disparity map:
[0139] (1) Use the feature extractor to construct the cost aggregation.
[0140] Specifically, a lightweight feature extractor is used to output multi-scale features. This is used for subsequent cost construction and context encoding. Then, at a lower resolution, the relevant cost bodies are first separated through the description sub-channel construction group to obtain... Then, the cost volume is context-encoded using a 3D hourglass aggregator, and the output geometry code volume is used to establish cost aggregation for binocular parallax.
[0141] (2) Use a backbone network with channel separation and low-rank decomposition to perform convolution operations.
[0142] Specifically, for convolutional layers in networks with dense channel mixing and high computational cost, a structured pruning strategy combining channel separation and low-rank channel decomposition is proposed to significantly reduce the number of parameters and computational complexity while preserving disparity details and stereo consistency as much as possible. The specific approach involves modifying the original... The standard convolution is replaced with three sequentially connected sub-modules: first use Point convolution performs channel dimensionality reduction on the input channels Mapping to intermediate rank Then execute independently for each intermediate channel. Depth separation spatial filtering is used to preserve the complete receptive field, and finally... Point convolution will Restore to output channel Intermediate rank By rank proportion The decision was made to adopt the following method. ,in This is a hyperparameter.
[0143] To quantitatively describe the technical effect, the standard convolution parameter count is denoted as . The number of parameters after replacement is Thus, the parameter compression ratio is obtained. In typical settings (e.g.) This can achieve parameter compression of tens of times, while MACs also decrease by the same proportion.
[0144] (3) Repeatedly iterate the GRU network to update the disparity.
[0145] Specifically, the next step is to generate a probability body. And use disparity regression:
[0146]
[0147] Each update upsamples the low-resolution disparity to the original resolution and fuses it with context weights. Then, the disparity is updated iteratively through the GRU network several times, which is responsible for refining the sub-pixel disparity. This achieves coarse-to-fine iterative optimization.
[0148] (4) Return the final parallax.
[0149] For example, in underwater communication infrastructure inspection tasks, the target objects are communication node devices deployed on the seabed or underwater structures (typically metal shells, regular geometric structures, reflective / rust textures on the surface, and clear edges, but partially obscured by organisms or sediment). Their visual characteristics differ significantly from natural underwater scenes (such as reefs and biological communities). For such rigid, structured, high-contrast edge targets, binocular parallax estimation can be achieved through the following methods:
[0150] Step 1: Construct cost aggregation.
[0151] When constructing the group separation cost volume on the low-resolution feature map, the response weights of the high-gradient edge channels are retained first, and the local pseudo-texture interference caused by biological attachment or sediment is suppressed. For regular features such as the metal shell edge and bolt holes of the communication node, a preset edge mask is used to guide the cost aggregation direction, and the cost volume is forced to maintain strong consistency in the structural edge area to avoid mismatch drift caused by blurred areas.
[0152] Specifically, for the left and right binocular images after physical optics modeling enhancement, for the left image, preliminary edge information is first detected using the Sobel operator, and a binarized original edge map is generated using an adaptive thresholding method. Then, the Canny edge detection results are fused, and morphological closing operations are performed on the edge map to connect broken edges. Connected component analysis is then used to filter out structural features that conform to geometric rules (such as straight line segments, arcs, closed loop structures, etc.). Finally, high-confidence regular structural edge regions are retained, and a binary spatial mask is constructed. This mask marks each pixel location as "1" to indicate a strongly structured region (such as metal bolt holes, flange edges, pipe joints, etc.) and as "0" to indicate a non-structured or complex textured region.
[0153] Furthermore, in the cost aggregation stage of the binocular depth estimation network, an initial multi-disparity cost volume is constructed using low-resolution feature maps. Subsequently, the structural edge mask generated in the previous step is spatially upsampled to align it with the spatial dimensions of the cost volume. During cost aggregation, for regions marked as "1" on the mask (i.e., structured edge regions), directional guiding weights are applied to the disparity dimension of the cost volume to force adjacent disparity layers to maintain high consistency, thereby suppressing disparity lateral drift caused by water disturbance or noise; for regions marked as "0" on the mask, the original unconstrained aggregation method is used, preserving the adaptability to unstructured textures.
[0154] Furthermore, during cost volume context aggregation in the 3D Hourglass network, the aggregation strategy is dynamically adjusted based on the indication of the structural edge mask. In structural regions (mask value 1), narrow-band Gaussian smoothing is used for local smoothing along the disparity axis to enhance the continuity of disparity in the vertical direction and prevent "jagged edges" or "jumps" at the edges. In non-structural regions (mask value 0), the original loose aggregation mechanism is maintained, allowing for flexible adjustment of disparity in complex texture regions. Through this strategy, a novel cost volume optimized by structure guidance is obtained, which can significantly improve the disparity consistency of regular targets such as metal structures.
[0155] Step 2: Use channel separation and low-rank decomposition for the backbone network.
[0156] When performing channel separation and low-rank decomposition pruning, the pruning ratio of edge-sensitive convolution kernels in high-resolution feature layers near the network ends is reduced (e.g., r is increased from 0.25 to 0.35) to preserve the ability to finely reconstruct the sharp edges and regular contours of communication nodes; the remaining low-level features still use the standard pruning ratio to achieve overall computational compression. This strategy ensures that key structural features are not broken or blurred due to excessive compression.
[0157] Step 3: Repeat the iteration of the GRU network to update the disparity.
[0158] During the GRU iterative update process, soft constraint terms based on the geometric priors of communication node devices are embedded: using predefined "cube-like / cylinder" morphological templates, morphological heuristic detection is performed on the current disparity map. If a continuous regular structure region is detected, its disparity change rate is forced to be lower than the threshold, suppressing local disparity jitter caused by reflective spots or attachments. This makes disparity convergence more inclined to conform to the planar or curved surface continuity of the real device structure, rather than noise-driven local extrema.
[0159] In some embodiments of this application, during the disparity iterative optimization stage, a gated recurrent unit (GRU) network is used to refine the initial disparity map at the sub-pixel level. To enhance the stability of structural regions, a structural edge mask is introduced into the GRU's update gate mechanism as a spatial attention guidance signal. Combined with the gradient information of the disparity map at the previous time step, when the current pixel is located in a structural edge region, the system automatically suppresses disparity abrupt changes caused by water disturbance or image noise, prompting the update direction to tend to maintain structural continuity. In non-structural regions, greater degrees of freedom in disparity adjustment are allowed to adapt to natural texture changes.
[0160] Step 4: Return the final parallax.
[0161] The final output disparity map is no longer just a dense depth map, but a binocular localization result with added structural semantic labels: for the identified communication node region, a bounding box and center point coordinates are generated, and the disparity value is bound to the structure.
[0162] In some embodiments of this application, the target model is trained as follows: An initial model is obtained based on historical stereo image pairs, wherein the historical stereo image pairs are data-enhanced stereo image pairs, and the weight parameters of the initial model are stored in single-precision floating-point format; a quantization executor is used to replace the convolutional layers of the initial model to obtain a first model, wherein the quantization executor is used to transfer the weights and / or activation values from floating-point numbers to integers while preserving the model structure of the initial model; the first model is trained using a calibration dataset to obtain activation distributions corresponding to multiple layers of the first model, wherein the activation distributions are used to characterize the dynamic distribution range of quantizable layers in the first model; an activation truncation threshold and a quantization scale corresponding to the activation distributions of the multiple layers are determined, wherein the activation truncation threshold is used to map the activation values of the convolutional layers to integer values within a preset range; the activation values and / or weight parameters of the output channels of the convolutional layers of the first model are quantized based on at least one of the activation truncation threshold and the quantization scale to obtain a second model; the disparity error between the second model and the first model is determined based on a validation dataset; and the target model is determined based on the second model if the disparity error meets preset conditions.
[0163] It should be noted that the initial model refers to the original depth estimation network trained on historical underwater stereo images. All its weight parameters are stored in single-precision floating-point format (FP32), possessing a complete network structure and high-precision disparity prediction capabilities. The quantization executor is a lightweight computational module used to replace the original floating-point convolutional layers. Its function is to convert weights and activation values from floating-point representation to integer representation (such as INT8) without changing the network topology, and to introduce inverse quantization or scale compensation mechanisms to maintain numerical accuracy. In some embodiments of this application, the quantization executor is replaced layer by layer in the backbone network. Its role is to achieve low-bit-level deployment of the model, while maintaining the independence of different channel amplitude distributions through channel-level scale parameters, avoiding information distortion caused by global quantization.
[0164] Activation distribution refers to the histogram of activation values output by each quantizable layer (such as a convolutional layer) on a statistical calibration set during the model's forward inference process. It characterizes the dynamic response range of that layer in a real underwater scenario. Obtaining the activation distribution is a crucial prerequisite for quantization calibration, as it determines the selection of the activation value truncation threshold, avoiding accuracy loss due to numerical overflow or an excessively wide quantization range. The activation truncation threshold is a numerical boundary determined based on the activation distribution. It is used to forcibly prune activation values exceeding this boundary to the boundary value, thereby mapping floating-point activation values to a preset integer range (such as [-128, 127] for INT8). Its function is to control the dynamic range during quantization, preventing large activation values from causing overflow or amplifying quantization noise.
[0165] Specifically, a large number of underwater binocular image pairs (containing different water quality, lighting and visibility conditions) preprocessed by the physical optics enhancement described in this application can be used as training data to construct a binocular depth estimation network with a lightweight feature extractor, cost aggregator and GRU iterative optimizer as the core. During training, photometric consistency loss and structural similarity loss are jointly optimized to ensure that the network can still stably output dense disparity maps in low contrast and high noise environments. After training, the network parameters are saved in single-precision floating-point format as a benchmark model for subsequent quantization and compression.
[0166] Furthermore, without altering the network structure, the original floating-point convolution operations are replaced layer by layer with a quantization executor encapsulated by "quantization-dequantization" logic. During forward inference, this executor first maps the floating-point weights and activation values to INT8 integers independently by channel, then performs integer convolution operations, and finally dequantizes them using the channel scale parameter to restore them to floating-point output for use by subsequent layers.
[0167] Furthermore, a representative pair of stereo images (without labels) is collected from a real underwater operating environment, input into the first model, and all activation output values of each quantizable convolutional layer during the forward inference process are recorded. By constructing the activation value histogram of each layer, its distribution pattern (such as mean, variance, and tail length) is statistically analyzed to form the dynamic response feature set of each layer.
[0168] Furthermore, for each layer's activation histogram, multiple cutoff points (such as 99%, 99.5%, and 99.9% quantizations) are candidate points. For each candidate value, INT8 quantization is performed, and the KL divergence between the quantized distribution and the original distribution is calculated. The cutoff point that minimizes the divergence is selected as the optimal threshold. At the same time, for each output channel, its maximum absolute value is calculated and divided by the maximum value of INT8 (127) to obtain the channel-level quantization scale.
[0169] After determining the truncation threshold and quantization scale, quantization operations are performed on the weight parameters and activation values of all convolutional layers in the model. The weight parameters are independently quantized along the output channel and stored as INT8 values. During inference, the activation values are pruned and linearly mapped according to the predetermined threshold. The quantized weights and activation values participate in the convolution operation in integer form, and are dequantized and recovered only during inter-layer communication, thereby achieving low-bit inference.
[0170] Furthermore, a set of underwater stereo images with ground truth depth annotations is selected as the validation set. These images are input into the second model (quantized) and the first model (floating-point reference), respectively, and the mean absolute error and pixel-level disparity deviation between their output disparity maps and the ground truth are calculated. If the error change rate is lower than a preset threshold (e.g., 5%), it is determined that the quantization process has not introduced significant performance degradation, and the next stage can proceed. If it exceeds the threshold, it is necessary to backtrack and adjust the truncation strategy or add calibration samples. When the disparity error of the quantized second model on the validation set meets the engineering deployment requirements (e.g., error increase ≤ 3%), it is considered as the final model that can be deployed in practice. At this point, all floating-point parameters of the model have been replaced with INT8 integer weights and channel-level quantization tables. The network structure remains unchanged, the inference speed and memory usage are significantly reduced, and it can be directly embedded into an embedded platform for real-time operation.
[0171] To facilitate understanding of the model training process described above, the following explanation uses specific examples. To minimize model storage and computational overhead while maintaining disparity accuracy and stereo consistency as much as possible, the binocular depth estimation network can be converted from fully accurate to an INT8 weight representation based on post-training quantization. For the trained weights, the following steps are performed for quantization:
[0172] Load the FP32 weights obtained during training.
[0173] A quantization actuator is constructed to replace the convolutions in the existing backbone network.
[0174] The recursive traversal of the model submodules is replaced by a reasoning wrapper that is symmetrically quantized by channel, as described in the aforementioned section A.
[0175] Specifically, the quantization scale is calculated individually for each output channel of the convolutional layer to reduce errors caused by differences in amplitude distribution across different channels. Weights are stored in a signed integer container, and the scale is reserved for dequantization or mixed-precision inference. Let the number of quantization bits be... (INT8 quantization) ), the range of integers for symmetric quantization for:
[0176]
[0177] For the For each output channel, calculate the maximum absolute value of the weights on that channel:
[0178]
[0179] The corresponding quantization scale is defined as:
[0180]
[0181] Weight quantization and dequantization are as follows:
[0182]
[0183]
[0184] In the above formula, Let be the i-th weight in the c-th output channel.
[0185] (4) Use a representative calibration dataset to feed forward several batches to collect the activation distribution of each layer.
[0186] (5) The KL algorithm is used to determine the activation cutoff threshold and scale, as described in Section B above.
[0187] Specifically, when using integer-quantized convolutions or when it is desired to quantize activations to INT8 on mixed-precision / accelerators, the dynamic range of activations needs to be estimated and truncated to reduce catastrophic overflow and quantization errors. Specifically, this involves using the histogram of activations on a statistically representative calibration set. The quantized histogram is plotted on the candidate cutoff value set. and We calculate the KL divergence and select the optimal cutoff point to minimize information loss.
[0188] (6) Evaluate the disparity error between the quantized model output and the FP32 baseline on a small validation set.
[0189] (7) The quantized weights, the activation calibration table, and the network configuration output are used as the final results.
[0190] The activation calibration table is a mapping table formed during the post-training quantization phase. It is created by forward propagating on a representative calibration dataset to statistically analyze the dynamic range of activation values for each layer, and then determining the quantization cutoff threshold and scale for each layer's activation. The network configuration refers to the metadata file describing the quantized network structure, connections, computation order, and quantization parameter bindings.
[0191] Step S208: Underwater positioning of the target object based on the disparity map.
[0192] In step S208 above, the disparity map refers to a two-dimensional matrix composed of the positional differences of corresponding pixels in the left and right images of the binocular vision system in the horizontal direction. Each pixel value represents the disparity of the target object at that position relative to the camera.
[0193] In some embodiments of this application, by pre-calibrating the intrinsic parameter matrix (including focal length and principal point coordinates) of the binocular camera and the physical baseline distance between the left and right cameras, after obtaining a high-precision disparity map, the three-dimensional spatial projection formula is applied to each pixel: depth = (baseline × focal length) / disparity value. Subsequently, combined with the row and column coordinates of the pixel in the image plane, the two-dimensional pixel is mapped to a three-dimensional point cloud relative to the camera coordinate system through coordinate transformation.
[0194] For example, for underwater communication nodes, since they have rigid, symmetrical, and planar continuous characteristics, after obtaining the initial disparity map, multi-scale planar fitting can be used: local planar fitting is performed on the detected node region, and if the disparity residual exceeds the threshold (e.g., >3 pixels), it is judged as noise or attachment and is removed; or, the known width / height ratio of the communication node (e.g., the diameter of a cylinder is about 0.6m) can be used as a geometric constraint to correct or interpolate abnormal disparity blocks to ensure that the disparity value conforms to the actual physical size.
[0195] For example, regions with known geometric structures (such as pipe joints, supports, and sensor mounting points) are automatically identified from the disparity map and divided into local blocks; plane fitting is performed on each region, and if the disparity variance exceeds a preset threshold, it is marked as a noise or occlusion abnormal region; based on the prior size of the target (such as the diameter of a cylindrical communication node of 0.6m), the theoretical disparity range that it should correspond to at the current line of sight is calculated; for regions that deviate from the physical disparity range, geometric interpolation or scaling correction is performed using the disparity values of neighboring legal regions to ensure that the output disparity distribution meets the constraints of the real spatial scale.
[0196] After converting the parallax map into a point cloud, the installation reference point of the communication node (such as the center of the base or the cable inlet) is used as the key anchor point. Combined with the coarse position provided by underwater positioning beacons (such as USBL or short baseline acoustic positioning), point cloud-pose joint optimization is performed. Since communication nodes are mostly vertically or horizontally fixed, their normal vector direction can also be forcibly constrained (such as vertical to the seabed or along the pipeline axis) to improve reconstruction accuracy and avoid pose drift caused by water refraction or floating interference.
[0197] Through steps S202 to S208, a channel separation enhancement method is adopted. By estimating the transmittance of each color channel in the underwater environment and restoring its scene reflectance, the original binocular image pair is corrected to obtain the target binocular image pair. Then, through a lightweight model of channel quantization, the weight parameters of the output channels of the convolutional layer are independently quantized to integer values within a preset range for each channel, and the disparity of the target binocular image pair is efficiently estimated. Based on the disparity map, the target object is spatially located. This achieves the goal of significantly reducing the computational overhead of image enhancement and depth estimation without relying on complex end-to-end neural networks. Thus, it realizes the technical effect of real-time, stable, and high-precision underwater binocular visual positioning on a low-computing-power embedded platform. This solves the technical problem that related technologies rely on complex neural networks to improve the robustness of disparity estimation in turbid water and are difficult to perform efficient and accurate depth estimation in real time under environments with limited computing resources.
[0198] Figure 3 This is a flowchart of the model training process for a target localization method according to an embodiment of this application, as shown below. Figure 3 As shown, in some embodiments of this application, the target model is trained through the following steps:
[0199] Model training phase:
[0200] S302: Physical Modeling and Data Augmentation.
[0201] This step aims to preprocess underwater binocular image pairs using a physically-optically-driven image enhancement method to restore the contrast loss, color shift, and detail blur caused by water absorption and scattering. Specifically, an underwater imaging model based on channel separation is employed, modeling the red, green, and blue channels separately. Local transmittance is estimated using a priori data from the dark channel, and guided filtering is combined to smooth the edges of the transmittance map. The original scene's radiative characteristics are reconstructed through ambient light estimation and reflectance recovery. Furthermore, a channel-adaptive gain correction mechanism is introduced to perform nonlinear compensation for the strong absorption characteristics of red light. Finally, CLAHE and Laplacian sharpening are used to enhance local contrast and texture details.
[0202] S304: FP32 and BF16 mixed precision training model.
[0203] To improve training efficiency and reduce GPU memory usage while ensuring model convergence accuracy, a hybrid precision training strategy combining FP32 (single-precision floating-point) and BF16 (brain-based floating-point) is adopted. Specifically, convolutions and matrix operations in the network backbone are performed in BF16 format to accelerate computation and save GPU memory; critical paths (such as gradient accumulation, parameter updates, and loss function calculations) retain FP32 precision to avoid numerical instability and gradient overflow issues introduced by low-precision calculations.
[0204] S306: Channel pruning.
[0205] To reduce the computational and storage overhead of depth estimation networks on embedded platforms, this step implements a structured pruning strategy based on channel separation and low-rank decomposition of convolutional kernels. For the parameter-dense 3×3 convolutional layers in the network, they are replaced with a three-stage lightweight module: first, a 1×1 point convolution is used to compress the number of input channels to an intermediate rank m; then, depthwise convolution is performed independently on each intermediate channel to preserve the spatial receptive field; finally, another 1×1 point convolution restores the number of output channels. The intermediate rank m is dynamically determined by the rank ratio r, and a balance between parameter quantity and accuracy is achieved by adjusting r.
[0206] Quantitative deployment phase:
[0207] S308: INT8 quantization.
[0208] This step aims to convert the trained FP32 / BF16 model into an INT8 integer quantized version, significantly reducing model storage size and computational requirements during inference. During quantization, the weight parameters of each convolutional layer are symmetrically quantized independently for each output channel: first, the maximum absolute value of the weight for each channel is calculated, and the quantization scale for that channel is determined accordingly. Subsequently, the weights are mapped to the [-128, 127] integer domain through scaling, rounding, and pruning operations, achieving a signed 8-bit representation.
[0209] S310: Add quantization and dequantization layers.
[0210] To ensure compatibility with the INT8 inference framework and the fixed-point instruction set of the hardware accelerator, this step inserts quantization and dequantization nodes into the model. Specifically, a dequantization layer is inserted at the input of each convolutional layer to restore the INT8 weights and activation values to floating-point domains for convolution operations; a quantization layer is inserted at the output to remap the floating-point results back to INT8 as input for the next layer. This design implements a mixed-precision inference mode of floating-point operations and integer storage in the inference path, preserving the numerical stability of traditional floating-point calculations while fully utilizing the low bandwidth and high throughput advantages of INT8.
[0211] S312: Small sample data calibration.
[0212] To accurately determine the quantization cutoff threshold for activation values and avoid accuracy collapse due to dynamic range misestimation, this step employs a small-sample calibration mechanism based on KL divergence. A small number (e.g., 100-500 frames) of representative underwater stereo image sequences are used as the calibration set. The forward propagation network is used to collect the original FP32 distribution histograms of activation values for each layer. Subsequently, the INT8 quantization process is simulated on the candidate cutoff threshold set, and the KL divergence between the quantized histogram and the original distribution is calculated. The threshold that minimizes information loss is selected as the final cutoff point.
[0213] Figure 4 This is a schematic diagram of a target localization method according to an embodiment of this application, such as... Figure 4 As shown, in some embodiments of this application, the target model may include:
[0214] Input layer 402: Receives binocular underwater image pairs after data augmentation.
[0215] Feature extraction network 404: Employs a lightweight convolutional structure (such as an improved MobileNet or ShuffleNet) to extract multi-scale feature maps, balancing computational efficiency and texture preservation.
[0216] Cost body construction module 406: Performs group channel correlation calculation (GWC) based on binocular features to construct the initial cost body.
[0217] Cost aggregation network: 408: Employs a lightweight 3D Hourglass structure, combining channel separation and low-rank decomposition convolution to compress parameters and aggregate contextual information.
[0218] Disparity probability generation layer 410: Performs a Softmax operation on the aggregated cost volume to generate an initial disparity probability distribution.
[0219] Parallax Iterative Optimization Module 412: Introduces GRU units to iteratively update low-resolution parallax after upsampling, and integrates spatial context and multi-scale features to achieve sub-pixel level parallax refinement.
[0220] Output layer 414: Outputs the final high-precision disparity map, which is then converted into three-dimensional spatial coordinates after post-processing (such as left-right consistency check) to achieve precise positioning of underwater targets.
[0221] Figure 5 This is a structural diagram of a target positioning device according to an embodiment of this application, such as... Figure 5 As shown, the device includes:
[0222] The acquisition module 502 is used to acquire the original stereo image pairs of the target object in the underwater environment;
[0223] The enhancement module 504 is used to perform data enhancement on the original binocular image pair to obtain the target binocular image pair, wherein the target binocular image pair is obtained by performing transmittance estimation and reflectance recovery on each color channel of the original binocular imaging based on the underwater environment.
[0224] The estimation module 506 is used to perform disparity estimation processing on the target binocular image pair using the target model to obtain a disparity map. The weight parameters of the output channels of the convolutional layer in the target model are quantized based on the corresponding quantization scale. The quantization scale is used to map the weight parameters to integer values within a preset range.
[0225] The positioning module 508 is used for underwater positioning of target objects based on a parallax map.
[0226] It should be noted that, Figure 5 The target positioning device shown is used to perform Figure 2 The target localization method shown, therefore Figure 2 The relevant explanations in the target localization method also apply to Figure 5 The target positioning device shown will not be described in detail here.
[0227] This application also provides an electronic device, which includes a memory and a processor, wherein the memory is used to store program instructions; the processor is connected to the memory and is used to execute the steps of implementing the target positioning method in various embodiments of this application.
[0228] This application also provides a non-volatile storage medium including a stored computer program, wherein the device containing the non-volatile storage medium executes the steps of the target positioning method in various embodiments of this application by running the computer program.
[0229] This application also provides a computer program product, including computer instructions that, when executed by a processor, implement the steps of the target localization method in various embodiments of this application.
[0230] This application also provides a computer program that, when executed by a processor, implements the steps of the target localization method in various embodiments of this application.
[0231] The sequence numbers of the embodiments in this application are for descriptive purposes only and do not represent the superiority or inferiority of the embodiments.
[0232] In the above embodiments of this application, the descriptions of each embodiment have different focuses. For parts not described in detail in a certain embodiment, please refer to the relevant descriptions of other embodiments.
[0233] In the several embodiments provided in this application, it should be understood that the disclosed technical content can be implemented in other ways. The device embodiments described above are merely illustrative; for example, the division of units can be a logical functional division, and in actual implementation, there may be other division methods. For instance, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed. Furthermore, the displayed or discussed mutual coupling, direct coupling, or communication connection may be through some interfaces; the indirect coupling or communication connection between units or modules may be electrical or other forms.
[0234] The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple units. Some or all of the units can be selected to achieve the purpose of this embodiment according to actual needs.
[0235] Furthermore, the functional units in the various embodiments of this application can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The integrated unit can be implemented in hardware or as a software functional unit.
[0236] If the integrated unit is implemented as a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, or all or part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of this application. The aforementioned storage medium includes various media capable of storing program code, such as a USB flash drive, read-only memory (ROM), random access memory (RAM), portable hard drive, magnetic disk, or optical disk.
[0237] The above description is only a preferred embodiment of this application. It should be noted that for those skilled in the art, several improvements and modifications can be made without departing from the principle of this application, and these improvements and modifications should also be considered within the scope of protection of this application.
Claims
1. A target localization method, characterized in that, include: Acquire raw binocular image pairs of the target object in the underwater environment; Data augmentation is performed on the original binocular image pair to obtain a target binocular image pair, wherein the target binocular image pair is obtained by estimating the transmittance and restoring the reflectance of each color channel of the original binocular imaging based on the underwater environment; The target binocular image pair is subjected to disparity estimation processing using a target model to obtain a disparity map. The weight parameters of the output channels of the convolutional layer in the target model are quantized based on a corresponding quantization scale. The quantization scale is used to map the weight parameters to integer values within a preset range. The target object is located underwater based on the disparity map.
2. The method according to claim 1, characterized in that, Data augmentation is performed on the original stereo image pair to obtain the target stereo image pair, including: Determine the dark channel map corresponding to each color channel in the original binocular image pair, wherein the dark channel value corresponding to each pixel position in the dark channel map is used to reflect the local minimum brightness corresponding to a preset area in the original binocular image pair; The initial transmittance is determined based on the dark channel value, wherein the initial transmittance is the ratio of light at each pixel that is not attenuated when propagating in the underwater environment, as estimated based on the dark channel prior. The initial transmittance is smoothed using guided filtering to obtain the target transmittance. The reflectance corresponding to the original binocular image is determined based on the target transmittance, wherein the reflectance is used to reflect the original reflected light intensity and color information of the target object when the interference of the underwater environment is removed; The target binocular image pair is determined based on the reflectance corresponding to multiple color channels.
3. The method according to claim 2, characterized in that, Before determining the dark channel map corresponding to each color channel in the original stereo image pair, the method further includes: Determine the average pixel value corresponding to each color channel in the original binocular image pair; The average value of the first pixel corresponding to the first color channel in the color channel is compared with the average value of the second pixel corresponding to the second color channel to obtain the comparison result. The first color channel includes color channels whose attenuation rate in the underwater environment meets a preset threshold, and the second color channel is the color channel other than the first color channel. Based on the comparison results, color correction is determined for the average value of each first pixel and the second color channel.
4. The method according to claim 3, characterized in that, Based on the comparison results, color correction is performed on the average value of each first pixel and the second color channel, including: When the comparison result indicates that the difference between the average value of the first pixel and the average value of the second pixel is less than a preset threshold, a first target value is determined based on the average pixel values corresponding to the multiple color channels respectively, and color correction is performed on the multiple color channels respectively based on the first target value, wherein the first target value is used to characterize the neutral grayscale reference value of the original binocular image pair in the grayscale world; If the comparison result indicates that the difference between the average value of the first pixel and the average value of the second pixel is greater than or equal to the preset threshold, a second target value is determined based on the average value of the first pixel and the average value of the second pixel, and the second target value is used to perform color correction on the first color channel and the first target value is used to perform color correction on the second color channel.
5. The method according to claim 2, characterized in that, After determining the dark channel map corresponding to each color channel in the original stereo image pair, the method further includes: Sort the multiple dark channel values in the dark channel image to obtain a dark channel value sequence; Determine the target dark channel value with a preset ratio from the dark channel value sequence, and determine the original pixel corresponding to the pixel position where the target dark channel value is located; The ambient light corresponding to the underwater environment is determined based on the original pixels; The reflectivity is determined based on the ambient light and the target transmittance.
6. The method according to claim 1, characterized in that, The target binocular image pair is processed using a target model to obtain a disparity map, including: The feature extractor of the target model is used to extract multi-scale features of the target binocular image pair, and a cost body is constructed based on the multi-scale features. The cost body is used to record the matching similarity between corresponding pixel blocks of the left and right images in the target binocular image pair under multiple spatial locations and multiple preset disparity values. The cost volume is convolved with the quantized convolutional layer of the target model to obtain a geometric code body. The convolution operation is performed on the weight parameters of the convolutional layer after dequantization based on the quantization scale and then convolved with the cost volume. The geometric code body is a feature representation that fuses the contextual semantics of the target binocular image pair. The target model is iteratively updated multiple times based on the geometric code body to obtain the disparity map. In each iteration update, the initial disparity map estimated on the first resolution feature map is upsampled to the original resolution and fused with the context weights of the second resolution feature map. The resolution of the first resolution feature map is smaller than the resolution of the second resolution feature map.
7. The method according to claim 6, characterized in that, The convolutional layers of the target model include a first convolutional layer, a second convolutional layer, and a third convolutional layer; the cost volume is convolved using the quantized convolutional layers of the target model to obtain a geometric code volume, including: The first convolutional layer of the target model is used to perform channel dimensionality reduction on the cost volume to obtain a first intermediate feature, wherein the first convolutional layer is used to reduce the number of channels of the cost volume to the intermediate rank, and the intermediate rank is determined by the rank ratio; The second convolutional layer is used to perform spatial filtering on each channel of the first intermediate feature to obtain the second intermediate feature, wherein the second convolutional layer includes depthwise convolution; The third convolutional layer is used to perform channel recovery on the second intermediate feature to obtain the geometric code body, wherein the number of channels of the geometric code body is the same as the number of channels of the cost body, and the third convolutional layer has the same structure as the first convolutional layer.
8. The method according to claim 1, characterized in that, The target model is trained in the following way: An initial model is obtained by training based on historical stereo image pairs, wherein the historical stereo image pairs are stereo image pairs after data augmentation, and the weight parameters of the initial model are stored in single-precision floating-point format. The convolutional layers of the initial model are replaced with a quantization executor to obtain a first model, wherein the quantization executor is used to transfer the weights and / or activation values from floating-point numbers to integers while preserving the model structure of the initial model; The first model is trained using a calibration dataset to obtain activation distributions corresponding to multiple layers of the first model, wherein the activation distributions are used to characterize the dynamic distribution range of quantizable layers in the first model. Determine the activation cutoff threshold and quantization scale corresponding to the activation distribution of the multiple layers, wherein the activation cutoff threshold is used to map the activation values of the convolutional layer to integer values within a preset range; The activation values and / or weight parameters of the output channels of the convolutional layer of the first model are quantized based on at least one of the activation cutoff threshold and the quantization scale to obtain the second model. The disparity error between the second model and the first model is determined based on the validation dataset; If the disparity error meets the preset conditions, the target model is determined based on the second model.
9. A target positioning device, characterized in that, include: The acquisition module is used to acquire raw stereo image pairs of the target object in the underwater environment; An enhancement module is used to perform data enhancement on the original binocular image pair to obtain a target binocular image pair, wherein the target binocular image pair is obtained by performing transmittance estimation and reflectance recovery on each color channel of the original binocular imaging based on the underwater environment; An estimation module is used to perform disparity estimation processing on the target binocular image pair using a target model to obtain a disparity map. The weight parameters of the output channels of the convolutional layers in the target model are quantized based on a corresponding quantization scale, which is used to map the weight parameters to integer values within a preset range. The positioning module is used to locate the target object underwater based on the disparity map.
10. An electronic device, characterized in that, include: A memory and a processor, wherein the memory is used to store program instructions; the processor is connected to the memory and is used to execute the target localization method according to any one of claims 1 to 8.
11. A non-volatile storage medium, characterized in that, The non-volatile storage medium includes a stored computer program, wherein the device containing the non-volatile storage medium executes the target positioning method according to any one of claims 1 to 8 by running the computer program.
12. A computer program product comprising computer instructions, characterized in that, When the computer instructions are executed by the processor, they implement the target localization method according to any one of claims 1 to 8.