title: Matlab color detection
body: <p>I'm trying to consistently detect a certain color between images of the same scene. The idea is to recognize a set of object based on a color profile. So, for instance, if I'm given a scene with a green ball in it and I select that green as part of my color palette, I would like a function which has a matrix reflecting that it detects the ball.</p>
  
  <p>Can anyone recommend some matlab functions/plugins/starting points for this project? ideally the function for color recognition will take an array of color values and will match them within a certain threshold.</p>
  
  <p>Kinda like this:
  <a href="http://www.mathworks.com/matlabcentral/fileexchange/18440-color-detection-using-hsv-color-space-training-and-testing" rel="nofollow noreferrer">http://www.mathworks.com/matlabcentral/fileexchange/18440-color-detection-using-hsv-color-space-training-and-testing</a></p>
  
  <p>except it works (this one didn't)</p>
  
  <p>Update:</p>
  
  <p>Here's why I chose not to use the above toolkit..</p>
  
  <p>I start by selecting some colors of interest in the picture</p>
  
  <p><img src="https://i.stack.imgur.com/CKQ9q.png" alt="Everything is going well.."></p>
  
  <p>and then ask the function  to recognize the road in later images...</p>
  
  <p><img src="https://i.stack.imgur.com/Vvw7r.png" alt="uh oh"></p>
  
  <p>And absolutely nothing useful is triggered. So yeah, apart from the few bugs that I came across in the code on download and fixed, this was kind of the kicker. I didn't try to fix the body of the code that recognizes the colors because.. well, I don't know how, which is why I came here.</p>