title: Selecting pixels within a range of color in MATLAB
body: <p>I am working on a project that consists in using a camera to detect if an electronic component has been soldered or not. The program has to be able to trigger the snapshot when a PLC asks for it, analize it and send a pass/fail sign back to the plc.</p>
  
  <p>As I'm a MATLAB begginer I have been searching for information to know if it's feasible and to get a basic idea of where to start. </p>
  
  <p>My idea would be to count how many pixels have a silver or gold tone in a defined zone. If it's mainly gold it means that it hasn't been soldered.</p>
  
  <p>My question is, how would you do it to obtain the number of pixels that have a color inside a defined range inside a region of a webcam image?</p>
  
  <p>I have found this but it's for an exact color instead of a range.</p>
  
  <p>count = sum(im(:, :, 1) == 255 &amp; im(:, :, 3) == 255 &amp; im(:, :, 3) == 255);</p>