My goal is to create a scanner app by scratch. To do this, I am using the CameraX library in android in java. Assume that I have already detected the corners of the page. After the image is captured, how to I perform the transformation matrix multiplication on the image? (I am following the algorithm mentioned here except trying to do it in java) I would need the image in a matrix so that i can multipy each pixel position say [i, j, 1] by my 3x3 transformation matrix to get the new position. Then, i would have another matrix where i record the color of pixel that was transformed if it is inside the area that I want to show. Finally, i would convert the final matrix into an image.
So basically, my question(s) are:
- how do I do perform operations with the captured image in camerax in java
- how do I convert a image to a matrix (to do the stuff mentioned above) then a matrix back into an image
I want it so that when the user clicks the capture button, the latest coordinates of the corners of the document are recorded and used to transform the captured image using the transformation matrix.