Find known situation in an online feed

Hi everyone,

I am new to OpenCV, studied some books and tutorials but I’m not sure how to proceed.

We are developing a control for a pneumatic sample changer running on raspberry pi. The aim is to monitor the movement and recognize whether one of the 4 end positions (X and Y) has been reached.
Essentially, the software is to be trained to find out from an online feed whether a known situation is present and to generate an event from this.
The input signal comes from an infrared camera with its own lighting. Nevertheless, a change in the lighting situation must be taken into account.

Would you please be so kind and point me in the right direction?

Many thanks in advance

Rolf Wittig

please show a few pictures of this situation. variety helps. outside views of the whole setup are good, but so are those IR pictures that need to be used.

I am sorry, as my account is still very new, i do not have the authorisation to reply to my own post with the requested images. Please tell me how to show them to you.

you can use image pastebins like imgur. you can put multiple pictures in one “album” there, so it’s a single link to share.

Please find a feed and pictures of the 4 positions here:

If requested, I can provide more under different conditions though the variance is not as great as I expected.
Contrary to what was mentioned, I would only process individual images, not the feed. The movement stops at these points so that a clean image capture is possible.
I now see several starting points:
1.) A “blind” approach, simply a series of images to teach.
2.) Search for circles of a certain radius
3.) Set masks and compare the brightnesses there
4.) Stick IR markers and look specifically for them in the images.
5.) Anything else?
Which approach is possible and which would you prefer?

Update: Approach #2 seems difficult because the obvious round objects are not reliable, they can move or disappear altogether, and the fixed objects are neither completely visible nor perfect circles, but rather incomplete ellipses. I could not find a way to see this in the picture.
So I tried #4 to put some circular IR markers, but could not find them reliably in the image.
Can someone please give me a hint, example or tutorial on how I could implement approach #1? So only recognise from still images which of the 4 situations it is? No tracking, no detail recognition. Meanwhile I found out “ground truth” is the keyword, I just need an example or tutorial. Please?

sounds like you need proper sensors for your position sensing. mechanical switches, light barriers, position/rotation encoders on the mechanical actuators… what’s preventing that?

if the laws of the universe require that you do this visually, then this needs to be approached with a machine vision mindset. that means you try your absolute hardest to control that environment so the pictures are actually usable. I know that you might not have the experience/judgment to know what “usable” implies. let’s just say those pictures do not have the properties required for a robust solution.

sure, you could just apply “AI”, but then you’d need to come up with the training data, and the AI would be as good or bad as your training data.

I have looked at those links you posted. neither the video nor the four pictures make any sense to me. the color tint in the photos seems to be arbitrary, and it’s monochrome, so I’d expect it to be gray, not tinted. jerky video, in unreasonably huge resolution relative to what’s actually visible. I just see some things moving around, and everything is fuzzy and badly lit, none of the objects are meaningful or identifiable to me, and it’s absolutely unclear to me what you need to identify in these videos, and more importantly why you need to do that.

generally, I think your problem is about structured, focused thought. this whole thread strikes me as messy thinking and messy explanation. there’s a lot of vagueness/abstraction floating around, when you need to be specific, concrete. you aren’t solving a philosophical problem but a physical engineering problem. you jump to solutions before you should, before the situation is clear. AI is not a “solution” that allows you to skip understanding the problem. for clear situations, I could give some thoughts to approaches. if some aspects were unclear, I’d ask specific questions. unfortunately, this entire thing presents itself as a game of “20 questions” to me. spending time on such situations is unsatisfying.

I am sorry that you are obviously in a bad mood. That is no reason to get personal. The time spent formulating why you can’t help me would be more helpfully invested in giving me any keywords that would have taken me further. It escapes me to understand what is unstructured in the question of how I can recognise the 4 states from 4 picture variations.