Tuesday, February 24th, 2009, 1551 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.

colorrecognition

Source code colorrecg.pdf


QR code for this post, SCAN ME
QR:  Color recognition using openCV

26 Responses to “Color recognition using openCV”

  1. I have interested in color recognition.

  2. [...] Related Post:  Color recognition using openCV [...]

  3. Andol says:

    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

  4. 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

  5. ninhnv says:

    Thank!
    I ‘m very interested in color recognition

  6. eqeen says:

    is the color recognition code given is the full one?

  7. Aarathi says:

    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.

  8. aarathi says:

    can i get the header files used?

  9. aarathi says:

    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]‘

  10. aarathi says:

    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 ==========

  11. aarathi says:

    thank u…………..sir……

  12. Prerana says:

    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.

  13. Dhruva Verma says:

    Hello sir,
    May i get any Literature Survey on color detection and recognition…
    thank you.

  14. Dhruva Verma says:

    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.

  15. Dhruva Verma says:

    Got it sir..
    :)

Leave a Reply

You can use these XHTML tags:
<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>