public BlobTracker(int srcWidth, int srcHeight) {
    super(srcWidth, srcHeight);

    blur = new Blur();

    String mapFileName = ElProps.THE_PROPS.getProperty("regionMap", "regionMap.png");
    regionMap = new RegionMap(mapFileName);

    //			grayImage = new BufferedImage(w,h,BufferedImage.TYPE_USHORT_GRAY);
    grayImage = IplImage.create(w, h, IPL_DEPTH_8U, 1);
    //		scaledImage = new BufferedImage(w,h,BufferedImage.TYPE_USHORT_GRAY);

    diffImage = IplImage.create(w, h, IPL_DEPTH_8U, 1);
    blurImage = IplImage.create(w, h, IPL_DEPTH_8U, 1);
    threshImage = IplImage.create(w, h, IPL_DEPTH_8U, 1);

    background = new BackgroundImage(.001, 15);

    blobs = new Blobs(srcWidth, srcHeight, regionMap);
    tracker = new Tracker[regionMap.size()];
    for (int i = 0; i < regionMap.size(); i++) {
      tracker[i] = new Tracker(ElProps.THE_PROPS, regionMap.getRegion(i));
      tracker[i].start();
    }
  }
  public void setSourceStream(String s) throws IOException {

    if (srcStream != null) {
      srcStream.stopRunning();
    }

    //		int frameSkip = 2;
    if (s.equals(JMYRON_SRC)) {
      //			frameSkip = 50;
      srcStream = new WebCam(w, h, 12, this, false);
    } else if (s.equals(LOCALAXIS_SRC)) {
      String ip = ElProps.THE_PROPS.getProperty("axisIP", "10.0.1.90");
      String url = "http://" + ip + "/";
      String username = ElProps.THE_PROPS.getProperty("axisUsername", "root");
      String password = ElProps.THE_PROPS.getProperty("axisPassword", "n0h0");
      srcStream = new AxisCamera(url, w, h, 0, 0, username, password, this);
    } else {
      srcStream = null;
      throw new IOException("Unknown source");
    }
    srcStream.start();
    // gridDetector.resetBackground(frameSkip);
  }