An underwater robot for judging water quality
By using an underwater robot equipped with a structured light camera and drive components, and employing structured light technology and image processing algorithms to calculate the water attenuation coefficient, the problem of complex equipment and chemical reagents in existing water quality monitoring technologies has been solved, enabling rapid and accurate water quality assessment.
Patent Information
- Application Number
- CN202411415295.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-10-11
- Publication Date
- 2025-12-19
- Estimated Expiration
- 2044-10-11
AI Technical Summary
Existing technologies for water quality monitoring require complex chemical reagents and specialized equipment, and it is difficult to quickly and accurately assess the transparency and cleanliness of water bodies.
An underwater robot equipped with a structured light camera and drive components acquires images of the target object at different locations, calculates the water attenuation coefficient, and uses structured light technology and image processing algorithms in conjunction with the Lambert-Beer law to calculate the water attenuation coefficient.
It enables water quality monitoring without chemical reagents and specialized equipment, and can quickly and accurately assess water transparency and cleanliness. It is suitable for rapid screening of large areas of water, reducing costs and avoiding pollution.
Smart Images

Figure CN119354960B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the technical field of water quality judgment, in particular to an underwater robot for judging water quality. BACKGROUND
[0002] Online monitoring method sets up special monitoring equipment in water body, uses sensor, instrument and other technical means to monitor various parameters of water quality in real time, such as temperature, pH value, dissolved oxygen, turbidity, nutrient salt, organic pollutants and heavy metal ions. These monitoring equipment can automatically collect data and transmit it to data receiving end or data processing center for further analysis and evaluation.
[0003] Online monitoring system usually consists of the following parts:
[0004] Signal transmission unit: responsible for converting water quality parameters into electrical signals or other transmissible signal forms.
[0005] Signal processing unit: pre-processes collected signals, such as amplification and filtering, to improve data accuracy and reliability.
[0006] Data acquisition unit: responsible for converting processed signals into digital data and storing and transmitting them.
[0007] Data transmission unit: transmits collected data to data receiving end or data processing center through wired or wireless means.
[0008] Data analysis and evaluation unit: processes, analyzes and evaluates received data to conclude water quality status.
[0009] Online monitoring method is widely used in various water quality monitoring scenarios, such as:
[0010] Drinking water source: monitors water quality status of water source in real time to ensure safety and reliability of drinking water.
[0011] Sewage treatment plant: monitors water quality changes during sewage treatment process to optimize sewage treatment process and improve effluent water quality.
[0012] River, lake and reservoir: monitors water quality status of surface water body to provide data support for environmental protection and management.
[0013] Industrial water: monitors water quality status of industrial water to ensure stability of production process and product quality.
[0014] Agricultural irrigation: monitors quality of irrigation water to ensure healthy growth of crops and safety of agricultural products.
[0015] In the evaluation of water bodies, the attenuation coefficients of water bodies are comprehensive parameters for evaluating the quality of water bodies containing absorption and scattering.
[0016] Turbidity is also a parameter for measuring water quality, which is usually defined as the degree of liquid turbidity or opacity caused by organic or inorganic particles, and is commonly used to evaluate the physical properties of natural water and drinking water. Although the early definition of turbidity is not strictly from the optical point of view, more and more countries and organizations regard turbidity as an important indicator for evaluating water quality.
[0017] The disclosure of the above background art is only used to assist in understanding the inventive concept and technical solutions of the present application, and does not necessarily belong to the prior art of the present patent application. In the absence of explicit evidence that the above content has been disclosed on the filing date of the present patent application, the above background art should not be used to evaluate the novelty and inventiveness of the present application. SUMMARY
[0018] Therefore, the present application calculates the attenuation coefficients of water bodies by using structured light images at different distances, which has the advantages of simple operation, low cost, easy expansion, etc.
[0019] The present application provides an underwater robot for judging water quality, characterized in that it comprises:
[0020] a structured light camera for obtaining images of target objects;
[0021] a driving component for driving the underwater robot to change position in water;
[0022] a controller for controlling the structured light camera to obtain a first image of the target object at a first position and calculating a first depth, controlling the driving component to move the underwater robot to a second position, controlling the structured light camera to obtain a second image of the target object, and calculating a second depth, and calculating the attenuation coefficients of water bodies according to the first image, the second image, the first depth and the second depth.
[0023] Optionally, the underwater robot for judging water quality is characterized in that the structured light camera projects speckle structured light, and the processing process of the controller comprises:
[0024] Step S1: At a first position, control the structured light camera to obtain a first speckle image of an underwater target object, and calculate a first depth according to the first speckle image;
[0025] Step S2: controlling the driving component to move the underwater robot to a second position, obtaining a second speckle image of the underwater target object, and calculating a second depth according to the second speckle image; wherein the first position and the second position are different in distance from the underwater target object.
[0026] Step S3: extracting a speckle region in the first speckle image to obtain a first brightness; and extracting a speckle region in the second speckle image to obtain a second brightness.
[0027] Step S4: calculating a water attenuation coefficient according to the first brightness, the first depth, the second brightness and the second depth.
[0028] Optionally, the underwater robot for judging water quality has the characteristics that when the first speckle image and the second speckle image are obtained, the underwater robot has the same projection parameter and exposure parameter.
[0029] Optionally, the underwater robot for judging water quality has the characteristics that step S1 comprises:
[0030] Step S11: controlling the underwater robot to shoot a first adjustment image and perform three-dimensional reconstruction to obtain a first plane;
[0031] Step S12: calculating a first angle of the first plane in a camera coordinate system and calculating a first distance of the first plane;
[0032] Step S13: determining a rotation angle of the underwater robot according to the first angle, and rotating and moving the underwater robot according to the first distance and the rotation angle, so that the underwater robot is perpendicular to the first plane, and a second adjustment image is shot;
[0033] Step S14: performing three-dimensional reconstruction on the second adjustment image to obtain a second plane, calculating a second angle and a second distance of the second plane, and if both meet a preset value, marking the second adjustment image as the first speckle image and marking the second distance as the first depth, otherwise performing step S13.
[0034] Optionally, the underwater robot for judging water quality has the characteristics that step S3 comprises:
[0035] Step S31: extracting a first speckle region in the first speckle image and extracting a second speckle region in the second speckle image;
[0036] Step S32: pairing the first speckle region and the second speckle region to obtain a corresponding relationship between corresponding speckles;
[0037] Step S33: obtaining a third speckle region from the first speckle region according to the correspondence relationship, and calculating a first brightness; obtaining a fourth speckle region from the second speckle region according to the correspondence relationship, and calculating a second brightness.
[0038] Optionally, the underwater robot for judging water quality has the characteristics that step S33 comprises:
[0039] Step S331: pairing according to the position of the first speckle region and the position of the second speckle image, to obtain a first correspondence relationship;
[0040] Step S332: calculating the depth value difference and the depth value difference average of corresponding speckles according to the first correspondence relationship;
[0041] Step S333: removing the speckle pairs whose deviation of the depth value difference and the depth value difference average exceeds a first threshold value from the first correspondence relationship, to obtain a second correspondence relationship;
[0042] Step S334: calculating the brightness of the speckles in the first speckle region in the second correspondence relationship, to obtain a first brightness; and calculating the brightness of the speckles in the second speckle region in the second correspondence relationship, to obtain a second brightness.
[0043] Optionally, the underwater robot for judging water quality has the characteristics that in step S4, the water body attenuation coefficient is calculated according to the formula ; wherein, Φ(l 1i ) represents the brightness of the i-th speckle at a distance of a first depth l 1i ; and Φ(l 2i ) represents the brightness of the i-th speckle at a distance of a second depth l 2i .
[0044] Optionally, the underwater robot for judging water quality has the characteristics that in step S4, the water body attenuation coefficient is calculated according to the formula ; wherein, Φ(l1) represents the brightness average of multiple speckles at a distance of a first depth l1; and Φ(l2) represents the brightness average of multiple speckles at a distance of a second depth l2.
[0045] Optionally, the underwater robot for judging water quality has the characteristics that the structured light camera projects a striped structured light, and the processing process of the controller comprises:
[0046] Step M1: at a first position, controlling the structured light camera to obtain a first striped image of an underwater target object, and calculating a first depth according to the first striped image;
[0047] Step M2: controlling the driving component to move the underwater robot to a second position, obtaining a second fringe image of the underwater target object, and calculating a second depth according to the second fringe image; wherein the first position and the second position are different in distance from the underwater target object;
[0048] Step M3: extracting a bright fringe area in the first fringe image to obtain a first brightness; and extracting a bright fringe area in the second fringe image to obtain a second brightness;
[0049] Step M4: calculating a water body attenuation coefficient according to the first brightness, the first depth, the second brightness and the second depth.
[0050] Optionally, the underwater robot for judging water quality has the characteristics that the average brightness in the bright fringe width direction is taken as the brightness value of the two side pixel points.
[0051] Compared with the prior art, the present application has the following beneficial effects:
[0052] The present application obtains the brightness change through the structured light images at different distances, and can realize the measurement of different water bodies without reflectivity data, greatly reducing the requirement for known data, and having wide applicability.
[0053] The present application evaluates the water body quality through the attenuation effect of the water body on light, and can realize the monitoring of water quality while measuring, without the need for special equipment, and has good economic efficiency.
[0054] The present application avoids the pollution problem that may be introduced by the traditional sampling method through non-contact measurement.
[0055] The present application can continuously and quickly evaluate the water body condition, and is suitable for rapid screening of large-area water bodies.
[0056] The present application improves the measurement accuracy and efficiency by combining advanced imaging technology and automatic control system. BRIEF DESCRIPTION OF DRAWINGS
[0057] In order to more clearly illustrate the technical solutions in the embodiments of the present application or the prior art, the following will briefly introduce the drawings needed to be used in the embodiment or prior art description. Obviously, the drawings in the following description are only embodiments of the present application, and for those skilled in the art, other drawings can also be obtained without creative labor on the basis of the provided drawings. Other features, objects and advantages of the present application will become more apparent through reading the following detailed description of the non-limiting embodiments with reference to the accompanying drawings:
[0058] Figure 1A structure diagram of an underwater robot for judging water quality in an embodiment of the present application;
[0059] Figure 2 A diagram of a first position and a second position in an embodiment of the present application;
[0060] Figure 3 A process flow chart of a controller in an embodiment of the present application;
[0061] Figure 4 A step flow chart of obtaining a first depth in an embodiment of the present application;
[0062] Figure 5 A step flow chart of obtaining a first brightness and a second brightness in an embodiment of the present application;
[0063] Figure 6 A step flow chart of obtaining a first brightness and a second brightness in another embodiment of the present application;
[0064] Figure 7 A process flow chart of a controller in another embodiment of the present application.
[0065] 1 - a first position;
[0066] 2 - a second position;
[0067] 3 - an underwater robot;
[0068] 4 - a structured light camera;
[0069] 5 - a controller;
[0070] 6 - a driving component; DETAILED DESCRIPTION
[0071] The present application will be described in detail below with reference to specific embodiments. The following embodiments will help those skilled in the art to further understand the present application, but do not limit the present application in any form. It should be noted that those skilled in the art can make several modifications and improvements without departing from the concept of the present application. These all belong to the protection scope of the present application.
[0072] The terms "first", "second", "third", "fourth" and the like in the description and in the claims of the present application, and above-mentioned drawings, if any, are used as identifiers for distinguishing between similar objects, not necessarily for describing a specific sequential or chronological order. It will be understood that the use of such terms is arbitrary and made solely for the sake of ease of description and that one described embodiment of the present application can be embodied other than in the order described or depicted herein. Furthermore, the terms "comprise" and "include" and variations thereof, are intended to cover a non-exclusive inclusion, such that a process, method, system, product or apparatus that comprises a list of steps or units are not necessarily limited to those steps or units that are expressly listed, but can include other not expressly listed steps or units, without departing from such process, method, product or apparatus.
[0073] The underwater robot for judging water quality provided by the embodiment of the present application aims to solve the problems in the prior art.
[0074] The technical solutions of the present application and how the technical solutions of the present application solve the above technical problems will be described in detail below with specific embodiments. The following specific embodiments can be combined with each other, and the same or similar concepts or processes can not be described again in some embodiments. The embodiments of the present application will be described below with reference to the drawings.
[0075] The present application calculates the attenuation coefficient of the water body under different distances of the structured light image, which has the advantages of simple operation, low cost, easy expansion, etc.
[0076] Figure 1 The structural diagram of the underwater robot for judging water quality in the embodiment of the present application is shown in FIG. 1. Figure 1 As shown in FIG. 1, the underwater robot for judging water quality in the embodiment of the present application comprises:
[0077] The structured light camera is used to obtain the image of the target object.
[0078] Specifically, the structured light camera is one of the core components of the present embodiment, which uses structured light technology to obtain the image of the target object. Structured light technology generally involves projecting a known pattern of light (such as laser stripes, grids or speckles, etc.) onto an object, and calculating the three-dimensional shape and depth of the object by observing how the pattern is distorted or deformed by the object surface.
[0079] The driving component is used to drive the underwater robot to change position in water.
[0080] Specifically, the driving components are the key to the underwater robot's movement, and they are responsible for changing the robot's position in the water under the instructions of the controller. The driving components may include thrusters, propellers, or other underwater propulsion technologies, enabling precise control of the robot's movement in three-dimensional space. The driving components are used to move the robot from a first position to a second position in order to capture images of the target object from different perspectives, which are used to calculate the water attenuation coefficient.
[0081] The controller controls the structured light camera to obtain a first image of the target object at a first position and calculates a first depth; controls the driving components to move the underwater robot to a second position, controls the structured light camera to obtain a second image of the target object, and calculates a second depth; and calculates a water attenuation coefficient based on the first image, the second image, the first depth, and the second depth.
[0082] Specifically, the controller is the brain of the underwater robot, responsible for receiving sensor data, processing information, and issuing instructions to control the behavior and operation of the robot.
[0083] At the first position, the controller instructs the structured light camera to capture a first image of the target object and calculates a first depth.
[0084] The controller then instructs the driving components to move the robot to a second position.
[0085] At the second position, the controller again instructs the structured light camera to capture a second image of the target object and calculates a second depth. As shown, the underwater robot is at the same direction as the target object but at different distances in the first position and the second position. Figure 2 Figure 2 In this case, the underwater robot is vertically oriented towards the target object (a wall). Walls are widely present in various artificial application scenarios such as swimming pools, dams, etc. The second position is at a different distance from the first position to obtain speckle images at different perspectives.
[0086] The controller uses these two sets of images and depth data, combined with appropriate algorithms (such as the water attenuation model), to calculate the water attenuation coefficient. The water attenuation coefficient is an indicator of the water's ability to absorb and scatter light, reflecting the clarity and light penetration ability of the water. By comparing the images and depth data captured at different positions, the controller can estimate the degree of light absorption and scattering by the water during propagation, thereby calculating the water attenuation coefficient.
[0087] In summary, this underwater robot for judging water quality integrates a structured light camera, driving components, and an intelligent controller, achieving accurate measurement of the water attenuation coefficient, providing strong technical support for water quality monitoring and water resource management.
[0088] Figure 3 A flowchart of the processing steps of a controller in an embodiment of the present application. A structured light camera projects a speckle structured light. As shown, the steps of the processing of a controller in an embodiment of the present application include: Figure 3
[0089] Step S1: At a first position, control the structured light camera to obtain a first speckle image of an underwater target object, and calculate a first depth according to the first speckle image.
[0090] In this step, the first position should ensure that the underwater robot can clearly capture the underwater target object and obtain an effective speckle image. Preferably, the underwater target object is a planar object, such as a swimming pool wall, etc. When the underwater robot reaches the first position, it starts its onboard camera to capture the speckle image of the underwater target object. The speckle image is a pattern formed by light shining on the surface of the underwater target object. Using image processing techniques and depth perception algorithms, the first speckle image obtained is analyzed to calculate the first depth between the underwater robot and the target object. It should be noted that the first position only needs to meet the distance requirement of the pre-selected setting, and does not need to be a fixed position, thus making the measurement more flexible.
[0091] Step S2: Control the driving component to move the underwater robot to a second position, obtain a second speckle image of the underwater target object, and calculate a second depth according to the second speckle image; wherein the first position and the second position are different distances from the underwater target object.
[0092] In this step, the underwater robot is moved to the second position. When the underwater robot reaches the second position, the camera is started again to capture the second speckle image of the underwater target object. The second position is farther or closer to the target object than the first position. Similar to step S1, image processing techniques and depth perception algorithms are used to analyze the second speckle image to calculate the second depth between the underwater robot and the target object. The underwater robot has the same projection parameters and exposure parameters when obtaining the first speckle image and the second speckle image, so that the difference between the first speckle image and the second speckle image is caused by the water body and the target object, excluding the influence of the shooting parameters.
[0093] Step S3: Extract the speckle region in the first speckle image to obtain a first brightness; extract the speckle region in the second speckle image to obtain a second brightness.
[0094] In this step, the speckle regions are extracted from the first and second speckle images using image processing techniques such as thresholding, edge detection, etc. These regions contain key information about the brightness and contrast of the speckle images. For the extracted speckle regions, their average or peak brightness is calculated as the first and second brightness. The calculation of brightness usually involves statistics and analysis of image pixel values.
[0095] Step S4: Calculate the water attenuation coefficient based on the first brightness, the first depth, the second brightness, and the second depth.
[0096] In this step, a mathematical model is established to calculate the water attenuation coefficient based on the relationships between the first brightness, the first depth, the second brightness, and the second depth using optical principles and relevant knowledge of water quality monitoring. The water attenuation coefficient is a parameter that describes the degree of absorption and scattering of light during its propagation in water, reflecting the clarity and transparency of water quality.
[0097] In some embodiments, the Lambert-Beer law is used for calculation. This law describes the attenuation law of light propagation in a medium, i.e., the exponential decay of light intensity with increasing propagation distance. By comparing the brightness values at different depths, the water attenuation coefficient can be estimated.
[0098] The attenuation coefficient is calculated using the formula: Based on the first brightness I1, the first depth l1, the second brightness I2, and the second depth l2, the following formula can be used to calculate the water attenuation coefficient c:
[0099]
[0100] Where ln represents the natural logarithm.
[0101] The attenuation coefficient reflects the degree of weakening of light propagation in water, which is affected by suspended particles, dissolved substances, and other factors in water. By comparing speckle images and depths at different positions, the transparency and cleanliness of water can be more accurately estimated.
[0102] This embodiment does not require complex chemical reagents or specialized measurement equipment, but uses the mobility of underwater robots and imaging technology for non-contact water quality assessment.
[0103] In some embodiments, the water attenuation coefficient is calculated in step S4 according to the formula 1i where Φ(l 1i ) represents the brightness of the i-th speckle at a distance of the first depth l 2i , and Φ(l 2i the brightness of the i-th speckle. It is to be noted that the first depth l 1i is not a fixed value, but can have different values for different speckles, and is collectively referred to as the depth value of different speckles in the first speckle image; similarly, the second depth l 2i is not a fixed value, but can have different values for different speckles, and is collectively referred to as the depth value of different speckles in the second speckle image. The embodiment calculates each speckle separately, and can obtain the brightness value of the calculated speckles, which can better evaluate the attenuation at different angles or positions and can cope with complex scenes.
[0104] In some embodiments, the water attenuation coefficient is calculated according to the formula in step S4; wherein Φ(l1) represents the average brightness of the plurality of speckles at a distance of the first depth l1, and Φ(l2) represents the average brightness of the plurality of speckles at a distance of the second depth l2. The embodiment processes the average brightness of the speckles, and can obtain more stable results.
[0105] Figure 4 is a flow chart of a step for obtaining a first depth in an embodiment of the present application. As shown in Figure 4 , the step for obtaining a first depth in an embodiment of the present application includes:
[0106] Step S11: controlling the underwater robot to capture a first adjustment image and performing three-dimensional reconstruction to obtain a first plane.
[0107] In this step, the underwater robot starts the camera device at the first position to capture an image containing the underwater target object, which is referred to as the first adjustment image. Image processing techniques and three-dimensional reconstruction algorithms are used to process the first adjustment image to obtain the three-dimensional information of the plane where the target object is located, i.e. the first plane. This usually involves steps such as feature point extraction, matching and three-dimensional coordinate calculation.
[0108] Step S12: calculating a first angle of the first plane in the camera coordinate system and calculating a first distance of the first plane.
[0109] In this step, the angle between the first plane and the camera optical axis in the camera coordinate system is calculated, i.e. the first angle. This angle reflects the degree of inclination between the underwater robot and the target plane. At the same time, the vertical distance from the underwater robot to the first plane is calculated, i.e. the first distance, which can be calculated by the plane model obtained by three-dimensional reconstruction. This distance is an estimate of the actual distance between the underwater robot and the target object.
[0110] Step S13: determining a rotation angle of the underwater robot according to the first angle, and rotating and moving the underwater robot according to the first distance and the rotation angle, so that the underwater robot is perpendicular to the first plane, and a second adjusted image is captured.
[0111] In this step, according to the first angle, the angle by which the underwater robot needs to be rotated is calculated, so that the optical axis of the camera is perpendicular to the first plane. The underwater robot is controlled to rotate by the calculated rotation angle, and the position of the underwater robot is adjusted (i.e., the underwater robot is moved) as needed to ensure that the camera can capture an image perpendicular to the first plane. After the underwater robot is rotated and moved into position, an adjusted image, i.e., a second adjusted image, is captured again.
[0112] Step S14: performing three-dimensional reconstruction on the second adjusted image to obtain a second plane, calculating a second angle and a second distance of the second plane, and if both meet preset values, marking the second adjusted image as a first speckle image and marking the second distance as a first depth, otherwise performing step S13.
[0113] In this step, the second adjusted image is three-dimensionally reconstructed to obtain a second plane. This plane should be closer to the ideal state of the underwater robot being perpendicular to the target plane than the first plane. In the camera coordinate system, the angle between the second plane and the optical axis of the camera (the second angle) and the vertical distance from the underwater robot to the second plane (the second distance) are calculated. The second angle and the second distance are compared with the preset threshold value. If both meet the preset value (i.e., both are within the allowable error range), it is considered that the underwater robot has correctly been perpendicular to the target plane, and the second adjusted image is marked as the first speckle image and the second distance is marked as the first depth. If the preset value is not met, step S13 is repeatedly performed until the condition is met. When step S13 is repeatedly performed, the first distance in step S13 is replaced by the second distance, and the first plane in step S13 is replaced by the second plane.
[0114] The underwater robot in this embodiment can accurately adjust its position and attitude to ensure that the captured speckle image is perpendicular to the target plane, and the depth information is accurate, providing a reliable data basis for subsequent water quality judgment.
[0115] Figure 5 A step flowchart for obtaining a first brightness and a second brightness in an embodiment of the present application is shown in FIG. 6. As shown in FIG. 6, the steps for obtaining a first brightness and a second brightness in an embodiment of the present application include: Figure 5
[0116] Step S31: extracting a first speckle region in the first speckle image and extracting a second speckle region in the second speckle image.
[0117] In this step, the regions containing speckle features are extracted from the first speckle image using image processing techniques such as thresholding, edge detection, morphological processing, etc., and are referred to as the first speckle regions. Similarly, the regions containing speckle features are extracted from the second speckle image and are referred to as the second speckle regions. These regions should roughly correspond in position to the first speckle regions, but may differ due to factors such as different angles of capture, different ranges of the target object, etc.
[0118] Step S32: Pair the first speckle regions and the second speckle regions to obtain the correspondence between the corresponding speckles.
[0119] In this step, the correspondence between the first speckle regions and the second speckle regions is established using feature matching algorithms such as SIFT, SURF, ORB, etc., or other related algorithms. This means finding a corresponding speckle in the second speckle region for each speckle in the first speckle region. This correspondence is determined based on the similarity of the speckles' positions, shapes, sizes, textures, etc. When the speckles are coded speckles, the correspondence is mainly determined by the positions of the speckles and their relationships with each other. Through the matching algorithm, a series of corresponding point pairs are obtained, which represent similar speckles found between the first speckle regions and the second speckle regions. These correspondences will be used for subsequent calculations and analyses.
[0120] Step S33: Obtain a third speckle region in the first speckle region according to the correspondence and calculate a first brightness; obtain a fourth speckle region in the second speckle region according to the correspondence and calculate a second brightness.
[0121] In this step, according to the previously established correspondence, the third speckle region corresponding to the corresponding speckle in the second speckle region is determined in the first speckle region, and the fourth speckle region corresponding to the corresponding speckle in the first speckle region is determined in the second speckle region. The third speckle region and the fourth speckle region only contain speckles with correspondence, and do not contain non-corresponding speckles. For the third speckle region and the fourth speckle region, their average brightness or peak brightness (or other appropriate brightness metrics) is calculated respectively. This can be achieved by statistically averaging the brightness values of all pixels in the region. The obtained first brightness and second brightness will be used for subsequent water attenuation coefficient calculation.
[0122] This embodiment ensures that the same feature points or regions in the speckle images obtained from two different positions are correctly associated, so that their brightness changes can be accurately compared. This comparison is crucial for estimating the attenuation coefficient of the water body, as the brightness changes of the speckles directly reflect the attenuation of light in the water. By accurately measuring and comparing these brightness values, the water quality can be more accurately assessed.
[0123] Figure 6 Another flowchart for obtaining the first brightness and the second brightness in an embodiment of the present application is shown. Compared with the previous embodiment, step S33 in the previous embodiment includes:
[0124] Step S331: According to the position of the first speckle region and the position of the second speckle image, a first correspondence relationship is obtained by matching.
[0125] In this step, the position information of each speckle in the first speckle region and the speckle at the corresponding position in the second speckle image are matched. The position deviation of the speckle on the image is always within a certain range, that is, the corresponding speckle of each speckle in the first speckle region in the second speckle region is within a preliminary area. Within the preliminary area, the corresponding speckle can be found. Through position matching, a series of speckle pairs are obtained, which establish a preliminary correspondence relationship between the first speckle region and the second speckle region, referred to as the first correspondence relationship.
[0126] Step S332: According to the first correspondence relationship, the depth value difference and the depth value difference average of the corresponding speckles are calculated.
[0127] In this step, for each matched speckle pair, the difference in depth is calculated. This involves extracting depth data from the position information of each speckle, and then calculating the difference between the two depth values. Repeat this process for all matched speckle pairs to obtain a series of depth differences. Then, calculate the average of these depth differences to obtain the depth difference average.
[0128] Step S333: Remove the speckle pairs whose depth value difference deviates from the depth value difference average by more than a first threshold from the first correspondence relationship to obtain a second correspondence relationship.
[0129] In this step, a threshold is set to determine which depth differences are acceptable. If the depth difference of a speckle pair deviates from the depth difference average by more than the threshold, it is considered that this speckle pair may be caused by noise or other non-water attenuation factors, and therefore it is removed from the correspondence relationship. This process helps to eliminate abnormal data and improve the accuracy of subsequent analysis. For each speckle pair, calculate the deviation of its depth value difference from the depth value difference average. If the deviation exceeds a preset first threshold (this threshold is set according to the application requirements and the accuracy requirements of water quality monitoring), it is considered that this speckle pair may be caused by mismatching or noise in the image and should be removed. After removing the speckle pairs with large deviations, the remaining valid speckle pairs constitute the second correspondence relationship. This correspondence relationship is more accurate and can be used for subsequent brightness calculation and water quality evaluation.
[0130] Step S334: Calculate the brightness of the speckles in the second correspondence located in the first speckle region to obtain a first brightness; and calculate the brightness of the speckles in the second correspondence located in the second speckle region to obtain a second brightness.
[0131] In this step, for each speckle in the second correspondence located in the first speckle region, its brightness value (such as average brightness or peak brightness) is calculated to obtain the first brightness. Similarly, for each speckle in the second correspondence located in the second speckle region, its brightness value is calculated to obtain the second brightness.
[0132] This embodiment can ensure that the speckle pairs that may be caused by false matching or noise have been removed by the depth value verification before the brightness is calculated, thereby improving the accuracy and reliability of the brightness calculation. These brightness values will be used for subsequent water attenuation coefficient calculation to evaluate the water quality condition.
[0133] Figure 7 The flow chart of the processing steps of another controller in an embodiment of the present application. Compared with the previous embodiment, the structured light camera projects a stripe structured light. As Figure 7 The processing steps of another controller in an embodiment of the present application include:
[0134] Step M1: At a first position, control the structured light camera to obtain a first stripe image of an underwater target object, and calculate a first depth based on the first stripe image.
[0135] In this step, the controller sends a start instruction to the structured light camera and configures the camera parameters (such as exposure time, frame rate, resolution, etc.) to adapt to the underwater environment. The infrared light source inside the structured light camera is activated to project a series of specific stripe patterns onto the underwater target object. The infrared camera of the structured light camera captures the reflected light pattern to form a first stripe image. The image data is transmitted to the controller for further processing. The controller calculates the depth information of each pixel of the stripe edge by comparing the original projection pattern with the captured reflection pattern using the structured light algorithm. Based on these depth information, a depth map is generated, in which the value of each pixel represents the distance from the camera, i.e. the first depth.
[0136] Step M2: Control the driving component to move the underwater robot to a second position, obtain a second stripe image of the underwater target object, and calculate a second depth based on the second stripe image; wherein the first position and the second position are different distances from the underwater target object.
[0137] In this step, the controller controls the driving components (e.g., thrusters) to move the underwater robot to a second location according to a pre-set path or instructions. During the movement, the controller may monitor the position and speed of the robot through sensors (e.g., sonar, GPS, etc.). When the robot reaches the second location, the image capture and depth calculation process in step M1 is repeated. The structured light camera projects the infrared light pattern again and captures a second fringe image. The controller calculates the second depth by comparing the original pattern with the reflected pattern in the second fringe image.
[0138] Step M3: Extract the bright fringe area in the first fringe image to obtain the first brightness; extract the bright fringe area in the second fringe image to obtain the second brightness.
[0139] In this step, the controller pre-processes the first and second fringe images, such as denoising, enhancing contrast, etc. The pre-processed images are easier to extract bright fringe areas. The controller uses image processing algorithms (such as threshold segmentation, edge detection, etc.) to extract bright fringe areas in the images. The extracted bright fringe areas should contain enough pixels to accurately measure brightness. For the extracted bright fringe areas, the controller calculates their average brightness or peak brightness as the first brightness and the second brightness. The calculation of brightness may involve statistics and analysis of pixel values.
[0140] Step M4: Calculate the water attenuation coefficient according to the first brightness, the first depth, the second brightness, and the second depth.
[0141] In this step, the controller integrates the data of the first brightness, the first depth, the second brightness, and the second depth. These data will be used to calculate the water attenuation coefficient. The controller uses known water attenuation models or algorithms to calculate the water attenuation coefficient according to the brightness data and depth data. The water attenuation coefficient is usually expressed as the proportion of energy attenuation of light propagating a certain distance in water. The calculated water attenuation coefficient is output to the display screen of the controller or stored in the memory. This coefficient can be used for applications such as evaluating water quality, monitoring water pollution, etc.
[0142] This embodiment uses structured light with fringe structure for underwater measurement, which can obtain depth data even in poor water quality conditions, and has wide application prospects.
[0143] In some embodiments, the average brightness in the width direction of the bright fringe is taken as the brightness value of the two pixel points on both sides. Using the brightness in the width direction of the bright fringe as the brightness value of the two points in the width direction makes the brightness more robust, and stable data can be obtained even in poor water quality conditions, improving the detection ability in different water quality.
[0144] The various embodiments described in this specification are intended to be illustrative of the invention and do not limit the scope of the invention. Although specific embodiments have been described herein, many variations are possible. For example, well-known elements have not been described in detail or have been described generally. Where the description of a specific embodiment has been preceded by the description of another embodiment, that does not mean that the description of the first embodiment is not applicable to the second embodiment. The disclosure of an embodiment does not exclude other embodiments from the scope of the disclosure. The scope of the invention is defined by the appended claims and their equivalents. The description of the embodiments is not meant to limit the scope of the invention. The scope of the invention is limited only by the claims.
[0145] The specific embodiments of the present application have been described. It is to be understood that the application is not limited to the specific embodiments described and that modifications can be made to these embodiments without parting from the spirit and scope of the application.
Claims
1. An underwater robot for judging water quality, characterized in that, include: Structured light cameras are used to acquire images of target objects; Drive components are used to drive underwater robots to change position in the water. The controller is configured to control the structured light camera to acquire a first image of the target object at a first position and calculate a first depth; control the drive component to move the underwater robot to a second position, control the structured light camera to acquire a second image of the target object and calculate a second depth; and calculate a water attenuation coefficient based on the first image, the second image, the first depth, and the second depth. The structured light camera projects speckle structured light or stripe structured light; When the structured light camera projects speckle structured light, the controller's processing includes: Step S1: At the first position, control the structured light camera to obtain a first speckle image of the underwater target object, and calculate the first depth based on the first speckle image; Step S2: Control the drive component to move the underwater robot to the second position, obtain the second speckle image of the underwater target object, and calculate the second depth based on the second speckle image; wherein the distances from the first position and the second position to the underwater target object are different; Step S3: Extract the speckle region from the first speckle image to obtain the first brightness; extract the speckle region from the second speckle image to obtain the second brightness; Step S4: Calculate the water body attenuation coefficient based on the first brightness, the first depth, the second brightness, and the second depth; When the structured light camera projects striped structured light, the controller's processing includes: Step M1: At the first position, control the structured light camera to obtain the first stripe image of the underwater target object, and calculate the first depth based on the first stripe image; Step M2: Control the drive component to move the underwater robot to the second position, obtain the second stripe image of the underwater target object, and calculate the second depth based on the second stripe image; wherein, the distance from the first position and the second position to the underwater target object is different; Step M3: Extract the bright stripe regions from the first stripe image to obtain the first brightness; extract the bright stripe regions from the second stripe image to obtain the second brightness; Step M4: Calculate the water body attenuation coefficient based on the first brightness, the first depth, the second brightness, and the second depth.
2. The underwater robot for judging water quality according to claim 1, characterized in that, The underwater robot uses the same projection and exposure parameters when acquiring the first speckle image and the second speckle image.
3. The underwater robot for judging water quality according to claim 1, characterized in that, Step S1 includes: Step S11: Control the underwater robot to capture the first adjusted image and perform three-dimensional reconstruction to obtain the first plane; Step S12: Calculate the first angle of the first plane in the camera coordinate system, and calculate the first distance of the first plane; Step S13: Determine the rotation angle of the underwater robot based on the first angle, rotate and move the underwater robot according to the first distance and the rotation angle, so that the underwater robot is perpendicular to the first plane, and take a second adjustment image; Step S14: Perform three-dimensional reconstruction on the second adjusted image to obtain a second plane, calculate the second angle and the second distance of the second plane. If both meet the preset values, mark the second adjusted image as the first speckle image and mark the second distance as the first depth; otherwise, proceed to step S13.
4. The underwater robot for judging water quality according to claim 1, characterized in that, Step S3 includes: Step S31: Extract the first speckle region from the first speckle image, and extract the second speckle region from the second speckle image; Step S32: Pair the first speckle region and the second speckle region to obtain the correspondence between the corresponding speckles; Step S33: Obtain a third speckle region in the first speckle region according to the correspondence, and calculate the first brightness; obtain a fourth speckle region in the second speckle region according to the correspondence, and calculate the second brightness.
5. An underwater robot for judging water quality according to claim 4, characterized in that, Step S33 includes: Step S331: Pair the positions of the first speckle region and the second speckle image to obtain a first correspondence; Step S332: Calculate the depth difference and the mean depth difference of the corresponding speckle based on the first correspondence; Step S333: Remove speckle pairs whose deviation from the mean depth value difference exceeds a first threshold from the first correspondence to obtain a second correspondence; Step S334: Calculate the brightness of the speckle located in the first speckle region in the second correspondence to obtain the first brightness; calculate the brightness of the speckle located in the second speckle region in the second correspondence to obtain the second brightness.
6. An underwater robot for judging water quality according to claim 1, characterized in that, In step S4, according to the formula Calculate the water body attenuation coefficient; where, This indicates the distance as the first depth. The brightness of the i-th speckle, This indicates the distance is the second depth. The brightness of the i-th speckle.
7. An underwater robot for judging water quality according to claim 1, characterized in that, In step S4, according to the formula Calculate the water body attenuation coefficient; where, This indicates the distance as the first depth. The average brightness of multiple speckles, This indicates the distance is the second depth. The average brightness of multiple speckles.
8. An underwater robot for judging water quality according to claim 1, characterized in that, The average brightness along the width of the bright stripe is used as the brightness value of the pixels on both sides.
Citation Information
Patent Citations
Water quality judgment method, system and equipment suitable for robot and storage medium
CN119310248A