I think that the problème is due to the opencv adaptability with the raspbian version used.
I will think about:
either change linux distribution (but I will face other problems on other applications used on raspberry)
either change my script regarding the movment and saving detection
Maybe, consider jumping back to a previous version of opencv that is compatible?
scraping the code.
Seeing the new htop prints makes me want to see the exactly how much cpu and ram this program wants to eat up. Remember when you made it run on your windows machine. I’d start commenting out parts of the code to find exactly where the resources are going.
Revisiting video encoding.
I also want to revisit this.
Before we were not sure what was causing the problem, so when we saw the encoding work on the windows machine we put this idea to bed. BUT now we think its processor-power related. A quality encoding can be cpu intensive, but you’re windows machine would not have noticed. It may be that a different, light-weight encoding will reduce the cpu footprint and allow the program to run smoothly on the PI.
So I have tested swapping the encoder the result is the same way whatever the configuration (basic OS with applications or cleaned OS without any applications)
Jumping back to previous version of opencv seems a good alternative but which version should I choose? And which method ( Apt or pip ) ? But before that I want to test the possibility with a virtual environment do you think that a good idea ?
the objective of my script is to detect the comings and goings of animals in my garden (birds, squirrels, etc.) in order to carry out some tests of the intelligence of individuals on different practical exercises, particularly on crows and magpies. I thought with opencv I could sort individuals and sort my captures. Maybe in the end just detecting a movement would be enough. I will sort it manually after capture on the computer.
thanks you for your help
@JohnAldrin265147 : What is your problem exactly , the same I have on my raspberry ? Because for the moment we have no solution.
Which raspberry do you use?
Which OS environment?
Which camera and connection?
briefly resume the progress of @Pixmusix above …
Not sure which version. At this point, without the same setup as you to debug, I’m just working through my debugging checklist and hoping something works . Trying to think outside the box with you.
Think about reducing the frame rate of the capture.
I’m imagining a function like the below.
if detection and 1000_millis_elapsed_since_last_capture():
If you would like to peruse this I’d suggest using pickle. You can pickle the out object and save that on disk. Then un-pickle them on a powerful computer for the rendering. Pickling is fast, and uses very small amounts of ram and rom.
Finally after many tests I think that Opencv is not adapted for raspberry Pi ( Opencv application requires too many resources)
So I have changed by lighter application MotionEye whose results suit me perfectly
thanks you very much for your help