Water turbidity evaluation using image sensor
Disclosed herein are systems and methods for estimating water turbidity using image data, comprising analyzing a plurality of images of one or more objects submerged in water captured under water from a plurality of distances, calculating a luma value for each of a plurality of pixels along one or more gradient lines across the object(s) in each of the plurality of images, calculating, for each image, a respective maximal intensity change between a lowest luma value and a highest luma value of the pixels along the gradient line(s) in the respective image, evaluating a turbidity of the water based on mapping of the respective maximal intensity change to each of the plurality of distances, and initiating one or more actions in case the turbidity exceeds a certain threshold.
1 . A method of estimating water turbidity using image data, comprising:
using at least one processor for:
analyzing a plurality of images captured under water by at least one imaging sensor to identify at least one object submerged at least partially in the water and distinguishable from its background, each of the plurality of images is captured from a respective one of a plurality of distances between the at least one imaging sensor and the at least one object;
calculating a luma value for each of a plurality of pixels along at least one gradient line across the at least one object in each of the plurality of images;
calculating, for each image, a respective maximal intensity change between a lowest luma value and a highest luma value of the pixels along the at least one gradient line in the respective image;
evaluating a turbidity of the water based on mapping of the respective maximal intensity change to each of the plurality of distances; and
initiating at least one action in case the turbidity exceeds a certain threshold.
2 . The method of claim 1 , wherein turbidity of the water is evaluated based on at least one fitting function adapted to approximate distribution of the maximal intensity changes mapped with respect to the distances from the at least one object.
3 . The method of claim 2 , wherein the at least one fitting function is formulated by:
y=a·e −b·x
where y is the respective maximal intensity change calculated for each of the plurality of images which correspond thus corresponding to one of the plurality of distances x, a is a largest maximal intensity change identified in the at least one gradient line in all of the images, and b is the estimated turbidity.
4 . The method of claim 1 , wherein turbidity of the water is evaluated using at least one machine learning (ML) model trained to map images of the at least one object from the plurality of distances to respective turbidity values.
5 . The method of claim 4 , wherein the at least one trained ML model is trained using a plurality of labeled training images depicting the at least one object from a plurality of distances, a label of each of the plurality of labeled training images is indicative of a distance from which the respective training image is captured and a measured turbidity value.
6 . The method of claim 1 , wherein the water is swimming pool water.
7 . The method of claim 1 , wherein the at least one action is a member of a group consisting of: transmitting at least one alert message, and inducing operation of water cleaning equipment in case the turbidity exceeds a predefined threshold.
8 . The method of claim 1 , wherein the at least one object is detected using at least one visual analysis algorithm applied to analyze the plurality of images.
9 . The method of claim 1 , further comprising converting at least one of the plurality of images to a plurality of respective greyscale images before calculating the luma value for each of the plurality of pixels.
10 . The method of claim 1 , further comprising preprocessing at least one of the plurality of images using at least one filter configured to enhance at least one of the plurality of images.
11 . The method of claim 1 , wherein the distance to the at least one object is calculated using at least one distance measurement device.
12 . The method of claim 1 , wherein the distance to the at least one object is calculated based on at least one known dimension of the at least one object extracted from a respective image.
13 . The method of claim 1 , wherein the at least one gradient line is a member of a group consisting of: a horizontal line, a vertical line, a diagonal line, and a curved line.
14 . The method of claim 1 , wherein the gradient line selected for calculating the intensity change comprises a plurality of pixels with gradually increasing or gradually decreasing luma value.
15 . A system for evaluating water turbidity using image data, comprising:
at least one processor configured to execute a code, the code comprising:
code instructions to analyze a plurality of images captured under water by at least one imaging sensor to identify at least one object submerged at least partially in the water and distinguishable from its background, each of the plurality of images is captured from a respective one of a plurality of distances between the at least one imaging sensor and the at least one object;
code instructions to calculate a luma value for each of a plurality of pixels along at least one gradient line across the at least one object in each of the plurality of images;
code instructions to calculate, for each image, a respective maximal intensity change between a lowest luma value and a highest luma value of the pixels along the at least one gradient line in the respective image;
code instructions to evaluate a turbidity of the water based on mapping of the respective maximal intensity change to each of the plurality of distances; and
code instructions to initiate at least one action in case the turbidity exceeds a certain threshold.