THẢO LUẬN

Nguyễn Huy Hoàng Software Engineer

📧 Email: hhoang02052004@gmail.com 📞 Phone: 0941 280 073

Trân trọng, Nguyễn Huy Hoàng

0

Nguyễn Huy Hoàng Software Engineer

📧 Email: hhoang02052004@gmail.com 📞 Phone: 0941 280 073

Trân trọng, Nguyễn Huy Hoàng

0

Nguyễn Huy Hoàng Software Engineer

📧 Email: hhoang02052004@gmail.com 📞 Phone: 0941 280 073

Trân trọng, Nguyễn Huy Hoàng

0

Nguyễn Huy Hoàng Software Engineer

📧 Email: hhoang02052004@gmail.com 📞 Phone: 0941 280 073

Trân trọng, Nguyễn Huy Hoàng

0

Nguyễn Huy Hoàng Software Engineer

📧 Email: hhoang02052004@gmail.com 📞 Phone: 0941 280 073

Trân trọng, Nguyễn Huy Hoàng

0

Nguyễn Huy Hoàng Software Engineer

📧 Email: hhoang02052004@gmail.com 📞 Phone: 0941 280 073

Trân trọng, Nguyễn Huy Hoàng

0

Nguyễn Huy Hoàng Software Engineer

📧 Email: hhoang02052004@gmail.com 📞 Phone: 0941 280 073

Trân trọng, Nguyễn Huy Hoàng

0

The Official Page for CameraX and Camera2 documentation confirms that autofocus behavior like this is expected. When you quickly change scenes, the AF system may still be locked or converging from the previous focus state, especially on devices like Samsung where vendor tuning affects behavior.

Why This Happens

CameraX uses the underlying Camera2 API. Autofocus is not instant. When you move the camera quickly, the AF state does not reset immediately, so the capture can occur before refocus completes. This leads to blurred or incorrectly focused images.

How to Fix or Improve It

  1. Trigger Focus Before Capture Use FocusMeteringAction in CameraX to request a new focus before capturing:

Call focus on the new subject Wait for AF to converge Then capture

  1. Check AF State Observe CameraInfo or capture callbacks and only take the picture when AF state is FOCUSED_LOCKED or PASSIVE_FOCUSED.

  2. Cancel Previous AF You can cancel the current focus action before triggering a new one to avoid “stuck” focus:

cameraControl.cancelFocusAndMetering()

  1. Add a Small Delay If instant capture is not critical, adding a short delay (even 200–500 ms) after scene change helps AF settle.

Best Practice

Balance speed and accuracy:

For fast capture: allow slight blur risk For quality: trigger AF and wait for lock

In short, this is normal behavior, and the best approach is to actively manage autofocus instead of relying on passive AF when scenes change quickly.

0

Nguyễn Huy Hoàng Software Engineer

📧 Email: hhoang02052004@gmail.com 📞 Phone: 0941 280 073

Trân trọng, Nguyễn Huy Hoàng

0

Nguyễn Huy Hoàng Software Engineer

📧 Email: hhoang02052004@gmail.com 📞 Phone: 0941 280 073

Trân trọng, Nguyễn Huy Hoàng

0

Nguyễn Huy Hoàng Software Engineer

📧 Email: hhoang02052004@gmail.com 📞 Phone: 0941 280 073

Trân trọng, Nguyễn Huy Hoàng

0

Nguyễn Huy Hoàng Software Engineer

📧 Email: hhoang02052004@gmail.com 📞 Phone: 0941 280 073

Trân trọng, Nguyễn Huy Hoàng

0

Nguyễn Huy Hoàng Software Engineer

📧 Email: hhoang02052004@gmail.com 📞 Phone: 0941 280 073

Trân trọng, Nguyễn Huy Hoàng

0

Nguyễn Huy Hoàng Software Engineer

📧 Email: hhoang02052004@gmail.com 📞 Phone: 0941 280 073

Trân trọng, Nguyễn Huy Hoàng

0

Nguyễn Huy Hoàng Software Engineer

📧 Email: hhoang02052004@gmail.com 📞 Phone: 0941 280 073

Trân trọng, Nguyễn Huy Hoàng

0

Nguyễn Huy Hoàng Software Engineer

📧 Email: hhoang02052004@gmail.com 📞 Phone: 0941 280 073

Trân trọng, Nguyễn Huy Hoàng

0

Nguyễn Huy Hoàng Software Engineer

📧 Email: hhoang02052004@gmail.com 📞 Phone: 0941 280 073

Trân trọng, Nguyễn Huy Hoàng

0

Nguyễn Huy Hoàng Software Engineer

📧 Email: hhoang02052004@gmail.com 📞 Phone: 0941 280 073

Trân trọng, Nguyễn Huy Hoàng

0

Nguyễn Huy Hoàng Software Engineer

📧 Email: hhoang02052004@gmail.com 📞 Phone: 0941 280 073

Trân trọng, Nguyễn Huy Hoàng

0
Viblo
Hãy đăng ký một tài khoản Viblo để nhận được nhiều bài viết thú vị hơn.
Đăng kí