Page 1 of 1

how to detect the water line

Posted: Wed Jul 11, 2018 2:48 am
by sinside
Hello,

I am new to openmv. I am using openmv for below application which i need to detect the waterline in the picture.
could anyone tell me how i can do that? Thanks in advance.
Note:
1. the background may change all the time
2. and the water in tube is increasing,
3. i need to send out the signal(e.g. pull down some IO) when the openmv detect the waterline reach some point.
4. sometimes, foam exist in the tube if the water is not clean, and how can i detect the waterline in this case.
2_1.jpg
2_1.jpg (166.35 KiB) Viewed 139 times
1_1.jpg
1_1.jpg (193.39 KiB) Viewed 139 times

Re: how to detect the water line

Posted: Wed Jul 11, 2018 12:09 pm
by kwagyeman
Color tracking is the easiest thing to do for this... however, it's very hard to do given you don't have much contrast in the scene...

How do you plan to mount the camera? Looking at the tubes from this direction? Can you possibly put some sort of background behind the tubes? And maybe color the water? Or color the tubes? It's hard to see the water line otherwise.

Re: how to detect the water line

Posted: Wed Jul 11, 2018 7:13 pm
by mechatronicsguy
I'd also suggest looking at the side edges of the tube, rather than the meniscus in front.

In your photo the empty portion of the tube appears to be reflecting a white object located to the left. That reflection is not present when the water is there (and changes the refractive index).
tube edge v02.png
tube edge v02.png (136.91 KiB) Viewed 128 times
Whatever method you use, I would suggest playing around with lighting, background and camera location until it's easiest to see from the image.

Re: how to detect the water line

Posted: Thu Jul 12, 2018 9:58 pm
by sinside
kwagyeman wrote:
Wed Jul 11, 2018 12:09 pm
Color tracking is the easiest thing to do for this... however, it's very hard to do given you don't have much contrast in the scene...

How do you plan to mount the camera? Looking at the tubes from this direction? Can you possibly put some sort of background behind the tubes? And maybe color the water? Or color the tubes? It's hard to see the water line otherwise.
Thanks for the reply. I will start with color tacking.

Since it's still an idea, i don't have the integrated sample right now. Please see below picture for the tubes and camera position.
1. The background may change all the time because the cover is transparent, and i can't change the color of the cover.
2. In fact, the liquid is not the water, so the color is not fixed, but mostly it's colorless and transparent.
3. I will check if we can find the tube with color, and it may take time.
3.jpg
3.jpg (1.64 MiB) Viewed 120 times

Re: how to detect the water line

Posted: Fri Jul 13, 2018 12:51 am
by kwagyeman
Okay, when you have some pictures from the camera's point of view I'll be able to help more. Note that what you are trying to do is very hard... even with a CNN it's still hard.

Re: how to detect the water line

Posted: Fri Jul 13, 2018 8:33 am
by iabdalkader
If you could put a colored float in the tubes it will be a lot easier to detect.

Re: how to detect the water line

Posted: Sun Jul 15, 2018 9:28 pm
by sinside
kwagyeman wrote:
Fri Jul 13, 2018 12:51 am
Okay, when you have some pictures from the camera's point of view I'll be able to help more. Note that what you are trying to do is very hard... even with a CNN it's still hard.
OK, I will send you the picture when the sample is ready. Maybe we can't find other way to have better result at that time.

Thanks again for your feedback!

Re: how to detect the water line

Posted: Sun Jul 15, 2018 9:41 pm
by sinside
iabdalkader wrote:
Fri Jul 13, 2018 8:33 am
If you could put a colored float in the tubes it will be a lot easier to detect.
I can't add float in the tubes, the liquid in the tubes are different chemical reagents, the float may change its chemical composition. Thank you very much for the suggestion, it provides me a broader idea to solve this problem rather than just focusing the system itself.