Bridging C++ and Java with Qt JNI
summary
A cross‑platform C++ app built with Qt and QML uses QJniObject to call Java ONNX Runtime for on‑device YOLO inference, handling HWC→CHW reordering and multiple array copies; initial pipeline runs ~4s per image, after bitmap/scaling and concurrency tweaks it reaches about 2.1 seconds per image on mid devices (older phones show 3–5s), demoed ~96% confidence detections and deployed through Android storage via MediaStore; JNI pitfalls (local/global refs, thread attach) get concrete fixes and reusable helpers.
AI-written summary · about
chapters (11)
- 0:00Introduction and motivation
- 3:03Project overview and challenges
- 7:04Choosing Qt and Java for Android
- 10:21Tradeoffs in C++ and Java integration
- 15:00Qt JNI wrappers vs raw JNI
- 20:25Image processing pipeline
- 27:36Thread safety and references
- 31:54Performance optimizations
- 38:04Real-world AI architecture
- 43:36Live demo of the app
- 46:30Q&A session
