Hello, I am trying to build an application using a camera that has an automatic 180 degrees flip feature when its physically rotated to more than 90 degrees. I am trying to overcome this feature by flipping the image back when the automatic flip is triggered and I need a robust way to detect the feed rotation automatically to be able to flip it back. Any ideas?
while it is next to impossible to say, if any image is a “flipped” one without further clues like flipped text or “i know, the streetlamp is to the right of my window”
you may still try to catch the moment, the flip happens, by comparing current / last frame (ranging from simple absdiff() to BackgroundSubtractors)),
there should be a clear spike (also mirror symmetric, what was moved to the right, is missing on the left, and vice versa)
to check for flip symmetry (vs camera sweep), you could try to split your image in 2 halves along the sym axis, and reduce() both along that axis.
those should be similar for flip, but not for sweep
What do you mean by camera sweep?
Also, I think I should have mentioned that the video feed will be subject to change. Meaning that the things the camera will see will vary. It is a fixed setup with a bed where people come and go on and off the bed.
that the camera is moving in steps less than ± 90° (which would trigger a flip), so you probably have to deal with intermediate camera movement, too !)
please explain (maybe we’re saying the same thing ?)
If you imagine the image the camera displays then the sides would be somewhat the same over time without much variation whilst the center of the image defined by a rectangle would be variable. This is what I mean.
no idea, what you mean, sorry
I do not understand your problem either. Maybe photos of your problem would say more than just words.
thanks a lot for your inspiring post! I struggling actually also with an rotation problem a bit different you have done:
I have a binary image with a white rectangle. The image dimensions are sufficient so rotating the image up to 90° doesnt cut off anything. So far so good!
At the starting point (0° rotation) I count the white pixels.
Then I rotate the image using scipy.ndimage.rotate with reshape=False from 0°:1°:90° counting the white pixels of the rotated image and estimating the difference regarding no rotation.
What do I get: for some angles, the rotated rectangle has more and sometimes less white pixels than the rectangle without any rotation.
Do you know am algorithm or any hint to get a pixelinvariant rotation?? I´m struggling since days without any idea