• Community
  • Odd behavior with OAK-D color camera

I've been experimenting with my OAK-D for several months now, running various example scripts unmodified, and a few scripts of my own, mostly derived from the examples with modifications to support my goals. I've noticed that when viewing the ColorCamera isp stream, I see something that is difficult to describe, but visually appears that something moved the camera forward and then backward (or maybe backward and forward). I know for sure that there is no mechanical motion as the camera is firmly attached to an immobile object. The phenomenon lasts probably less than a second, and seems to happen at unpredictable intervals on the order of minutes.

I've only noticed the behavior with the color camera, but it may happen with the mono cameras as well.

Could this be a power issue? I'm powering the camera currently with just the USB cable from my MacBook Pro. But I remember seeing the phenomenon even when I first started experimenting and also had the power adapter connected.

Is this behavior expected, or am I unlucky? Is there anyway to investigate further in order to fix it?

    gregflurry I just experienced this again. I wonder if there is some autofocus thing that produces the phenomenon.

    • erik replied to this.

      Hello gregflurry , so what you are seeing is the autofocus kicking in. It's not perfect so from time to time, it will re-try to focus itself (even though it's already focused) and do that little 1sec process. You can fix this by manually setting the focus value. Demo here, you can increase/decrease focus with , and ..
      Thanks, Erik

      @erik Thanks. In another example, rgb_depth_aligned, I found the following comment: "For now, RGB needs fixed focus to properly align with depth." I am experimenting with MobileNetSpatialDetectionNetwork and I'd assumed that it attempts to align the incoming depth with the incoming input derived from the color camera. However, the example that uses MobileNetSpatialDetectionNetwork, spatial_mobilenet, does not set manual focus. I am a bit puzzled; can you explain?

      Also CameraControl.setManualFocus has a parameter whose value is 0..255. There is no elaboration on what the value means in terms of focus. rgb_depth_aligned uses 130 because that "value was used during calibration". Any advice on choosing the proper value?

      • erik replied to this.

        Hello gregflurry , you only need set focus (to 130) for RGB depth alignment. The advice would be to just go through values and see what works for you. There's nothing behind these values (eg. certain value = certain focus in cm/meters), so you have to experiment.