λ·vue Application Development Manual (0.7.14) Table of Contents I. About λ·vue ............................................................................................................................................................ 1 Chapter 1. What is λ·vue? .................................................................................................................................. 2 II. Building Application ............................................................................................................................................. 3 Chapter 2. Installation Guide ............................................................................................................................. 4 Install λ·vue SDK Using Package Manager ............................................................................................... 4 Install λ·vue SDK Using Command Line................................................................................................... 4 Install GNU Compiler Collection............................................................................................................... 4 Chapter 3. Usage Example ................................................................................................................................. 5 Simple Application ..................................................................................................................................... 5 Compiling .................................................................................................................................................. 7 III. Appendices .......................................................................................................................................................... 8 ii I. About λ·vue This part gives you an overview of the technologies described in this book. 1 Chapter 1. What is λ·vue? Quanta Research Institute and MIT researchers collaborated to develop λ·vue that amplifies color changes and movements in video that are invisible to the naked eye. The λ·vue allows you to 'see' a person's pulse by magnifying the color of the person's skin, and to 'see' a person breathing by amplifying the subtle changes in movement. Magnification enhances small movements in the source video. It works best for periodic changes such as breathing or pulse. This technique is designed to expose very small changes when the rest of the image is very still. Quanta Research Institute has created this software development kit so that you can experiment with the λ·vue on your own videos and webcam. For more information on the technology, please contact QRI ([email protected]). 2 II. Building Application In these chapters, you can read tutorials about how to set up your computer to work with the λ·vue SDK. Additionally you can find a very basic sample code that will let introduce you to the world of the λ·vue. 3 Chapter 2. Installation Guide Install λ·vue SDK Using Package Manager To install λ·vue SDK, simply double click on “video-scope-sdk_0.7.14.000-1_amd64.deb”, and then select Install Package. Install λ·vue SDK Using Command Line Alternatively, you can also install λ·vue SDK by opening a terminal and typing: $sudo dpkg -i video-scope-sdk_0.7.14.000-1_amd64.deb Install GNU Compiler Collection To compile the following example code and your applications, you have to install GNU Compiler Collection (GCC) 4.4.x or later. This can be installed with: $sudo apt-get install build-essential 4 Chapter 3. Usage Example Simple Application A basic sample code to work with λ·vue SDK that looks like this: Example 1. Basic Sample Code #include <iostream> #include <stdlib.h> #include <signal.h> #include "MagEngineAPI.h using namespace geko; using namespace std; void signal_handler(int signal); void callBackEvent(struct EventValue); bool running = true; int main(int argc, char *argv[]) { signal(SIGINT, signal_handler); signal(SIGTERM, signal_handler); initMagEngine(callBackEvent); setProcessMethod(LINEAR_MOTION); setFilterParameter(LOWCUT, 0.8); setFilterParameter(HIGHCUT, 2); setFileOutput(RECORD_PROCESSED_ONLY); setSource(OPEN_FILE_SOURCE, "/home/lambdavue/videos/10sec.wmv"); while(running) 5 { usleep(1); } exit(EXIT_SUCCESS); } void callBackEvent(struct EventValue value) { switch(value.event) { case END_OF_FILE: cout << endl << "File archived at " << value.sValue << endl; usleep(1); exit(EXIT_SUCCESS); break; default: break; } } void signal_handler(int signal) { cout << "\rInterrupted by signal: " << signal << endl; destroyMagEngine(); running = false; } You have to call the initMagEngine function to init λ·vue Magnification Engine(hereafter referred to as MagEngine). Also remember to call destroyMagEngine to delete MagEngine when we caught interrupt signal SIGINT and SIGTERM. MagEngine will start to process magnification once you set up any video source for it. Therefore, you have to set up all the parameters you need before that. setProcessMethod, setFilterParameter, and setFileOutput will be the most important function to call. Once you set up all the parameters, you can easily set up your video source with setSource to start your MagEngine. For more information, please refer to the API document. 6 Compiling To compile against λ·vue SDK, you need to tell the compiler where to find the static library. The following parameters should be used to compile against λ·vue SDK: -I/usr/local/include -lMagEngine -lgomp For our example application, A shell operation would look like: $g++ -c -m64 -pipe -O3 -Wall -Wextra -W -I. -I/usr/local/include -o test.o test.cpp $g++ -m64 -Wl,-O1 -o test test.o -lMagEngine –lgomp 7 III. Appendices 8
© Copyright 2024