OpenFTC / EasyOpenCV

Finally, a straightforward and easy way to use OpenCV on an FTC robot!
213 stars 95 forks source link

Camera slow to load #71

Closed EddieDL closed 8 months ago

EddieDL commented 8 months ago

We are using a generic USB camera and we are having issues where it takes a long time for the camera to start the stream. Often we have to stop and start the opmode to get it working or it takes close to a minute to actually start. With a "standard" logitech camera it is quick, but we need the wide field of view of our generic camera.

What can we do to fix this?

Windwoes commented 8 months ago

Based on my experience with another camera that behaved similarly (Arducam), it's a case of the device responding poorly to a USB protocol reset before trying to start the stream where the fix is to not reset it. Unfortunately that fix must be made in a C++ file inside the SDK itself (which contains the UVC driver) not in EOCV.

Without having a camera on hand it's impossible to say really though.

EddieDL commented 8 months ago

@Windwoes thanks for the response. Do you know of a camera with a wide for that does work fast or a brand that seems to be better?

EddieDL commented 8 months ago

https://www.amazon.com/dp/B07R44YHW7?ref=ppx_pop_mob_ap_share this is what we have.

Windwoes commented 8 months ago

@Windwoes thanks for the response. Do you know of a camera with a wide for that does work fast or a brand that seems to be better?

Not off the top of my head. Perhaps ask around on the ftc discord or subreddit, or possibly on the ftc community forum.

EddieDL commented 8 months ago

One thing I forgot to mention is that it is only slow when the robot is just powered on. After it connects one time it works fine. Not sure if that gives anything more. But thought I would mention it.

@Windwoes

Windwoes commented 8 months ago

Oh, that's interesting. Logs showing an instance of the initial failure and then subsequent working fine might be interesting.

EddieDL commented 8 months ago

Okay I will see what I can dig up in the logs. I think we can just download them from the Robot Controller. If there is something special that needs to be done, let me know.

EddieDL commented 8 months ago

We got a new camara and it is WAY faster. Thanks for the responses.