Water quality check in a tank of murky water

how can I count the number of edges in an edge map generated by canny algorithm.
or what is the best way to do quantifiable compare between two edge maps?

this question looks like a classical XY problem, so:

please explain, what you want to achieve with it ?
what is the general purpose of your program ?
could you add your input data & current coding attempt ?

that sounds, like you made it up.
most likely, you will have to retrieve contours, and operate on those,
please have a look at our tutorials

I’m trying to do a water quality check using image processing for a under water com. channel. in the method i came up with, a camera takes a photograph of a reference image placed on the other side of murky water tank. The program compare current picture’s edge map with pure water’s edge map and give a measurement on water quality(visibility) compared to pure water.
Any advice on quantifiable compare is appreciated.
thanks

Nobody can advice on this without knowing what the teference image is like, and other detsils, but if the image has for example lines of various contrasts or width, then you should detect lines, using functions and preprocessing designed for that.

perhaps you should explain the properties of murky water.

it doesn’t “blur”. trying to detect edges seems pointless to me.

murky water scatters some light (in addition to water itself attenuating light by wavelength). what’s arriving in the camera is an attenuated view of your reference object, some haloing from that light scattering against the medium, and some diffuse flat contribution (media scattering) from far away light sources (sky).

in your place, I’d make a reference object with a few features. you’d want a large black area to estimate ambient light (which you’d then have to subtract from everything else). you’d want a small white dot on a large black area to estimate direct transmission excluding scattering of the same light. and you’d want a large white area to estimate direct transmission including scattering of the same light.

and then you wouldn’t want to “find” those features, you’d wanna know where they are in the picture already, by construction/calibration.

if you want decent measurements, you’d have to figure out how to get raw sensor values out of your camera sensor.

all of that could also be made with a bunch of cheap electronics: photo diodes as sensors, leds/lasers to actively emit light. and everything in a tube to easily shield against ambient light, or else you’d have to estimate that again.

water quality sensors exist. there must be written a lot on their operating principles and construction, and they’re probably trivial to buy, but maybe not terribly cheap.