RSS
 

Archive for the ‘OpenCV’ Category

OpenCV: Accessing Pixels

07 Nov

In order to access pixels, there is some ways to do that, for example:

uchar *ptr;

ptr = cvPtr2D (image, x, y);

// for 3 channels image
ptr[0] = 255; // blue
ptr[1] = 0; // red
ptr[2] = 0; // green
ptr[3] = 0; // alpha

the example above you will color your image to Blue. the same way you can read the value as:

BlueValue = ptr[0];
RedValue = ptr[1];
etc….

hope it helps somebody.

 
No Comments

Posted in OpenCV

 

Eye Detection

04 Nov

eye detection

This web page is showing how to detect eyes using OpenCV’s boosted cascade of haar-like features. Source code, XML eye classifier, and sample images are available for download.

 
1 Comment

Posted in OpenCV

 

Set Up Ubuntu Linux for OpenCV

04 Nov

opencv sample

If you want to setup correctly your OpenCV development environment on Ubuntu. It is worthy to follow the steps described in this website.

 
 

Using OpenCV on iPhone

04 Nov

OpenCV on iPhone

I found a very nice tutorial showing how to use OpenCV on iPhone.
It can be accessed from here

 
 

OpenCV: Converting image type

21 Oct

We can use the standard cvLoadImage and cvSaveImage to implement a image type converted using OpenCV library.

cvLoadImage and cvSaveImage support these image formats:
* Windows bitmaps – BMP, DIB;
* JPEG files – JPEG, JPG, JPE;
* Portable Network Graphics – PNG;
* Portable image format – PBM, PGM, PPM;
* Sun rasters – SR, RAS;
* TIFF files – TIFF, TIF.

For example, to implement JPG to TIFF converter:

IplImage* img = cvLoadImage( "blabla.jpg",1);
cvSaveImage( "blabla.tif", img );

[ad#AdBrite inline]

 
No Comments

Posted in OpenCV