                                 getWidth()*sizeof(uint8_t) );
     writeDebugPlane( s.c_str(), map );
 
+    {
+        ofstream of( ( filename + "-map-ascii.txt" ).c_str() );
+        for( int y=0; y<getHeight(); y++ ) {
+            for( int x=0; x<getWidth(); x++ )
+            {
+                int val = map.ptr(y)[x];
+                of << val << " ";
+            }
+            of << endl;
+        }
+    }
+
     s = filename + "-hystedges.pgm";
     cv::cuda::PtrStepSzb   hystedges( getHeight(),
                                       getWidth(),

                            getWidth() );
    writeDebugPlane1( s.c_str(), b );

    s = filename + "-gauss.pgm";
    cv::cuda::PtrStepSzf smooth( getHeight(),
                                 getWidth(),

                                 getWidth()*sizeof(float) );
    writeDebugPlane( s.c_str(), smooth );

    {
        ofstream of( ( filename + "-gauss-ascii.txt" ).c_str() );
        for( int y=0; y<getHeight(); y++ ) {
            for( int x=0; x<getWidth(); x++ )
            {
                int val = smooth.ptr(y)[x];
                of << val << " ";
            }
            of << endl;
        }
    }

    s = filename + "-dx.pgm";
    cv::cuda::PtrStepSz16s dx( getHeight(),
                               getWidth(),
