Open Computer Vision

December 20, 2008

Red blob detection from video

This post is all about the red Blob Detection from a Video.This is the post you should be looking on if you are here for blob Detection.Here the method which I have used is the Color Space conversion and then the detection using some more functions.So if you are looking for Color recognition then youre at the right place… (more…)

November 12, 2010

Low pass filter

Filed under: OpenCV — Abhijeet @ 10:19 am

Now it is high time for us to speak about filters.Before we do this first we have to understand what is frequency in an image. To understand the existence of frequency in an image we would have to look at a diagram below. (more…)

November 11, 2010

Computing Power of an Image.

Filed under: OpenCV — Abhijeet @ 1:48 pm

Now after cubing the image let us see how to compute any power on the image.Since we have already have computed the cube of the image now let us try our hands on square rooting the image. (more…)

Computing Cube of an Image

Filed under: OpenCV — Abhijeet @ 1:13 pm

Let us see what changes happen when we cube the image. There are some special charecteristics which the numbers exhibit in the range of 0-1.When we apply some transformations let us see what affects they have on the image.

(more…)

June 14, 2009

Image Enhancement Using HSV Color Space

Filed under: OpenCV — Abhijeet @ 8:05 am

So, How to make sure that we detect Colors Correctly….? Suppose you have an image in which the Colors are not so Strong.So, it would be quite difficult for us to detect Colored objects.Adding some arbitrary value in the Image would not Help since it would increase the brightness but not the Contrast. So How to do it… (more…)

June 13, 2009

Detecting Colors using RGB Color Space

Filed under: OpenCV — Abhijeet @ 10:21 am

This is a post which is based on Color detection Using the RGB Basics and It would be really useful in certain situations.This method uses the RGB Color Space to detect the Colors…Read on..

(more…)

May 25, 2009

Project Suggestions

Filed under: OpenCV — Abhijeet @ 4:56 am

Dear friends,

This is the post where you may get some project suggestions on whatever you wish..This blog is your’s and I want you to please be interactive..So feel free to ask your questions here and you may also help others…You may post links and suggestions..Its all yours…

April 26, 2009

Understanding Color Space Basics

Filed under: OpenCV — Abhijeet @ 9:40 am

This post once again concentrates on understanding “What is Color Space” and how can it be used for Different projects you do and how well can you use the basics to finish the same.I still see a lot of users asking questions about Color Spaces and how to use them and this post satisfies your Thirst…Look at this picture.

main1

This picture (from Wikipedia) shows a man wearing a blue dress with a green background.Now lets split this image channels into the constituent channels and then see what are the constituents of the image with the help of this program.

/*Program to remove the components and show them apart..
.make the users realize the importance
of color space in OpenCV*/

/*All the includes*/
#include "cv.h"
#include "highgui.h"
#include "stdio.h"
#include "conio.h"

int main() {

int i,j,k;
/*Load the image*/
IplImage* frame=cvLoadImage("Man Color Image.jpg",1);
cvNamedWindow("main", CV_WINDOW_AUTOSIZE);
cvNamedWindow("red", CV_WINDOW_AUTOSIZE);
cvNamedWindow("green", CV_WINDOW_AUTOSIZE);
cvNamedWindow("blue", CV_WINDOW_AUTOSIZE);
if(frame==NULL){ /*If image not found then exit.
This is the function of this loop */
printf("the file doesnot exist");
exit(0);
}/*creating 3 images all one channel*/
IplImage* blue=cvCreateImage( cvGetSize(frame), 8, 1 );
IplImage* green=cvCreateImage( cvGetSize(frame), 8, 1 );
IplImage* red=cvCreateImage( cvGetSize(frame), 8, 1 );

//-----------------------------------------
/*Setting the Image Channel of interest(COI)*/
cvSetImageCOI( frame, 1 );
/*Here CvCopy sees the COI and ROI and then copies the channels to be copied
Here we set the first channel as the channel of interest*/
cvCopy( frame, blue, NULL );/*Copy the first channel */

cvSetImageCOI( frame, 2 );/*Set the COI to second channel*/
cvCopy( frame, green, NULL );/*Copy the second channel*/
cvSetImageCOI( frame, 3 );/*Set the COI to third channel*/
cvCopy( frame, red, NULL );/*Copy the third channel*/

cvShowImage("main",frame);
cvShowImage("blue",blue);
cvShowImage("green",green);
cvShowImage("red",red);
cvSaveImage("main.jpg",frame);
cvSaveImage("blue.jpg",blue);
cvSaveImage("green.jpg",green);
cvSaveImage("red.jpg",red);

cvWaitKey();
cvDestroyWindow( "main" );
cvDestroyWindow( "red" );
cvDestroyWindow( "green" );
cvDestroyWindow( "blue" );

return 0;/*This statement is compiler specific and might change.
As i already said that I am using DEV C++ as my compiler*/
}

Blue Channel

Blue Channel

green1

Green Channel

Red Channel

Red Channel

Now why is the Dress in the Red Channel low in Intensity..? (Do not worry about the sizes of the Image I have changed them to suit the looks and spacing).Its because the Red color is less in the blue area “but it is not zero(for most of the pixels in real time imaging)”.

Just look at the upper left corner in the green Image behind the head of the man.Don’t you see the leaves of the tree clearly with more intensity.Its because the leaves are green and which means they have more green color and less of the other colors.Because they are green.A matter of Fact (the leaves are green because they do not absorb the green color they reflect the green color).

If  you look in the blue channel, the background is very dark which means that there is less “blue” intensity….think for some points like this from the image.

So any area in an image no matter what color it is has RGB values .
Now 8*8*8=(2^8)*(2^8)*(2^8)=2^24 which roughly comes to 16 million colors.So its is very difficult to detect specific colors using RGB hence we do a color space conversion.I have already posted a topic describing the importance of the HSV color space.

Now if you observe the higher the ‘R’ ,’G’, ‘B’ value higher is the intensity and when R=G=B=255 which means that its pure white light, which again means that the intensity is contained in a combination of the RGB values…similarly some more arithmetic done on the RGB gives the HUE nd the saturation values.

Now look at the upper left corner of the green image …? Dont you think its brighter.The plants are green Just look at the thick green leaves they are brighter.If a part in the image is brighter then it means that it has higher intensity and higher intensity means that the higher is the number.

Just try to satisfy yourself with what you think and what is present.Ponder over this post for sometime it would be a good time investment.
Remember->brighter Region signifies higher intensity which again means higher numbers
Darker regions means the vice versa…please give me some feedback about my explanation
I will try to Improve the same.

December 20, 2008

Making of the Youtube Video

This post is all about the video which I have made and uploaded to the youtube.I have explained how I have made the video in OpenCV using some images and a video which was made available from an object detection function applied on the video.So watch the making of the Video…
(more…)

December 19, 2008

Saving a part of a video in another video

Filed under: OpenCV — Abhijeet @ 1:02 pm
Tags: ,

Before you come and read this post i sincerely request you to first read the other  post which speaks how to convert a collection of images into a video….if you already know the same read on….
This post speaks about how to save a part of a video in another video….
(more…)

Next Page »

The Rubric Theme. Create a free website or blog at WordPress.com.

Follow

Get every new post delivered to your Inbox.

Join 29 other followers