title: Java color detection
body: <p>I am implementing  algorithm in java which select a portion of image as marker.
  My problem is</p>
  
  <p>1) After selecting the marker area, how do i get the specific mean value of marker color in RGB as the number of pixels with a small difference in color.</p>
  
  <p>2) How can i find marker value, meaning the threshold value for the color, based on the previous marker selection.</p>
  
  <p>Please provide an algorithm and if posssible, an implementation in java.
  Thanks in advance.</p>