Class Library for Image Processing |
|
CLIP (Version 1.04) CLIP is a C++ template library for image processing. Some of its features are:
CLIP is implemented as a single header file called picture.h. To write a clip program, you #include "picture.h", then call whatever facilities you need. This can be done within an integrated environment like MS Visual C++ or through a command line interface (which I recommend). CLIP is Open Source under the GNU Public Licence. It incorporates code from a number of other Open Source projects, acknowledged at the top of picture.h. You can download picture.h here, or get the full distribution that includes a suite of useful tools and lots of example programs. I recommend you get the full distribution, but please see the README file that comes with the distribution for suggestions on installation and configuration. An example CLIP program
// // invert.cpp // Simple camera-only program that shows the input video and its // colour negative. // #include "picture.h" int main() { colour_picture in(480,640);// Set up picture of 640 cols by 480 rows colour_picture out(480,640); in.show("Input"); out.show("Output"); in.attach_camera();// Connect the picture to the camera in.request_frame(); while(!in.closerequested() && !out.closerequested()) { while (!in.frame_delivered()) ; // Wait for next frame in.request_frame(); // Start next frame capture while doing: out = in; out *= -1; in.reshow(); out.reshow(); } return 0; } Download invert.cpp and/or a compiled version for Microsoft Windows. (Remember that you need a camera connected for this program. If you don't have a camera but would like to try a CLIP program before you compile your own, try "pixelate" below -- that works both on the pictures from a camera and on image files.) invert.cpp illustrates the default "simple" usage of CLIP that does not appear to involve templates and that uses member function calls with the minimum of parameters (all the other parameters being defaults). To get a faster program these defaults can be overridden. The README file that comes with the full CLIP distribution explains how. More examples Here are some more example programs. You can just pull these into Visual C++, for example, together with picture.h and get fully functioning interactive applications. All are included in the full distribution.
Using CLIP The CLIP distribution zip file contains picture.h, a set of test pictures, some useful utilities, the above examples, all the programs included in the CLIP tutorial, and a README file to help you configure CLIP. CLIP adopts the Unix software tools philosophy: "Let each program do one thing well". CLIP programs are therefore most suited to running in a command-line environment. In MS Windows I use cygwin; you might prefer the MSDOS command prompt. If you download the full distribution and then expand the zip file, you will get a directory structure with the following levels:
CLIP programs can be efficiently compiled with cpic - a batch file / shell script that lives in bin. There are various versions; one of these is selected when you run the appropriate makeall script as described in the README file. The important thing to note about cpic is that it puts the compiled executable in the bin directory not in the same directory as the source. This is so that CLIP programs are accessible from anywhere once compiled. The README file gives a step-by-step guide to configuring CLIP and its utilities. Once this is done you are able to use all the example programs, tutorial programs and utilities on any images you please, including those captured from a camera. To write your own CLIP programs, you might follow the tutorials used in my Media ECAD course: These describe basic CLIP functionality and features. To go further, please refer to the doxygenated online library documentation. |