Demo Code for a VC MIPI Camera Module

Source Code and Binaries

Revision: 0.0
Date: 2018-10-23
Copyright: 2018 Vision Components GmbH Ettlingen, Germany
Author: VC Support

Table of Contents

Package Structure

File/Directory Description
src/ Source Code of programs
src/vcimgnet.c For local user program to connect to the 'vcimgnetsrv'.
src/vcimgnetsrv.c Server for Image transfer to 'vcimgnetclient' over TCP/IP.
src/vcimgnetclient.py Python Client to connect to the 'vcimgnetsrv', needs Python version 2 and PyGTK installed.
src/vcmipidemo.c Demo for image capture and display.
bin/ Pre-compiled binaries for the demo using the libc version 2.19
bin/vcimgnetsrv Server for Image transfer to 'vcimgnetclient' over TCP/IP.
bin/vcmipidemo Demo for image capture and display.

Compile Instructions

Extract the demo zip file to a directory at your system, and change to the 'src/' directory. Be sure the Gnu C compiler is installed and ready to use, this may be done by executing the following command:

sudo apt-get install build-essential

Compiling the 'vcimgnetsrv'

Call the Gnu C compiler by using the following command:

gcc -o vcimgnetsrv vcimgnetsrv.c vclib-excerpt.c -lrt

Compiling the 'vcmipidemo'

Call the Gnu C compiler by using the following command:

gcc -o vcmipidemo vcmipidemo.c vcimgnet.c vclib-excerpt.c -lrt

A faster version can be generated using multiprocessing via openmp. Use the following compile options therefore:

gcc -O3 -fopenmp -o vcmipidemo vcmipidemo.c vcimgnet.c vclib-excerpt.c -lrt

Execution Instructions

By default the captured images are output to the console as an ASCII art. If the 'vcimgnetsrv' program is running, the image will be also available over the 'vcimgnetclient.py'.

A command line option enables the transfer of the image data to a framebuffer, see the source code for the output conversion, it may not fit your device so that the image itself would be malformed in color, size and skew. If this is the case feel free to adjust the source code to fit your needs.

Other command line options are available, for example disabling the ASCII console output.

Using the 'vcimgnetsrv' and the 'vcimgnetclient.py'

  1. Once start the 'vcimgnetsrv' in the background:

    ./vcimgnetsrv &

  2. Connect to the 'vcimgnetsrv' from your PC by starting the 'vcimgnetclient.py', changing the IP address to the host of the 'vcimgnetsrv' and pressing the 'Receive Image' button. Be aware that the client depends on 'Python' version 2 and the 'PyGTK' module!

  3. Start the demo program at the same host as the 'vcimgnetsrv':

    ./vcmipidemo

You may stop the demo program while the 'vcimgnetsrv' will keep on running and listens for the next application to connect to.