Image live stream from ODROID to MATLAB
Required:
- ODROID with OpenCV installed.
- Computer with OpenCV installed in default locations.
- MATLAB with associated compiler e.g. XCode(Mac OS)/Visual Studio or Microsoft SDK (for Windows)
- WiFi network (Access Point)
- Streaming ODROID application + MATLAB receiving application
ODROID setup
- setup OpenCV
- setup streaming application
setup OpenCV
- Make sure that your odroid is connected to internet.
- Open a terminal window, and run the follwoing command,
$ sudo apt-get -y install libopencv-dev $ sudo apt-get -y install build-essential cmake git libgtk2.0-dev pkg-config libavcodec-dev libavformat-dev libswscale-dev python-dev python-numpy libtbb2 libtbb-dev libjpeg-dev libpng-dev libtiff-dev libjasper-dev libdc1394-22-devsetup streaming app
- create a clean directory and navigate to it e.g.
$ cd ~/Desktop $ mkdir imgstream $ cd imgstream - clone the streaming app from Github
$ git clone https://github.com/mzahana/Image_Live_Stream.git $ cd Image_Live_Stream navigate to the
stream_cppfolder, and compile the app$ cd opencv_stream/stream_cpp $ cmake . & makeif all goes well, then two executable files should be generated:
senderandreceiver. Otherwise, make sure that you installed OpenCV properly in the default locations.To stream images over network, use the
senderapp after you connect a camera to ODROID. To use thesenderapp, use the following command in a terminal, inside thestream_cppfolder,$ ./sender 192.168.1.100 10000where
192.168.1.100is the IP of machine running MATLAB (the host machine) (which should be on the same network as the ODROID's).10000is the port that MATLAB is listening on. Use appropriate IP and port that match the host ones.
MATLAB setup
On MAC OS
- Make sure that you installed XCode on your Mac OS (Google it).
- Make sure that you associat your MATLAB with XCode compiler (Google it). Run
mex -setupin MATLAB command line for more information. - Navigate to the
Image_Live_Streamfolder that you downloaded from Github.
run the setup.m file
>> setup
If all goes well, you are ready to receive live stream of images from ODROID.
- Look at the
testScript.mfile to see how you can use the ImgStream class to establish the connection, and receive image data.
On Windows
- Make sure that you install OpenCV 2.4.13 on your Windows. Follow this video. It is assumed that you installed the opencv folder in
C:\ - Make sure that your MATLAB is associated with compiler. Run
mex -setupin MATLAB command line for more information. - In MATLAB, run the
setup.mfile.
If all goes well, you are ready to receive image stream. Look at the test script to get familiar on how to use the ImgStream Class.