Join devRant
Do all the things like
++ or -- rants, post your own rants, comment on others' rants and build your customized dev avatar
Sign Up
Pipeless API
From the creators of devRant, Pipeless lets you power real-time personalized recommendations and activity feeds using a simple API
Learn More
Related Rants
So I'm working on a computer vision project that grabs video from my webcam and detects faces in each frame. Earlier yesterday morning I was capping out at 30 frames per second, which is what I believe to be the max for my webcam. As the day became night and I was wrapping up my work on a portion of the project, I noticed that my newly compiled version was only getting around 8 frames per second. Confused, I looked into my frame grabbing + face detection code.
"Maybe I can only detect faces in a certain region of the image, based on where the face was in the previous image?" No, still 8fps. Hmm.
"How about I lower the resolution of the image, that would definitely help!" I tried that, but no speed boost came either. What??
I start to dig deeper. Maybe I'm not linking my libraries correctly, and it's using an older library I compiled. So I recompile that. Nothing.
"Am I low on resources?" I close out of all my other apps. Nothing.
Okay, wtf. Now I just comment out the face detection code entirely, and only grab webcam frames.
8fps. ?????
Suddenly, I get an idea. I get out of my desk, walk over to the doorway of my room, and flip the light on. I sit back down, and run my code.
30fps.
The stupid webcam switches to "night mode" when it detects low light, which restricts its ability to output frames at high speed and caps at 8fps. Damn, I felt like a fool 😂
undefined
debug
no sleep
computer vision