Control Point search fails on fairly simple images

63 views
Skip to first unread message

Shaunak De

unread,
Jul 8, 2020, 1:24:16 AM7/8/20
to hugin and other free panoramic software
Hey All,

I am trying to align scans from 2 scans of a large page. I usually do this for sketches and it works without a flaw, but somehow for these 2 images (attached), I am unable to find any control points. 

They are actually pretty simple images with lots of overlap and clear common features. Still, the CPfind program fails to find any points. Perhaps I am doing something wrong in processing the images. I would be very grateful if someone with more experience than me could take a look at the images and see if truly CPfind fails or its an error on my part. 


The instructions I am following are : http://hugin.sourceforge.net/tutorials/scans/en.shtml

SD
A.jpg
B.jpg

Terry Duell

unread,
Jul 8, 2020, 3:00:43 AM7/8/20
to hugi...@googlegroups.com
Hello Shaunak De,
I tried using your images and didn't have any trouble, the result looks OK to
me.
I have attached the pto file from my attempt.
Which version of hugin are you using?

Cheers,
--
Terry Duell <tdu...@iinet.net.au>
A-B.pto

Shaunak De

unread,
Jul 8, 2020, 7:38:38 PM7/8/20
to hugi...@googlegroups.com
Dear Terry, 

Thanks for giving this a try. My Hugin version is `2019.2.0.b690aa0334b5 built by Thomas`. 

So I gave it a try afresh, and this time I was able to find 11 control points as follows:
image.png

However, when I try to perform the stitch after optimizing this is the result I see:
image.png

The PTO file is attached. At this point, I am convinced that the error must be on my part, but I am having a hard time figuring out what I am doing wrong. 

These are my optimization settings:
image.png

Also, the A and B images I uploaded were a slightly downscaled version of my originals. Maybe there 11 CPs it found was because of the reduced resolution (and my high-res files need a different setting).
Here is a link to the originals if you are interested:  https://we.tl/t-3iyp7y91qL (11.7 MB)

Thank you so much for taking the time to help me debug this. This probably is entirely my error in using the tool. 

Shaunak

--
A list of frequently asked questions is available at: http://wiki.panotools.org/Hugin_FAQ
---
You received this message because you are subscribed to the Google Groups "hugin and other free panoramic software" group.
To unsubscribe from this group and stop receiving emails from it, send an email to hugin-ptx+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/hugin-ptx/cb76488eebca2d897d1429534459f5d8a872b085.camel%40iinet.net.au.


--
Uploading_for_debugging.pto

Shaunak De

unread,
Jul 8, 2020, 7:41:26 PM7/8/20
to hugi...@googlegroups.com
On further examination of your project file, I notice you have a lot more control points than me. I can't seem to figure out why that would be. I am using Hugin's default settings!

Terry Duell

unread,
Jul 8, 2020, 8:19:25 PM7/8/20
to hugi...@googlegroups.com
Hello Shaunak De,

On Wed, 2020-07-08 at 16:41 -0700, Shaunak De wrote:
> On further examination of your project file, I notice you have a lot more
> control points than me. I can't seem to figure out why that would be. I am
> using Hugin's default settings!
>

At the moment I can't think why that would be the case, maybe someone else will
chime in with a possible explanation.
I had a try with your full sized images, and that too worked OK.
I didn't follow the tutorial explicitly, I used the following steps...

1. load images and apply 10 deg field of view to each, hugin automatically set a
new lens for each.
2. run cpfind, which found 24 control points. A quick check of those looked OK.
3. Optimize in steps, to everything without translation.
4. check the result and adjust crop boundaries.
5. stitch.

Attached is the pto file for this project.
Hope that helps.
IMGA-IMGB.pto

Frederic Da Vitoria

unread,
Jul 9, 2020, 2:29:15 AM7/9/20
to hugin and other free panoramic software
Hello,

I don't have an explanation, but I notice that Shaunak De's control points are grouped instead of being spread on the common parts of the images. More than the number of CPs, my guess is that the position of those CPs and the fact none of them is far from the others is the cause of the problem. 

I suggest manually adding CPs as widely spaced as possible. I guess there are too many comfusing things in those images. For example, if Hugin marks a "e" on one picture, finding the matching "e" on the other could be tricky, because there are a lot of exactly identical letters. So I'd put a few carefully chosen CPs. For example, I'd put at least 2 CPs in the title (one at each end of the common part) and one at the bottom of the column which is barely visible at the bottom-left of the second image. I'd add a few CPs as widespread as possible, which means probably a few close to the center. Then I'd remove all the CPs which were automatically created, reset all optiizations made in previous runs, and run optimization again. 

But this is a way to get around the issue, it does not explain why it happened in the first place.

Gunter Königsmann

unread,
Jul 9, 2020, 2:57:21 AM7/9/20
to Frederic Da Vitoria, hugin and other free panoramic software
Grouped CPs often indicate that the lense parameters are widely incorrect.
--
Sent from my Android device with K-9 Mail. Please excuse my brevity.

T. Modes

unread,
Jul 9, 2020, 11:19:49 AM7/9/20
to hugin and other free panoramic software


Am Donnerstag, 9. Juli 2020 01:38:38 UTC+2 schrieb Shaunak De:
Thank you so much for taking the time to help me debug this. This probably is entirely my error in using the tool. 
You are using a field of view (fov) of the input images of 100 deg.
The mentioned tutorial states:

We don't know the FOV (Field of view) of this imaginary camera, but it doesn't matter since the picture is the same regardless (setting any mid-range value between 5 and 40 degrees would probably be ok). Just enter 10 in the HFOV(v): and select OK

With a smaller fov it should work. (The fov should be 10, not the focal length):

Furthermore the optimiser settings are wrong. Better use an user defined assistant (one of the 2 scanned images), they automatise nearly all steps, except the first one of loading images and setting an initial fov of 10 deg.

Shaunak De

unread,
Jul 10, 2020, 1:53:23 PM7/10/20
to hugi...@googlegroups.com
Dear T. Modes,

I think you found the source of the problem. I was misinterpreting FOV as focal length. Choosing this parameter correctly solved the issue:

image.png

Also thank you Frederic and Gunter. Your comments and insights were very helpful in my understanding of what's happening behind the scenes in the software. In fact, I got so interested in this process, I started teaching myself OpenCV!

Thank you all. 

Shaunak 

--
A list of frequently asked questions is available at: http://wiki.panotools.org/Hugin_FAQ
---
You received this message because you are subscribed to the Google Groups "hugin and other free panoramic software" group.
To unsubscribe from this group and stop receiving emails from it, send an email to hugin-ptx+...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages