     mInLeft /= 255.f;
     mInRight /= 255.f;
 
-    // get image dimensions - left and right must have same dimensions
+    // get image dimensions and both must be same
     if(mInLeft.cols != mInRight.cols || mInLeft.rows != mInRight.rows) {cerr << "ERROR: Image dimensions don't match!" << endl; return 1; }
     int w = mInLeft.cols;         // width
     int h = mInLeft.rows;         // height
     int nc = mInLeft.channels();  // number of channels
-    cout << "images: " << w << " x " << h << endl;
+    if (!suppressOut) cout << "image dimensions: " << w << " x " << h << endl;
 
 
     //cv::Mat mOut(h,w,mInLeft.type());  // mOut will have the same number of channels as the input image, nc layers
     //cv::Mat mOut(h,w,CV_32FC3);    // mOut will be a color image, 3 layers
     // ### Define your own output images here as needed
-    cv::Mat mOutDepth(h, w, CV_32FC1);    // mOut will be a color image, 3 layers
-
-
+    cv::Mat mOutDepth(h, w, CV_32FC1);    // mOut will be a color image, 1 layers
 
 
     // Allocate arrays
-    // input/output image width: w
     // input/output image height: h
     // input image number of channels: nc
     // output image number of channels: mOut.channels(), as defined above (nc, 3, or 1)
-
     // allocate raw input image array
     float *imgInLeft  = new float[(size_t)w * h * nc];
     float *imgInRight  = new float[(size_t)w * h * nc];
-
     // allocate raw output array (the computation result will be stored in this array, then later converted to mOut for displaying)
     float *imgOutDepth  = new float[(size_t)w * h * mOutDepth.channels()];
 

    convert_mat_to_layered (imgInLeft, mInLeft);
    convert_mat_to_layered (imgInRight, mInRight);

    // get MU
    float MU;
    bool retVal = getParam("mu", MU, argc, argv);
    if (!retVal) {
        cerr << "ERROR: no MU specified" << endl;
        cout << "Usage: " << argv[0] << " -mu <value> " << endl; return 1;
    }

    // get sigma
    float SIGMA;
    retVal = getParam("sigma", SIGMA, argc, argv);
    if (!retVal) {
        cerr << "ERROR: no SIGMA specified" << endl;
    cout << "Usage: " << argv[0] << " -sigma <value>" << endl; return 1;
    }

    // get TAU
    float TAU;
    retVal = getParam("tau", TAU, argc, argv);
    if (!retVal) {
        cerr << "ERROR: no TAU specified" << endl;
    cout << "Usage: " << argv[0] << " -tau <value>" << endl; return 1;
    }

    // get discretization
    uint32_t nt;
    retVal = getParam("nt", nt, argc, argv);
    if (!retVal) {
        cerr << "ERROR: no discretization specified" << endl;
        cout << "Usage: " << argv[0] << " -nt <value>" << endl; return 1;
    }

    // get steps
    uint32_t steps;
    retVal = getParam("steps", steps, argc, argv);
    if (!retVal) {
        cerr << "ERROR: no step specified" << endl;
        cout << "Usage: " << argv[0] << " -steps <value>" << endl; return 1;
    }

    // output parameters
    cout << "MU: " << MU << endl;
    cout << "SIGMA: " << SIGMA << endl;
    cout << "TAU: " << TAU << endl;
    cout << "nt: " << nt << endl;
    cout << "Steps: " << steps << endl;
   
    Timer timer; timer.start();

    // GPU version
    stereo_projection_PD(imgInLeft, imgInRight, imgOutDepth, dim3(w, h, 0), nc, dim3(w, h, nt), steps, MU, SIGMA, TAU);
    
    timer.end();  float t = timer.get();  // elapsed time in seconds
    cout << "time: " << t*1000 << " ms" << endl;

    // show input image
    showImage("Input Left", mInLeft, 100, 100);  // show at position (x_from_left=100,y_from_above=100)
    showImage("Input Right", mInRight, 100+w+40, 100);  // show at position (x_from_left=100,y_from_above=100)

    // ### Display your own output images here as needed
    // show output image: first convert to interleaved opencv format from the layered raw array
    /*for(int r = 0; r < h; r++)
        for(int c = 0; c < w; c++)
            cout << imgOutDepth[r * w + c] << ((c == w - 1) ? "\n" : "  ");*/
    convert_layered_to_mat(mOutDepth, imgOutDepth);
    double minVal, maxVal;
    minMaxLoc(mOutDepth, &minVal, &maxVal);
    mOutDepth /= maxVal;
    cout << maxVal << endl;
    showImage("Depth Mapping", mOutDepth, 100+2*w+40, 100);
    



    cv::Mat mInLeft = cv::imread(imageLeft.c_str(), (gray? CV_LOAD_IMAGE_GRAYSCALE : -1));
    // Load the input image using opencv (load as grayscale if "gray==true", otherwise as is (may be color or grayscale))
    cv::Mat mInRight = cv::imread(imageRight.c_str(), (gray? CV_LOAD_IMAGE_GRAYSCALE : -1));
    // check if both images are loaded
    if (mInLeft.data == NULL || mInRight.data == NULL) { cerr << "ERROR: Could not load one or more image(s) specified" << endl; return 1; }
    
#endif
