code: public void addPatternImage(T pattern, double threshold, double lengthSide) {
  		GrayU8 binary = new GrayU8(pattern.width,pattern.height);
  		GThresholdImageOps.threshold(pattern,binary,threshold,false);
  		alg.addPattern(binary, lengthSide);
  	}
docs: Add a new pattern to be detected.  This function takes in a raw gray scale image and thresholds it.
  
  @param pattern Gray scale image of the pattern
  @param threshold Threshold used to convert it into a binary image
  @param lengthSide Length of a side on the square in world units.