Re: fine-tune the control points from command line

228 views
Skip to first unread message

JohnPW

unread,
Oct 9, 2012, 2:44:03 AM10/9/12
to hugi...@googlegroups.com
I don't know, but I assume you have been here?

I see no command listed for it, but this doesn't look definitive.
I'm sure a knowledgable person around here can give you a definite answer.
John

On Monday, October 8, 2012 6:22:43 PM UTC-5, Willeke wrote:
Hi,

Is it possible to fine-tune the control points from the command line?


Willeke

TB

unread,
Sep 14, 2014, 8:21:48 PM9/14/14
to hugi...@googlegroups.com
Close from 2 years after previous post...
I have been to the link http://wiki.panotools.org/Panorama_scripting_in_a_nutshell
and confirm that it is still not a command (as of today, September of 2014).
As per what I saw from Hugin source code, the "Fine-tune all Points" menu is included in Hugin itself and is not a command called by Hugin...
I also tried some Python scripts but I did not find any way to call from command line...

if someone sees another way, please respond here so we would be updated...

Thanks in advance!

Terry Duell

unread,
Sep 14, 2014, 10:05:52 PM9/14/14
to hugi...@googlegroups.com
On Mon, 15 Sep 2014 10:21:48 +1000, TB <tbaeck...@gmail.com> wrote:

> Close from 2 years after previous post...
> I have been to the
> link http://wiki.panotools.org/Panorama_scripting_in_a_nutshell
> and confirm that it is still not a command (as of today, September of
> 2014).
> As per what I saw from Hugin source code, the "Fine-tune all Points" menu
> is included in Hugin itself and is not a command called by Hugin...
> I also tried some Python scripts but I did not find any way to call from
> command line...
>
> if someone sees another way, please respond here so we would be
> updated...
>

Am I right to assume that you are finding your control points via command
line, using cpfind and wish to have a command line method of fine tuning
those control points?
In case you haven't looked in detail at the cpfind options, you can use
--fullscale which may provide "better" control points.
There are also a number of parameters for fine-tuning, such as
--sieve1width, --seive1height etc which may help.
In addition, the command line tool cpclean has options to remove any
generated control points with errors bigger than a specified value.
Does any of this help?

Cheers,
--
Regards,
Terry Duell

T. Modes

unread,
Sep 15, 2014, 2:42:39 PM9/15/14
to hugi...@googlegroups.com


Am Montag, 15. September 2014 02:21:48 UTC+2 schrieb TB:
Close from 2 years after previous post...
I have been to the link http://wiki.panotools.org/Panorama_scripting_in_a_nutshell
and confirm that it is still not a command (as of today, September of 2014).
As per what I saw from Hugin source code, the "Fine-tune all Points" menu is included in Hugin itself and is not a command called by Hugin...

 I don't see the point of fine-tune cp from the command line. Cpfind and align_image_stack set the cp already with sub-pixel accuracy. So fine-tune is not helpful.
Fine-tune has its application when setting cp by hand and then fine-tune the rough position.

TB

unread,
Sep 15, 2014, 8:47:31 PM9/15/14
to hugi...@googlegroups.com
Hello / Hallo


> Am I right to assume that you are finding your control points
> via command line, using cpfind and wish to have a command
> line method of fine tuning those control points?

Yes, you're right, my exact command is:
cpfind --fullscale --celeste --multirow -o ptoFileName.pto ptoFileName.pto

And my idea was to drop CPoints that had a questionable correlation value.



> In case you haven't looked in detail at the cpfind options, you
> can use  --fullscale which may provide "better" control points.

Totally right. I confirm: It takes few more seconds (minutes with older CPU and less memory) but gives better results. I was using this one also.



> There are also a number of parameters for fine-tuning, such
> as --sieve1width, --seive1height etc which may help.

Good idea. I left those options aside, but I wonder if I would get more trustful CPoints by using smaller --sieve1* values...



> In addition, the command line tool cpclean has options
> to remove any generated control points with errors bigger
> than a specified value.

