Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How detect rain on camera vision using OpenCV in C++

Tags:

c++

opencv

How to recognize rain on camera vision using with OpenCV in C++?
Or if somebody stick a sticker on a camera how recognize it with OpenCV in C++? Or if somebody throw color to the camera how can i detect it with OpenCV in C++?

Detect these on camera vision:

  1. Rain
  2. Sticker
  3. Color

Here is an example video of sticker!
Camera Vision-Sticker

like image 794
SilverLight Avatar asked Sep 18 '25 20:09

SilverLight


2 Answers

In case of a sticker, you're just looking for a large dark area that doesn't change in time.

In case of color, analyze image color stats - if somebody sprays some paint on a camera (is that what you mean by "throwing color"?), some color is going to be dominant over all the others.

You can also try to handle both cases by subtracting frames and detecting image areas that don't change in time that way.

You may want to use machine learning for finding threshold values (e.g. area size, its shape properties, such as width/length ratio, continuousness etc.) used to decide when to consider something to be a sticker/color or something else.

As for the rain, I guess there's no simple answer that can be given in a few sentences. There are some articles available in the web though. That said, I would guess it would be simpler and cheaper to detect rain by just installing external rain sensors (like the ones activating wipers in a car) rather than trying to do it by developing your own computer vision algorithm for that purpose.

like image 154
KjMag Avatar answered Sep 21 '25 10:09

KjMag


This sounds like an interesting project, where a camera can automatically detect obstruction (paint, sticker, rain). It will most likely be necessary for the camera to be mounted without obstructions so that the expected image can be learned. If the usage scenario allows that, it won't be very hard.Both sticker and rain result in strong permanent deviations from the expected image, while rain will result in noisy images.

OpenCV with C++ or Python can help solve this kind of problems, because complicated computer vision algorithms are already implemented there. It takes some time to get started with, but after that OpenCV is not hard.

like image 24
Totoro Avatar answered Sep 21 '25 11:09

Totoro