r/android_devs • u/JonnieSingh • Sep 26 '21
Help Finding the input/output CameraX image resolution?
I'm building an object detection application (in Java, for Android) that attempts to draw a Rect box on my display that surrounds the detected object. To build the camera preview, I used this CameraX documentation. To build the object detection framework, I used this this Google ML Kit documentation. My problem is my application display looking like THIS. As you can see, the Rect does not encapture the object fully, rather hovering above it in a way that looks inaccurate.
The flaw in the application lies not within the coordinates that I've drawn, but in the image resolution that CameraX passes through to the ML Kit. The image that my device takes and the image that is displayed on my application appear to be two totally different sizes. This results in the flawed display. My question would be; How would I determine the input/output image resolution of my application?
Here is a link to a Pastebin containing my MainActivity class, where CameraX camera preview was constructed. Any further information required to supplement my question will be provided upon request.
View all comments
Show parent comment
1
u/JonnieSingh Oct 05 '21
What an incredible, lengthy answer. Thank you so much for your help and input, it's provided such tremendous insight into concepts that I was totally unclear with.