Computing water level based on difference in frame colors

I am trying to measure the water levels taken from a camera as a burst of waves is run. I have the camera recording of the water level as an avi file. I need to extract all the frames from this avi file, in order to measure the water level in each frame. A green dye was placed in the water to allow for easy examination of the water column (see attached picture).
Any ideas how I would do this on MATLAB?

回答 (1 件)

Image Analyst
Image Analyst 2019 年 4 月 17 日

1 投票

I would convert from RGB to HSV, then take the S channel. I'd then take the mean along rows (direction 2), then take the location of the hald way point. Something like
hsvImage = rgb2hsv(rgbImage);
verticalProfile = mean(hsvImage(:, :, 2), 2);
threshold = 0.5 * (min(verticalProfile) + max(verticalProfile))
topLine = find(verticalProfile > threshold, 1, 'first')
hold on;
line([1, size(rgbImage, 2)], [topLine, topLine], 'Color', 'r')
If it doesn't work, attach the image that it doesn't work for.

1 件のコメント

Vivek
Vivek 2019 年 5 月 1 日
I am not sure I follow. What I want to do is get the water column measurements throughout the entire avi file (so the water column measurement in each frame). The initial water level is 5 cm (in the pic attached in the first post).
Any ideas how I would go about doing this?

サインインしてコメントする。

カテゴリ

ヘルプ センター および File ExchangeConvert Image Type についてさらに検索

質問済み:

2019 年 4 月 17 日

コメント済み:

2019 年 5 月 1 日

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by