@Override
    protected void process(GrayU8 gray) {
      if (paused) return;

      if (!resetRequested && alg.process(gray)) {
        GrayU8 stitched = alg.getStitchedImage();

        synchronized (lockGui) {
          ConvertBitmap.grayToBitmap(stitched, bitmap, storage);

          ImageMotion2D<?, ?> motion = alg.getMotion();
          if (showFeatures && (motion instanceof AccessPointTracks)) {
            AccessPointTracks access = (AccessPointTracks) motion;

            alg.getWorldToCurr(imageToDistorted);
            imageToDistorted.invert(distortedToImage);
            inliersGui.reset();
            outliersGui.reset();
            List<Point2D_F64> points = access.getAllTracks();
            for (int i = 0; i < points.size(); i++) {
              HomographyPointOps_F64.transform(distortedToImage, points.get(i), distPt);

              if (access.isInlier(i)) {
                inliersGui.grow().set(distPt.x, distPt.y);
              } else {
                outliersGui.grow().set(distPt.x, distPt.y);
              }
            }
          }

          alg.getImageCorners(gray.width, gray.height, corners);
        }

        boolean inside = true;
        inside &= BoofMiscOps.checkInside(stitched, corners.p0.x, corners.p0.y, 5);
        inside &= BoofMiscOps.checkInside(stitched, corners.p1.x, corners.p1.y, 5);
        inside &= BoofMiscOps.checkInside(stitched, corners.p2.x, corners.p2.y, 5);
        inside &= BoofMiscOps.checkInside(stitched, corners.p3.x, corners.p3.y, 5);
        if (!inside) {
          alg.setOriginToCurrent();
        }

      } else {
        resetRequested = false;
        alg.reset();
      }
    }
 public static void main(String args[]) throws IOException {
   List<String> fileNames = BoofMiscOps.directoryList("log", "depth");
   Collections.sort(fileNames);
   CombineFilesTogether.combine(fileNames, "combined.mpng");
 }