Below is a simple utility to draw the histogram of an image in OpenCV. I write the code since OpenCV doesn’t have something like cvShowHistogram() function. This utility can display the histogram for each channel (R, G, or B) or its grayscaled intensity.
void show_histogram(
char* window_title,
IplImage* src,
char* channel_name
);
window_title is the title for the histogram window
src 8 bit, single or three channel input image
channel_name is one of these values: “red”, “green”, “blue”, “gray”
Read More »

FFTW is a C library for computing the discrete Fourier transforms (DFT), freely available from http://fftw.org. It can compute Fourier transforms of real and complex-valued arrays of arbitrary size and dimension.
In this article I will explain basic usage of FFTW and some sample code for computing real/complex DFTs. Sample code for computing the DFTs of IplImage data type is also provided. This tutorial assumes that you’ve installed OpenCV 2.1 in C:\OpenCV2.1 and fftw3 in C:\fftw3.
Table of contents:
- Installation
- Basic Usage and Compilation
- Computing Complex 1D DFT
- Computing Complex 2D DFT
- Computing Real 1D DFT
- Computing Real 2D DFT
- Computing 2D DFT of IplImage Data Type
- Summary
- Downloads
Read More »

Gnuplot is a free, command-driven interactive plotting tool. If you need to visualize your data, Gnuplot is one of the best choices available. Some of the possible usage of gnuplot are plotting your image histogram and drawing graph for real-time data.
To use gnuplot from your C/C++ program, you talk to it by pipes. See the sample code below. Read More »

Histogram equalization is a method for enhancing the contrast of an image. This method will improve the detail of the image. Read More »

Thresholding is the simplest method to separate objects from the background. Given a grayscale image, it will produce a binary image representing the segmentation. This is useful to extract interesting objects for further processing. Read More »
OpenCV has utility functions for reading and writing XML/YML files. This is useful when you want to save some object state or configuration files. Read More »

Below is the C code to replace Matlab’s bwareaopen, written by someone from the OpenCV group. bwareaopen is Matlab’s function to remove objects from a binary image that have fewer pixels than a predefined value. Read More »
Template matching is a technique for finding small parts of an image which match a template image. It slids the template from the top left to the bottom right of the image, and compare for the best match with template. Read More »

Region of interest (ROI) is a rectangular area in an image, to segment object for further processing. Once the ROI defined, most OpenCV functions will perform on that particular location. Read More »
This project is an implementation of the algorithm described in the paper: Real Time Eye Tracking and Blink Detection with USB Cameras (download pdf) by Michael Chau and Margrit Betke. Read More »