libcvd-members
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[libcvd-members] libcvd/progs calibrate.cxx


From: Edward Rosten
Subject: [libcvd-members] libcvd/progs calibrate.cxx
Date: Thu, 28 Aug 2008 07:29:16 +0000

CVSROOT:        /cvsroot/libcvd
Module name:    libcvd
Changes by:     Edward Rosten <edrosten>        08/08/28 07:29:16

Modified files:
        progs          : calibrate.cxx 

Log message:
        Fix calibrate for ServerPushJpegStream:
        
        - Get window size and initial parameters from video size.
        
        - Remove the video buffer flushing.
        
        The buffer flushing relies on frame_pending which is broken by the new 
        ServerPushJpegStream. 

CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/libcvd/progs/calibrate.cxx?cvsroot=libcvd&r1=1.6&r2=1.7

Patches:
Index: calibrate.cxx
===================================================================
RCS file: /cvsroot/libcvd/libcvd/progs/calibrate.cxx,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -b -r1.6 -r1.7
--- calibrate.cxx       15 Aug 2008 12:54:06 -0000      1.6
+++ calibrate.cxx       28 Aug 2008 07:29:16 -0000      1.7
@@ -41,7 +41,7 @@
 #else
 string videoDevice = "v4l2:///dev/video0";
 #endif
-Vector<6> cameraParameters = (make_Vector, 500, 500,  320,  240,  0,  0);
+Vector<6> cameraParameters = (make_Vector, -1, -1, -1, -1, -1, -1);
 int bottomLeftWhite = 1;
 int gridx = 11;
 int gridy = 7;
@@ -642,7 +642,7 @@
     getOptions(argc, argv);
 
     string titlePrefix = "Calibrate: Align grid ([ and ] to resize)";
-    GLWindow disp(ImageRef(640,480), titlePrefix);
+    GLWindow disp(videoBuffer->size(), titlePrefix);
     GLWindow::EventSummary events;
     //VideoDisplay disp (0.0, 0.0, 640.0, 480.0);
     Camera::Quintic cameraModel;
@@ -651,12 +651,15 @@
     vector<SE3> poses;
     ImageRef imageSize;
 
+       if(cameraParameters[0] == -1)
+               cameraParameters = (make_Vector, 500, 500,  
videoBuffer->size().x/2,  videoBuffer->size().y/2,  0,  0);
+
     //XEvent e;
     //disp.select_events(KeyPressMask);
     bool doParams = true;
     int stage = 2; // 2 is init, 1 record, 0 done
 
-    //disp.set_title(titlePrefix);
+    disp.set_title(titlePrefix);
 
     double curr = timer.get_time();
     srand48(static_cast<long int>(curr));
@@ -726,11 +729,11 @@
        }
            
        VideoFrame<CAMERA_PIXEL>* vframe = videoBuffer->get_frame();
-       while(videoBuffer->frame_pending())
+       /*while(videoBuffer->frame_pending())
        {
            videoBuffer->put_frame(vframe);
            vframe = videoBuffer->get_frame();
-       }
+       }*/
        // leave this in, we cannot assume that vframe has a datatype that can 
be
        // directly used in the glTexImage call later on (e.g. its yuv422 on 
OSX)
        Image<byte> temp = convert_image(*vframe);
@@ -748,11 +751,11 @@
        glTexCoord2i(0, 0);
        glVertex2i(0,0);
        glTexCoord2i(temp.size().x, 0);
-       glVertex2i(640,0);
+       glVertex2i(disp.size().x,0);
        glTexCoord2i(temp.size().x,temp.size().y);
-       glVertex2i(640,480);
+       glVertex2i(disp.size().x,disp.size().y);
        glTexCoord2i(0, temp.size().y);
-       glVertex2i(0, 480);
+       glVertex2i(0, disp.size().y);
        glEnd ();
        glDisable(GL_TEXTURE_RECTANGLE_NV);
        glEnable(GL_BLEND);




reply via email to

[Prev in Thread] Current Thread [Next in Thread]