connecting android with matlab i.e sending camera frames from android phone to the input image of matlab code.
3 views (last 30 days)
Show older comments
I am computing the distance of the detected object from the camera. For this I am using the code of measuring planar objects after camera calibration. Now instead of giving single image as input I want continuous camera frames from an android camera.
2 Comments
Anuja Vats
on 5 Oct 2017
Hi Priyanshi, I am doing something similar for lane detection. I need continuous frames from android camera going to my matlab function block which has code for image processing. can u tell me how to get these frames to be processed continuously?
Sruthi Yenugula
on 18 May 2018
Edited: Walter Roberson
on 18 May 2018
Hi Anuja,
You can use Simulink Support Package for Android Devices to convert a Simulink Model to Android Application. You can embed your MATLAB code in MATLAB function block and use this with other Android Blocks and create Android Applications with one Click.
To get camera frames use Android Camera Block and to display it on Phone screen, use Android Video Display Block. Connect camera Block output with input of MATLAB function block and input of Video Display block with output of MATLAB function block.
You can refer to the following example which uses MATLAB function block https://www.mathworks.com/help/supportpkg/android/examples/control-lego-mindstorms-ev3-robot-using-android-device.html
You can refer to the following example to get camera frames and display https://www.mathworks.com/help/supportpkg/android/examples/color-replacement.html
Answers (1)
Tohru Kikawada
on 21 Feb 2017
Try this.
1. Install "IPwebcam" app from the link and connect your Android to your host PC through WiFi.
2. Run the following code in MATLAB:
%%Acquire one frame
I = imread('http://192.168.2.100:8080/photo.jpg'); % IP address should be modified
figure, imshow(I)
4 Comments
Walter Roberson
on 20 Mar 2018
Edited: Walter Roberson
on 20 Mar 2018
Beril Sirmacek: are you using a local wired network, or WiFi, or cellular data, or udsr, or zigbee, or bluetooth ?
See Also
Categories
Find more on Android Devices in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!