Detection of borders around an image

Asked by Gabriel Dupuis on 2018-04-22

So I know python and I am planning to learn how to use Sikuli. I have some projects in mind.
Ultimely the main project I want to do is something with the security camera at my work.

The movement detection system here is very old.
When a camera detect movement a red frame appear around the output image.

And I want to know if I can detect that frame with sikuli, so I can make a more visible warning and specify which camera detected movement ( I can specify which camera is used if I have the x,y coordinates of the red frame I believe)

So my main question is there some function to detect a red frame and ignore what is inside that red frame?

thanks a lot

Edit: found a way it will work and will be even easier than I though.
The red Frame is inside the image of the camera and on the lower left corner of each camera there is the name of the camera in a black background.

I can definely use that to detect cameras!
time to get to work :)

Question information

English Edit question
Sikuli Edit question
No assignee Edit question
Solved by:
john gonale
Last query:
Last reply:
RaiMan (raimund-hocke) said : #1

not possible with SikuliX currently.

Best john gonale (erojiji) said : #2

     you could try taking a screenshot of a small section of a single side of the square, (you would want to make sure that you only get the red line, and nothing else from the img) and then dividing the individual camera area's into regions, checking each region in a loop for the existence of that small red line.
      it would probably work better if the camera's were black and white/greyscale, which would reduce false positives

Gabriel Dupuis (hanslowell) said : #3

Thanks john gonale, that solved my question.

RaiMan (raimund-hocke) said : #4

I did not dare, to suggest the solution of comment #2 (too feasible and might take too long for the detection).
Since you posted it as solved, I would be interested in your final solution.