OpenCV Examples Part 1

Nov 4, 2008 | Tags: OpenCV | del.icio.us del.icio.us | digg Digg

1. Introduction

OpenCV is a collection of C functions and a few C++ classes that implement many popular Image Processing and Computer Vision algorithm. The best part is, it is free for both commercial and non-commercial use. Go to http://www.sourceforge.net/projects/opencvlibrary and get the latest version.

If this is your first experience with OpenCV, I suggest you to play with images first. It is the simplest thing to do, but you'll learn a lot about OpenCV basic concepts and how to perform various tasks with OpenCV.

This article is part 1 of my OpenCV Examples Series. In this article, I will explain line-by-line some OpenCV code samples:

  • loadimg.c: Load an image and display.
  • imgprop.c: Get the properties of an image.
  • copyimg.c: Copy an image and save to file.
  • c2g.c: Load a color image and convert to grayscale.
  • imgdata.c: Access image data and perform image manipulation.

The package contains code samples used in this article is available for you to download. I recommend you to use gcc--a free C compiler from GNU--to compile the samples. If you use Windows for your operating system, obtain the gcc port for Windows at http://www.mingw.org. I've tested all of the samples and it runs very well on my computer. If you encounter problems with compiling or running the samples, feel free to contact me [at] nashruddin.com.