On Tue, 2009-08-25 at 15:37 -0700, Steeve wrote:
> James Legg
> 
> I've just built SVN4280 which includes this patch.. This is a really
> useful feature, and one I've wanted for sometime.
> 
> However, the dots are so small (one pixel) I can barely see them, even
> with toggling the button to make them flash. Now I guess I should be
> happy since that means my images are well aligned and the control
> points match.... If I deliberately add a bad pair it is immedaitely
> obvious.. So this is good.
> 
> But my problem is slightly different, I have an HDR stack of fifty
> plus images, and despite running Celeste there are some 'bad' control
> points in the sky which are distorting the panorama.. It was very time
> consuming to find these points, having to manually search pairs of
> images for points remaining in the sky. This patch does what I need,
> but the optimiser is matching these points so they have a small
> error.. Hence these points are hard to spot in the previewer..
> 
> Would it be possible to make the end points of the lines into crosses,
> or circles?
> 
> Regards
> Stephen

Sure. The attached patch will place red crosses at both ends of every
control point.

-James

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"hugin and other free panoramic software" group.
A list of frequently asked questions is available at: 
http://wiki.panotools.org/Hugin_FAQ
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at http://groups.google.com/group/hugin-ptx
-~----------~----~----~----~------~----~------~--~---

Index: src/hugin1/hugin/GreatCircles.cpp
===================================================================
--- src/hugin1/hugin/GreatCircles.cpp	(revision 4282)
+++ src/hugin1/hugin/GreatCircles.cpp	(working copy)
@@ -178,4 +178,41 @@
         }
     }
     glEnd();
+    
+    // draw red crosses
+    glColor3f(1.0, 0.0, 0.0);
+    // The scale to draw them: this is 5 pixels outside in every direction.
+    double scale =  5.0 / m_viewState->GetScale();
+    glBegin(GL_LINES);
+        // cross at start of line
+        double vx, vy;
+        bool infront =  transform.transformImgCoord(vx,
+                                                    vy,
+                                                    startLat  * 180.0 / M_PI,
+                                                    startLong  * 180.0 / M_PI);
+        if (infront)
+        {
+            // main diagonal
+            glVertex2f(vx - scale, vy - scale);
+            glVertex2f(vx + scale, vy + scale);
+            // second diagonal
+            glVertex2f(vx - scale, vy + scale);
+            glVertex2f(vx + scale, vy - scale);
+        }
+        
+        // cross at end of line
+        infront =  transform.transformImgCoord(vx,
+                                               vy,
+                                               endLat  * 180.0 / M_PI,
+                                               endLong  * 180.0 / M_PI);
+        if (infront)
+        {
+            // main diagonal
+            glVertex2f(vx - scale, vy - scale);
+            glVertex2f(vx + scale, vy + scale);
+            // second diagonal
+            glVertex2f(vx - scale, vy + scale);
+            glVertex2f(vx + scale, vy - scale);
+        }
+    glEnd();
 }
Index: src/hugin1/hugin/PreviewControlPointTool.cpp
===================================================================
--- src/hugin1/hugin/PreviewControlPointTool.cpp	(revision 4282)
+++ src/hugin1/hugin/PreviewControlPointTool.cpp	(working copy)
@@ -75,12 +75,12 @@
             // draw line control points blue instead of orange.
             bool line = cp.mode != HuginBase::ControlPoint::X_Y;
             if (line) glColor3f(0.0, 0.5, 1.0);
+            else glColor3f(1.0, 0.5, 0.0);
             // draw a the smallest great circle arc between these two points.
             double x1, y1, x2, y2;
             transforms[cp.image1Nr].transformImgCoord(x1, y1, cp.x1, cp.y1);
             transforms[cp.image2Nr].transformImgCoord(x2, y2, cp.x2, cp.y2);
             m_greatCircles.drawLineFromSpherical(x1, y1, x2, y2);
-            if (line) glColor3f(1.0, 0.5, 0.0);
         }
     }
     glColor3f(1.0, 1.0, 1.0);

Reply via email to