For a research project involving Optical Camera Communication (OCC), I need to actively analyze video frames, which I am currently doing offline on my pc using python and opencv (I record the video with my smartphone, then process it afterwards). I want to process the video live by using the camera on my samsung galaxy a40. I am fairly new to android development, so I just want to create a basic application for capturing video and transmitting it to my pc for analysis. My application requires 1080p captures at 30 fps, or better.
I am currently using the Android Camerax API which provides the imageAnalysis use case, which gives me access to the raw images planes: I get an ImageProxy in YUV_420_888 format.
I am still familiarizing myself with the API but have been able to reproduce some basic applications based on online examples. I have one concrete questions left:
What is the best way to serialize and transmit the images to my python application on pc? I was planning on creating a simple TCP connection using sockets, converting the image to bitmap and directly sending it like this. I am however not certain if this approach is very efficient, and I don't know how to convert the image and buffer it. Code examples are certainly welcome. A wired connection (USB cable to my pc) is also possible, but I didn't find any support for that.
Any ideas are welcome! Thanks in advance.