Tag Archives: image processing

Image Contour detection and display using OpenCV

In this example we threshold the image based on the position of the track bar. Then find contours on the image an display the contours as white lines. #include “stdafx.h” #include “cv.h” #include “highgui.h” // global variables IplImage* input = NULL; IplImage* gray = NULL; int threshold = 100; CvMemStorage*… Read more »

Splitting multichannel images into RGB using OpenCV

To separate a multi channel image into the three component RGB channels, we can use the cvSplit function. The example below opens a RGB image and then using the cvSplit function creates three output images. #include “stdafx.h” #include “cv.h” #include “highgui.h” int _tmain(int argc, _TCHAR* argv[]) { // open and… Read more »

OpenCV Hello World

      No Comments on OpenCV Hello World

Here is the Hello World example code for OpenCV. This simple example creates a image called output, then the text “Hello World” is added to the image. #include “stdafx.h” #include “cv.h” #include “highgui.h” int _tmain(int argc, _TCHAR* argv[]) { // create image IplImage* output = cvCreateImage(cvSize(400, 200), 8, 3); //… Read more »