Tuesday, February 24th, 2009, 1576 days ago
Color recognition using openCV
This is the one part of object recognition module exploring of openCV. Until now, i have successfully detected and recognized circle, rectangle and color which is presented here today. And next step is hand gesture recognition.
In color recognition, it can detect any color, but there’s still a little bug that, the detectation color should be preset before recognizing the objects in the destination image. I am not sure whether there’s any color filter in openCV like Actionscript3 which can just directly filter the necessary color objects.
Source code colorrecg.pdf
QR code for this post, SCAN ME
POSTS MAY BE OF INTEREST
Considering video vibration helpful
Release of HAAR classifier trained for...
First trial of classifier training – t...
Collection of own hand gesture samples...
Analysis of openCV’s face detection – ...
Coming soon – closed palm detect...
Hand gesture detection and recognition...
The colour range for HSV skin extraction
Writing a simple hand gesture picture ...
Using hand gestures to control mouse p...
The error of ‘VIDIOC_QUERYMENU: ...
HIGHGUI ERROR: V4L: index 0 is not cor...
I have interested in color recognition.
[...] Related Post: Color recognition using openCV [...]
Actually, there are 3 methods to recognize the colour objects which are:
1) using histgram to match the destination image;
2) using cvSetImageCOI to get specific color channel;
3) using cvSplit & cvMerge to manipulate channel to get the target colours.
there i put on another post about color recognition using openCV here as well as some parts of codes, hope it will be useful: http://www.iandol.com/research/882.htm
Hy Andol,
I have successfully detected my hand. but could you please tell me how can i do color matching ?
waiting for your reply thanks
@Tina123
colour matching needs to use two main functions
cvSplit, and
cvInRange
an example of using colour ranges to detect objects can be found in http://download.andol.info/hsv.cpp
also the below link is not working
http://www.iandol.com/research/882.htm
@Tina123
thank you for your kind reminding
the correct url is – http://www.andol.info/hci/882.htm
Hi, interesting post. I have been thinking about this topic,so thanks for writing. I’ll likely be coming back to your blog. Keep up great writing
Thanks.
These days i am quite busy with some investigations, once get time, i will continue to post the latest recognition function applications by using openCV.
waiting to know the robust recognition functions..
Thank!
I ‘m very interested in color recognition
hope it helps.
is the color recognition code given is the full one?
yes it is
can you give a sample program on the color recognition???
thanks….
Am doing project in olor detection and mouse controls in visual c++. can i just get the code for that.i have been trying it in open cv.
@Aarathi
actually there are two parts of codes of mouse control using object detection, one part is object detection, and the other is to control the mouse in the system which can be referred here
http://www.andol.info/research/1756.htm
can i get the header files used?
sir its showing the error 1>c:\opencv2.1\projects\large\large\new.cpp(174) : error C2040: ‘==’ : ‘int’ differs in levels of indirection from ‘const char [2]‘
i got stuck with some errors…
1>—— Build started: Project: large, Configuration: Debug Win32 ——
1>Compiling…
1>new.cpp
1>c:\opencv2.1\projects\large\large\new.cpp(19) : error C2146: syntax error : missing ‘;’ before identifier ‘–’
1>c:\opencv2.1\projects\large\large\new.cpp(19) : error C2065: ‘–’ : undeclared identifier
1>c:\opencv2.1\projects\large\large\new.cpp(19) : error C2146: syntax error : missing ‘;’ before identifier ‘rect’
1>c:\opencv2.1\projects\large\large\new.cpp(26) : error C2146: syntax error : missing ‘;’ before identifier ‘–’
1>c:\opencv2.1\projects\large\large\new.cpp(26) : error C2065: ‘–’ : undeclared identifier
1>c:\opencv2.1\projects\large\large\new.cpp(26) : error C2146: syntax error : missing ‘;’ before identifier ‘rect’
1>c:\opencv2.1\projects\large\large\new.cpp(150) : error C2065: ‘“mainWin”’ : undeclared identifier
1>c:\opencv2.1\projects\large\large\new.cpp(151) : error C2065: ‘“mainWin”’ : undeclared identifier
1>c:\opencv2.1\projects\large\large\new.cpp(167) : error C2065: ‘“mainWin”’ : undeclared identifier
1>c:\opencv2.1\projects\large\large\new.cpp(170) : error C2065: ‘‘q’’ : undeclared identifier
1>c:\opencv2.1\projects\large\large\new.cpp(174) : error C2446: ‘==’ : no conversion from ‘const char *’ to ‘int’
1> There is no context in which this conversion is possible
1>c:\opencv2.1\projects\large\large\new.cpp(174) : error C2040: ‘==’ : ‘int’ differs in levels of indirection from ‘const char [2]‘
1>c:\opencv2.1\projects\large\large\new.cpp(193) : error C2065: ‘‘q’’ : undeclared identifier
1>Build log was saved at “file://c:\OpenCV2.1\projects\large\large\Debug\BuildLog.htm”
1>large – 13 error(s), 0 warning(s)
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========
@aarathi
check your codes, make sure they are all correctly defined and referred. The error may be caused by incorrect use of the variables.
thank u…………..sir……
Hello Sir,
I am newbie in opencv, i m trying to use image recognition to recognise an apple and haar training seems to be only way of doing it…Can u explain the haar training method in detail may be in different post for those who are doing it for the first time…documentation doesnt seems to be of great help….M sure it’l be extremely useful for all who are aspiring to do the haar training:)
Thank you Sir.
Hello sir,
May i get any Literature Survey on color detection and recognition…
thank you.
Hello sir,
I have been working on analysing time for color detection from video or real time.For this i am detecting colors from the motion of a person in video and synchronising the movements of graphical robot in opengl with this.
Problem i am getting is when i call color detection and than making of robot in main(), than it stops after taking one frame because of glutMainloop();
I am not able to find out the solution so that I could run the designing of robot in opengl and detecting the moments from a video in opencv IN A LOOP simultaneously.
Got it sir..