I use it also. But I understood that it removes points based on points "too far" from their position. Ideally, I would like to use it as a "second pass". The "first pass" would the correlation.



> Does any of this help?

Yes, always. By confirming my thoughts and giving some ideas... (sievel*)




> I don't see the point of fine-tune cp from the command line.
> Cpfind and align_image_stack set the cp already with sub-pixel
> accuracy. So fine-tune is not helpful.

I don't know how cpfind works in details but I always got CPoints with correlation below 0.5 (generally in some "blurry" areas, in the middle of a bigger pattern). I believe that this might be because cpfind works on bigger areas to find similarities while fine-tune option of hugin works on smaller search area.
My idea would be to drop the points that cannot be aligned at pixel-level (with high-contrast details in a small region).

(Regarding align_image_stack, I did not use it as I am focusing on panorama now, but useful to know anyway).



> Fine-tune has its application when setting cp
> by hand and then fine-tune the rough position.

Partially agree:
Fine-tune is extremely useful and saves a huge time when adding manual points.
But
It is also extremely useful to automatically estimate how "trustful" are the control points that cpfind created automatically. Especially with the "Edit > Fine-tune all Points" option.
When proceeding manually, right after having cpfind created the points, I "Fine-tune all Points" and then delete all the CPoints that are below 0.6 "distance" (that is correlation value at this point). I prefer creating my own extra CPoints if needed.

----------

Some more details on my target: I often take panoramas and people request to have those quickly on the web. So my aim here is to automate the creation of panorama from a set of pictures.
Sunday afternoon, I created the Python script attached to this message. That does most of the work.
The same is also there:
http://t.baeckeroot.free.fr/createPanorama.py
(I'll update on my site)
(feel free to adapt and/or revert to me and/or re-use it in any way you want. I build this for me: Python 2.7, Linux, Hugin 2011.4)

In brief my idea was to:
A- load the pictures composing a panorama
B- create Control-Points (cpfind)
C- Fine-tune them and drop CPoints that had correlation < 0.6
D- optimise alignment (autooptimiser and pano_modify)
E- drop CPoints that were statistically "too far" (cpclean)
F- create "final draft image" (nona and enblend)

Result is not perfect but enough for web. And fully automated.

The only missing part is C- to get the correlation value of the CPoints (to drop the less trustful).
If I can "Fine-tune all Points" and get the correlation value (in place of distance in hugin), then I believe I would be able to delete the CPoints from Python.

In my script, this is the part:
"
######## ( File > Preferences > Control Points Editor > Correlation Threshold: lower to 0.4 ) ########
######## Edit > Fine-tune all Points ########

######## Drop the CPoints that have correlation (distance) < 0.6 ########
"



Thanks Terry and Thomas

createPanorama.py

T. Modes

unread,
Sep 16, 2014, 12:08:35 PM9/16/14
to hugi...@googlegroups.com
Hello,


Am Dienstag, 16. September 2014 02:47:31 UTC+2 schrieb TB:
I don't know how cpfind works in details but I always got CPoints with correlation below 0.5 (generally in some "blurry" areas, in the middle of a bigger pattern). I believe that this might be because cpfind works on bigger areas to find similarities while fine-tune option of hugin works on smaller search area.

The correlation is not the only measure for the "quality" of a cp. Cpfind is using a different "quality" criterion (and also on other scales). So this is not per se better or more worse than the correlation.
So I would not use the correlation as the only measure for the quality of a cp.

 
In brief my idea was to:
A- load the pictures composing a panorama
B- create Control-Points (cpfind)
C- Fine-tune them and drop CPoints that had correlation < 0.6
D- optimise alignment (autooptimiser and pano_modify)
E- drop CPoints that were statistically "too far" (cpclean)
F- create "final draft image" (nona and enblend)

D and E are in the wrong order.

Without the correlation criterion, where I don't agree, this can already done by PTBatcherGUI (queue assistant projects, then automatically stitch).
Reply all
Reply to author
Forward
0 new messages