简体   繁体   中英

Accessing android phone Camera thru USB from my java openCV application in real time

I'm trying to learn computer vision with OpenCV and i need camera to work with but the only camera that i have is on my android phone.

So im thinking about connecting it to my pc (via USB) and using it with my application. Is anything like that possible? Can i take information from camera connected via usb in real time?

I have no experience with something like this. I know i can just record video ,save it,put it on my pc, and use it as resource -bud i would prefer to have real time streaming of video while my application will work in background on my desktop computer.

Will i have to code some android application to get this working?Or can i simple ask for that data from my desktop application?

If you only want to experiment and learn to use OpenCV, you can get an IP Camera app for your phone and then read the image stream from your computer ( here's an example of how to do that). That is the easiest "real time-ish" solution I can think of.

I found a simple way to use the a web cam (IP Webcam installed on my smartphone through Play Store) as camera using OpenCV and Java. Here is how: just copy the IP Webcam web link inside the Video Capture. Like this.

org.opencv.videoio.VideoCapture webSource = new VideoCapture("http://192.168.43.1:8080/video"); 

The smartphone and the laptop should be inside the same Wi-Fi.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM