/** * OpenCV demo application in C. * * Uses the cvbase C module (cvbase.c, cvbase.h). * * This is just a translation of the C++ example in cvdemo.cpp, cvbase.cpp, * and cvbase.hpp. * * Opens a display window and reads input frames from either a camera or video * file. Processes each frame (no operation by default) and displays the * results. * * Provides basic functions to pause/unpause the live input, emit debugging * information for selected frames, and to save both raw capture and processed * images. * * If you have installed opencv libraries system-wide, and have pkg-config * (default on most modern Linux, available but not default on Windows and OS * X), build like this: * * gcc -o cvdemo cvdemo.c cvbase.c `pkg-config --cflags --libs opencv` * * Otherwise, replace the part in backquotes with * * -Iprefix/include/opencv -Lprefix/lib -lml -lcvaux -lhighgui -lcv -lcxcore * * where prefix is the base path where you installed the opencv development * binaries (e.g. /usr/local, or somewhere under your homedir). * * Tested on: * * ubuntu 10.04 + opencv 2.1.0 src + libv4l-dev * * @author vona **/ #include "cvbase.h" #include int camIndexOptional() { return 1; } void cmdHelpExt() { } const char *cmdHelpExtParams() { return ""; } void guiHelpExt() { } IplImage *process(IplImage *frame) { return frame; } int handleKeyExt(int code) { printf("unhandled keycode %d\n", code); return 1; } void cleanupExt() {} int initExt(int argc, char *argv[], int ate) { return ate; } /** Program entry point. **/ int main(int argc, char *argv[]) { appname = "cvdemo"; printf("ate %d args\n", init(argc, argv)); mainLoop(); }