Image enhancement method for assisting operation of underwater robot
Through enhanced filtering, contrast enhancement, color correction and dehazing processing, combined with the SAM image model and dark channel prior dehazing algorithm, the problem of difficult underwater robot image recognition is solved, the image clarity and recognition accuracy are improved, and the underwater efficiency.
Patent Information
- Application Number
- CN202410812706.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-06-22
- Publication Date
- 2024-09-24
AI Technical Summary
It is difficult for underwater robots to recognize images in complex environments. Existing technologies such as high-definition cameras and multi-sensor fusion have problems with image blur and background interference, resulting in low recognition efficiency and high error rates.
It adopts enhanced filtering algorithm, contrast enhancement, color correction and defogging processing, combined with SAM image model and dark channel prior defogging algorithm, to improve image clarity and reliability by correcting distortion, background attenuation, histogram equalization and multi-scale decomposition. sex.
It significantly improves the clarity and recognition accuracy of underwater images, reduces the recognition error rate, and improves the efficiency and accuracy of underwater robot operations.
Smart Images

Figure CN118691518A
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of image enhancement, and in particular to an image enhancement method for assisting underwater robot operations. Background Art
[0002] Underwater robots are autonomous robotic systems that can perform tasks in underwater environments. They are widely used in the fields of marine science, deep-sea exploration, resource exploration, seabed repair and rescue. However, the underwater environment is more complex than the terrestrial environment. It is affected by complex environmental factors such as lighting conditions, water quality, target changes, and target diversity. Therefore, target recognition for underwater robots is a complex and challenging task.
[0003] At present, many scholars have studied the solution to the problem of underwater images being too blurry, which can be divided into the following methods: using high-definition cameras, which can provide higher resolution and clearer images, but are greatly affected by light attenuation in underwater environments, so there is still the problem of image blur. If multi-sensor fusion technology is used, it can combine the data of multiple sensors such as sonar and cameras to comprehensively process the image. However, if the data differences between different sensors are large, the fusion effect may be poor.
[0004] Therefore, the present invention performs background attenuation processing on the recognized image by adopting an enhanced filtering algorithm. The enhanced filtering algorithm can perform processing such as denoising and sharpening on the image to improve the image quality.
[0005] However, in underwater environments, due to the interference of water flow, suspended particles and other factors, the effect of the enhancement filtering algorithm may not be as expected. Therefore, it is also necessary to perform contrast enhancement processing on the image, and by using methods such as histogram equalization and contrast stretching, the grayscale difference in the image is improved to make the image clearer. Then, the defogging process is used to effectively reduce the fogging effect, improve the image quality, and finally achieve image output. Summary of the invention
[0006] The purpose of the present invention is to provide a method that utilizes artificial intelligence technology and image enhancement technology to effectively solve the problems of image fuzziness and difficulty in identifying in existing underwater robot image processing systems, as well as the problems of low working efficiency and high error rate.
[0007] In order to achieve the above object, the technical solution of the present invention is as follows: A method for image enhancement to assist underwater robot operation comprises the following steps:
[0008] S1. Correct the distortion to obtain the shape and position of the target object in the image to more accurately reflect the actual situation.
[0009] S2. Background attenuation, reducing background interference and highlighting the target object.
[0010] S3. Contrast enhancement: Select appropriate filters to perform filtering on the entire image or a specific area based on specific needs and the characteristics of the underwater image.
[0011] S4. Color correction, a color correction method based on Python and OpenCV library is used to repair the image according to the characteristics of underwater light propagation.
[0012] S5. Dehazing is processed by dark channel prior dehazing (DCP) to restore the color and visibility of the image.
[0013] Specifically, the foreground and background in the image are divided through the SAM image model, and the background area is blurred and the contrast is reduced to highlight the foreground target. Then, contrast enhancement is performed based on the image contrast problem, mainly through the histogram equalization method to increase the grayscale difference in the image, making the image clearer. Image denoising and color correction are performed through a color correction method based on a physical model, so as to repair the image according to the characteristics of underwater light propagation. Finally, multi-scale decomposition is used to reduce the fogging effect and improve image quality. Underwater image enhancement is achieved on this basis. In the dehazing algorithm, the scattering model of the foggy image is:
[0014] I(x)=J(x)t(x)+A(1-t(x))
[0015] Where: I(x) is the fog image (input), J(x) is the normal image (output), t(x) is the transmittance, and A is the global atmospheric light value.
[0016] For a fog-free image, its dark channel can be expressed as:
[0017]
[0018] J c (y) represents any color channel of J, and Ω(x) represents the window at pixel x. According to the dark channel prior theory, we can get:
[0019] Jdark→0
[0020] The transmittance formula is I(x)=J(x)t(x)+A(1-t(x)):
[0021]
[0022] First, the projection rate t in each window is set to be a constant, defined as And A is given, then the formula Perform two minimum operations on both sides of t(x):
[0023]
[0024] I(x)=J(x)t(x)+A(1-t(x))
[0025] Where J is a haze-free image, according to the dark channel prior:
[0026]
[0027] So we have:
[0028]
[0029] Substituting I(x)=J(x)t(x)+A(1-t(x)) yields:
[0030]
[0031] In fact, the concentration of fog can reflect the depth of field, and we need to introduce a factor w, which is generally 0.9. The expression is as follows:
[0032]
[0033] Find the dark channel map of the foggy image, and take the top 0.1% brightest pixels from the dark channel map according to the brightness.
[0034] Among these positions, find the value of the corresponding point with the highest brightness in the original foggy image I as the A value.
[0035] The global atmospheric light value and transmittance have been calculated, and defogging can be performed. When the value of the projection map t is very small, the value of J will be too large, so that the image as a whole will transition to the white field. Therefore, a threshold t0 can generally be set. When the t value is less than t0, let t = t0, that is:
[0036]
[0037] I(x)=J(x)t(x)+A(1-t(x))
[0038] Compared with the prior art, this solution has the following beneficial effects:
[0039] (1) The present invention improves the YOLOV6 recognition algorithm by citing the SAM image segmentation technology to achieve background attenuation processing, and also adds a histogram equalization algorithm to improve the grayscale difference in the image, and improves the dark channel defogging algorithm of the DCP imaging physical model. In addition, the YOLOV6 target recognition algorithm adopts upsampling replacement and data set cleaning improvements, which is conducive to the neural network to extract image features, so as to alleviate the problem of the lack of underwater image training sets in the deep learning algorithm, improve the target recognition accuracy, assist the operator to locate the searched object faster, and improve the operation efficiency of the underwater robot.
[0040] (2) The present invention adopts GPU parallel acceleration, downsampling compressed data, algorithm simplification, and mixed precision to greatly reduce time consumption and further improve the operating efficiency of underwater robots. BRIEF DESCRIPTION OF THE DRAWINGS
[0041] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.
[0042] Figure 1 It is a schematic diagram of the overall process of the image enhancement method based on symmetry guidance of the present invention.
[0043] Figure 2 Schematic diagrams showing two different comparisons of radial distortion of an image. DETAILED DESCRIPTION
[0044] In order to solve the problem of image blur and improve work efficiency, so that people in the technical field can better understand the solution of the present invention, the technical solution of the present invention will be further described in detail below in combination with the embodiments of the present invention and the accompanying drawings. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work should fall within the scope of protection of the present invention.
[0045] It should be noted that, in the absence of conflict, the embodiments of the present invention and the features in the embodiments may be combined with each other.
[0046] like Figure 1 As shown, a flowchart of a method for image enhancement to assist underwater robot operations is shown, and the architecture steps are as follows:
[0047] Step 1: Use the underwater robot's high-definition camera to obtain the original image data collected by the underwater robot;
[0048] Step 2: Since the refractive index of water is different from that of air, light will be refracted when it passes through the water surface and enters the camera lens, causing the image to deform and distort. Common underwater distortion types include radial distortion and tangential distortion.
[0049] Radial distortion mainly manifests itself as stretching or shrinking of the central area of the image, presenting a fisheye or barrel-shaped distortion. Tangential distortion is the stretching or compression of the image caused by the imperfect symmetry of the optical system and camera lens. These distortions affect the geometry and measurement accuracy of the image, and have an adverse effect on tasks such as visual navigation, target recognition and positioning of underwater robots.
[0050] Therefore, before image enhancement, the original image data needs to be rectified for distortion. The method of correcting distortion is usually based on the camera model and known distortion parameters, and the distorted image is converted into a more geometrically accurate image through inverse calculation. Common methods of correcting distortion include camera calibration and geometric transformation.
[0051] By correcting the distortion, the shape and position of the target object in the image can more accurately reflect the real situation, thereby improving the quality and reliability of the image. This is very important for tasks such as autonomous navigation, target detection and path planning of underwater robots.
[0052] like Figure 2 As shown, there are two main types of distortion:
[0053] Radial distortion (pincushion, barrel): light rays are bent more away from the center of the lens than near the center of the lens;
[0054] Tangential distortion: The lens is not completely parallel to the image plane, that is, the angle between the sensor and the lens is not correct when it is installed.
[0055] Distortion mathematical model:
[0056] (1) The distortion at the center of the optical axis of the imager is 0, 0, 0. The closer to the edge along the radius of the lens, the more severe the distortion.
[0057] (2) The mathematical model of distortion can be described by the first few terms of the Taylor series expansion around the principal point.
[0058] Usually the sum of the first two terms, k1 and k2, is used. For lenses with large distortion, such as fisheye lenses, a third term k3 needs to be added to describe a point on the imager. According to its distribution position in the radial direction, the adjustment formula is:
[0059]
[0060] in, is the normalized image coordinate after distortion, (x, y) is the normalized image coordinate without distortion, and r is the distance from the image pixel to the center of the image.
[0061] Step 3: Preprocess the original image data, including background attenuation, contrast enhancement, etc. These preprocessing steps can be selected according to specific needs and actual conditions, aiming to reduce the interference of subsequent enhancement algorithms:
[0062] Background attenuation: Underwater illumination is affected by factors such as depth and suspended particles, which can easily cause background blur and color distortion. Therefore, by attenuating the background in the image, background interference can be reduced and the target object can be highlighted. In an underwater environment, a suitable filter is selected according to specific needs and the characteristics of the underwater image to filter the entire image or a specific area. The application of the filter can be achieved by using the OpenCV library in Python. After the filtering is completed, the background part can be further extracted as needed. The background is extracted through edge detection so that the background can be further processed or analyzed. The filtered image is combined with the background extraction result to achieve the attenuation effect of the underwater image background. Finally, the processed underwater image is adjusted and optimized, the effect is observed, and further adjustments are made as needed to obtain the best background attenuation effect.
[0063] Through the above steps, filtering of the underwater image background can be achieved to achieve the effect of background attenuation, highlight the underwater target object and improve the image quality.
[0064] Contrast enhancement: Since the refraction and scattering of blue light in the underwater environment will cause the image to appear blue, color correction is required to restore the true color. The color correction method based on the physical model can be used to repair the image according to the characteristics of underwater light propagation. The histogram method is usually used to establish a mathematical model that reflects the color change, and the histogram method criteria are used to estimate the color shift and color correction parameters of the image to achieve the purpose of color correction. The histogram processing method is a statistical analysis method based on pixel intensity values, which achieves correction by redistributing the intensity values of the image.
[0065] First, observe the histogram of the image, especially the probability density function (PDF) of the pixel intensity values. Images taken underwater tend to show a distribution that is skewed on the lower spectrum. This means that the intensity values in the image tend to be concentrated in darker areas. In order to correct this skew, my goal is to stretch the cumulative distribution function (CDF) of the image to a new target CDF. In this way, the intensity values originally located in the lower spectrum will be mapped to higher intensity values, thereby brightening the image. This process is achieved by transforming the pixel values of the image.
[0066] Specifically, histogram processing methods can use techniques such as histogram equalization or histogram regulation. Histogram equalization enhances the contrast of an image by redistributing pixel intensity values. Histogram regulation adjusts the intensity value distribution by matching the CDF of the image with the target CDF. These methods all utilize the statistical information of the intensity values in the image to improve the visual effect of the image.
[0067] The specific principles are as follows:
[0068] When performing histogram equalization on an image, the original image is split into three channels (red, green, and blue) (RGB). The following calculation process is then performed on each channel:
[0069] (1) Calculate the histogram of each channel: Use the histogram calculation method of grayscale images to count the frequency of each pixel value.
[0070] (2) Calculate the cumulative distribution function (CDF): Accumulate the histogram to obtain the cumulative frequency of each pixel value.
[0071] (3) Normalized CDF: Divide the CDF value by the total number of pixels in the image to limit its range to between 0 and 1.
[0072] (4) Construct target CDF: Create a linearly distributed CDF where pixel values are uniformly distributed from 0 to 255.
[0073] (5) Mapping pixel values: For each pixel value, find the closest pixel value and map it based on the normalized CDF of the current channel and the target CDF.
[0074] (6) Reconstructing channels: Recombining the mapped channels.
[0075] (7) Repeat steps (2) to (6) to process the remaining two channels.
[0076] The three processed channels are stacked together to obtain the final processed image.
[0077] Step 4: Color correction. The refraction and scattering of blue light in the underwater environment will cause the image to appear blue, so color correction is required to restore the true color. A color correction method based on Python and OpenCV library is used to repair the image according to the characteristics of underwater light propagation.
[0078] Specifically, first use the cv2.imread() function to read an image. Then use the cv2.cvtColor() function to convert the image from the BGR color space to the RGB color space to complete the color correction. Next, use the cv2.imshow() function to display the original image and the corrected image respectively. Use the cv2.imwrite() function to save the corrected image locally for the next step. Finally, use the cv2.waitKey() function to wait for any key to be pressed before the end.
[0079] Step 5: Since there is often a fog effect in underwater images, which affects the clarity and details of the image, the introduction of a dark channel prior in the defogging algorithm can effectively reduce the fog effect and improve the image quality.
[0080] Specifically, it is processed through the classic dehazing algorithm - dark channel prior dehazing (DCP), which can restore the color and visibility of the image, and can also use the concentration of fog to estimate the distance of the object.
[0081] Detailed description of dehazing algorithm:
[0082] Foggy image scattering model:
[0083] I(x)=J(x)t(x)+A(1-t(x))
[0084] Where: I(x) is the fog image (input), J(x) is the normal image (output), t(x) is the transmittance, and A is the global atmospheric light value.
[0085] Dark channel definition:
[0086] From the observation of dark channel data of more than 5,000 haze-free images, it is found that about 75% of the pixel values are 0, and 90% of the pixels have very low values and are concentrated in [0,16]. Therefore, the dark channel prior theory is proposed, that is, for a haze-free image, its dark channel can be expressed as:
[0087]
[0088] J c (y) represents any color channel of J, and Ω(x) represents the window at pixel x. According to the dark channel prior theory, we can get:
[0089] Jdark→0
[0090] The transmittance formula is I(x)=J(x)t(x)+A(1-t(x)):
[0091]
[0092] First, the projection rate t in each window is set to be a constant, defined as And A is given, then the formula Perform two minimum operations on both sides of t(x):
[0093]
[0094] I(x)=J(x)t(x)+A(1-t(x))
[0095] Where J is a haze-free image, according to the dark channel prior:
[0096]
[0097] So we have:
[0098]
[0099] Substituting I(x)=J(x)t(x)+A(1-t(x)) yields:
[0100]
[0101] In fact, the concentration of fog can reflect the depth of field, and we need to introduce a factor w, which is generally 0.9. The expression is as follows:
[0102]
[0103] Find the dark channel map of the foggy image, and take the top 0.1% brightest pixels from the dark channel map according to the brightness.
[0104] Among these positions, find the value of the corresponding point with the highest brightness in the original foggy image I as the A value.
[0105] The global atmospheric light value and transmittance have been calculated, and defogging can be performed. When the value of the projection map t is very small, the value of J will be too large, so that the image as a whole will transition to the white field. Therefore, a threshold t0 can generally be set. When the t value is less than t0, let t = t0, that is:
[0106]
[0107] I(x)=J(x)t(x)+A(1-t(x))
[0108] Step 6: Output the enhanced image data for the robot to perform further image recognition and task execution.
[0109] The above is a detailed introduction to an image enhancement method for assisting underwater robot operations provided by an embodiment of the present invention. Specific examples are used in this article to illustrate the principles and implementation methods of the present invention. The description of the above embodiments is only used to help understand the method of the present invention and its core idea; at the same time, for general technical personnel in this field, according to the idea of the present invention, there will be changes in the specific implementation method and application scope. In summary, the content of this specification should not be understood as a limitation on the present invention.
Claims
1. A method for image enhancement to assist underwater robot operations, the main features of which are: The method consists of five steps: S1. Correct distortion to obtain the shape and position of the target object in the image to more accurately reflect the actual situation; S2. Background attenuation, reducing background interference and highlighting the target object; S3. Contrast enhancement: select appropriate filters to filter the entire image or a specific area according to specific needs and the characteristics of the underwater image; S4. Color correction, using a color correction method based on Python and OpenCV library to perform image color correction, and repair the image according to the characteristics of underwater light propagation; S5. Dehazing is processed by dark channel prior dehazing (DCP) to restore the color and visibility of the image.
2. The method for image enhancement to assist underwater robot operations according to claim 1, characterized in that: In step S1, because the refractive index of water is different from that of air, light will be refracted when passing through the water surface and entering the camera lens, resulting in deformation and distortion of the image. In order to improve the visual task of the underwater robot, the original image data collected by the underwater robot using a high-definition camera is first corrected for distortion. By correcting the distortion, the shape and position of the target object in the image can more accurately reflect the actual situation, thereby improving the quality and reliability of the image. The distortion adjustment formula is: in, is the normalized image coordinate after distortion, (x, y) is the normalized image coordinate without distortion, and r is the distance from the image pixel to the center of the image.
3. The method for image enhancement to assist underwater robot operations according to claim 1, characterized in that: In step S2, the original image data is preprocessed, including background attenuation, contrast enhancement, etc. The foreground and background in the image are divided through the SAM image model, and the background area is blurred and the contrast is reduced to highlight the foreground target.
4. The method for image enhancement to assist underwater robot operations according to claim 1, characterized in that: In step S4, the image is repaired according to the characteristics of underwater light propagation. Because the refraction and scattering of blue light in the underwater environment will cause the image to appear bluish, color correction is required to restore the true color. The filter is implemented by using the OpenCV library in Python. Specifically, the cv2.imread() function is used to read an image, and then the cv2.cvtColor() function is used to convert the image from the BGR color space to the RGB color space to complete the color correction.
5. The method for image enhancement to assist underwater robot operations according to claim 1, characterized in that: In step S5, the dark channel prior of the defogging algorithm is introduced to effectively reduce the fog effect and improve the image quality. Since the fog effect often exists in underwater images, which affects the clarity and details of the image, it is necessary to reduce the materialization effect. Specifically, it is processed by the classic defogging algorithm, dark channel prior defogging (DCP), which can restore the color and visibility of the image, and can also use the concentration of fog to estimate the distance of the object. The defogging algorithm is as follows: I(z)=J(z)t(x)+A(1-t(x)) Where I(x) is the fog image (input), J(x) is the normal image (output), t(x) is the transmittance, and A is the global atmospheric light value.
Citation Information
Cited By
Underwater robot positioning method based on image processing and related device
CN118781477A
Image processing method, system, equipment and product for sightseeing submersible
CN120746904A
Trace water sample layered absorption and air isolation method and device, analyzer and medium
CN121655940A
