I want to detect color of vehicles ?
I am trying to make a program on recognizing color of vehicle. what method should i use?
Use a histogram to find the most common color in the area. The more bins you use, the harder to tell which is the most common color, but the more precise you can be as to which color.
This tutorial shows you how to use histograms to isolate colors. http://docs.opencv.org/3.1.0/da/d7f/t...
This is the primary colors: https://en.wikipedia.org/wiki/Web_col...
The in-betweens get fuzzy though.
You see the columns on the table that have (HSV) in the description? Those are your HSV values that you are finding. Put each color in the table in as a constant, and find the one that is closest to your calculated color. For example, your color seems to be a light green.
I would make an array with those values, and just use the sum of squared differences (c1-h1)^2+(c2-h2)^2+... to find the distance between each color and the value you get. K nearest neighbor is probably overkill.
Asked: 2016-06-08 22:16:57 -0600
Seen: 1,824 times
Last updated: Jun 08 '16
OpenCV DescriptorMatcher matches
Conversion between IplImage and MxArray
Percentage of color in a frame of video
Video On Label OpenCV Qt :: hide cvNamedWindows
Problems using the math.h class with OpenCV (c++, VS2012)
How to reduce false positives for face detection
Area of a single pixel object in OpenCV
build problems for android_binary_package - Eclipse Indigo, Ubuntu 12.04