Select all vertical lines and change to horizontal at once - it this possible?

54 views
Skip to first unread message

Abrimaal

unread,
Mar 19, 2020, 7:39:44 PM3/19/20
to hugin and other free panoramic software
This is an example of straightening a single photo (but it also refers to a sequence of images and there are more lines)

I open an image.
Rotate it 90°
Run vertical line detector to detect horizontal lines.

All the horizontal lines are detected as vertical lines, what is correct.
Now I would like to select all lines and change the value to horizontal - but select all does not work here.

I rotate the image back to 0°, the detected lines are still listed as vertical.

When loading 3 exposures, there are already 15 lines to correct.
Is there any simpler method to change all vertical lines to horizontal, than click on any of the 15 lines and change each?

I run again the line detector - this time it detects vertical lines.
Optimise and save.





rotate 90 detect horizontal select all change vert to horiz.png

David W. Jones

unread,
Mar 19, 2020, 8:32:54 PM3/19/20
to hugi...@googlegroups.com
I think that functionality would be nice, as you outlined it.

Only way I can think of now is to save the PTO after first running vertical line detector on it, edit it in text editor, search and replace to change vertical to horizontal. Save it, then reopen it in Hugin, rotate images back, and rerun vertical lines.

Maybe the developers have a better idea?

--
David W. Jones
gnome...@gmail.com
wandering the landscape of god
http://dancingtreefrog.com

Sent from my Android device with F/LOSS K-9 Mail.

Bruno Postle

unread,
Mar 20, 2020, 3:15:36 AM3/20/20
to hugi...@googlegroups.com
I was bitten by this this week and needed to change lots of points from vertical to horizontal. But I was doing something *really* obscure (stitching handheld photos of architectural drawings).

We need to know your use-case, horizontal control points are completely useless for most users, what can you possibly need them for?

--
Bruno


On 19 March 2020 23:39:44 GMT, Abrimaal wrote:
>
>*Now I would like to select all lines and change the value to horizontal -
>but select all does not work here. *

David W. Jones

unread,
Mar 20, 2020, 3:59:04 AM3/20/20
to hugi...@googlegroups.com
My use case for this is to use horizontal lines for leveling handheld
strip panoramas that include sea horizons. The horizon itself never
seems to be detected as a horizontal line. Yet if I rotate the image,
the find vertical lines function finds the horizon as a vertical line.

Maybe the question is why doesn't the point finding function find
horizontal lines in the first place? What makes them different from
vertical lines that they can't be found?

On 3/19/20 9:15 PM, Bruno Postle wrote:
> I was bitten by this this week and needed to change lots of points
> from vertical to horizontal. But I was doing something *really*
> obscure (stitching handheld photos of architectural drawings).
>
> We need to know your use-case, horizontal control points are
> completely useless for most users, what can you possibly need them
> for?

Weird, when I replied to this email, Abrimaal's quoted portion
disappeared. Had to copypaste it back in.

On 19 March 2020 23:39:44 GMT, Abrimaal wrote:

> > *Now I would like to select all lines and change the value to horizontal -
> > but select all does not work here. *
> > I rotate the image back to 0°, the detected lines are still listed as vertical.

Bruno Postle

unread,
Mar 20, 2020, 6:25:36 AM3/20/20
to hugi...@googlegroups.com
The vast majority of panoramas don't have sea horizons, detecting horizontal lines would mess things up for everybody else. The code is capable of detecting horizontal lines, but the functionality is disabled.

--
Bruno


On 20 March 2020 07:58:57 GMT, "David W. Jones" wrote:
>My use case for this is to use horizontal lines for leveling handheld
>strip panoramas that include sea horizons. The horizon itself never
>seems to be detected as a horizontal line. Yet if I rotate the image,
>the find vertical lines function finds the horizon as a vertical line.
>
>Maybe the question is why doesn't the point finding function find
>horizontal lines in the first place? What makes them different from
>vertical lines that they can't be found?

--
Bruno

David W. Jones

unread,
Mar 20, 2020, 11:47:08 AM3/20/20
to hugi...@googlegroups.com
On March 20, 2020 12:25:26 AM HST, Bruno Postle <br...@postle.net> wrote:
The vast majority of panoramas don't have sea horizons, detecting horizontal lines would mess things up for everybody else. The code is capable of detecting horizontal lines, but the functionality is disabled.

Why is the functionality disabled?


--
David W. Jones
gnome...@gmail.com
wandering the landscape of god
http://dancingtreefrog.com

Gunter Königsmann

unread,
Mar 20, 2020, 11:57:49 AM3/20/20
to hugi...@googlegroups.com, David W. Jones
In most cases seemingly horizontal lines in real live often aren't while vertical ones often are vertical.


On March 20, 2020 4:47:00 PM GMT+01:00, "David W. Jones" <gnome...@gmail.com> wrote:
On March 20, 2020 12:25:26 AM HST, Bruno Postle <br...@postle.net> wrote:
The vast majority of panoramas don't have sea horizons, detecting horizontal lines would mess things up for everybody else. The code is capable of detecting horizontal lines, but the functionality is disabled.

Why is the functionality disabled?

--
Sent from my Android device with K-9 Mail. Please excuse my brevity.

David W. Jones

unread,
Mar 20, 2020, 12:14:10 PM3/20/20
to Hugin-ptx
On March 20, 2020 5:57:41 AM HST, "Gunter Königsmann" <gunter.ko...@gmail.com> wrote:
In most cases seemingly horizontal lines in real live often aren't while vertical ones often are vertical.

On March 20, 2020 4:47:00 PM GMT+01:00, "David W. Jones" <gnome...@gmail.com> wrote:
On March 20, 2020 12:25:26 AM HST, Bruno Postle <br...@postle.net> wrote:
The vast majority of panoramas don't have sea horizons, detecting horizontal lines would mess things up for everybody else. The code is capable of detecting horizontal lines, but the functionality is disabled.

Why is the functionality disabled?

Well, in my experience with other photos, a lot of "vertical" lines aren't straight up-and-down verticals: legs of a rocking chair, for instance.

Oh, well. Requiring manual entry of horizontal lines is ok.

Still would be nice to be able to select multiple lines and toggle the change en masse.


--
David W. Jones
gnome...@gmail.com
wandering the landscape of god
http://dancingtreefrog.com

Sent from my Android device with F/LOSS K-9 Mail.

Gunter Königsmann

unread,
Mar 20, 2020, 1:49:48 PM3/20/20
to David W. Jones, Hugin-ptx
Feels like an interesting feature-request (don't know if it is a low-hanging fruit or something the devs would struggle with for months) and a description of the pros and cons of any heuristics: it constantly fails for some users.

Abrimaal

unread,
Mar 20, 2020, 7:19:22 PM3/20/20
to hugin and other free panoramic software
As you see, we are not "most users", everyone is different :)

Some objects can be photographed only from an angle, because there is a tree between the object and your camera.

Below a simple photo example why horizontal lines are equally important as the vertical ones. This is just a single photo taken from a window. If it was a panorama there would be more work.

1. Original photo taken from an angle
2. Vertical lines are detected and straightened (optimized)
3. Horizontal lines are added and optimized for positions
4. Optimized barrel distortion. The calculation was based mainly on the horizontal lines. The vertical lines were long and straight, because they did not require to be optimized for barrel distortion.
1 original photo.jpg
2 vertical lines optimized.jpg
3 vertical and horizontal lines optimized.jpg
4 vertical horizontal and debarrelized.jpg

Bruno Postle

unread,
Mar 21, 2020, 4:21:47 AM3/21/20
to hugi...@googlegroups.com


On 20 March 2020 23:19:22 GMT, Abrimaal wrote:
>As you see, we are not "most users", everyone is different :)

This is not the 'horizon at sea' use case, it is much closer to the kind of stuff I tend to use Hugin for.

This would be an argument for enabling horizontal control point generation when the output projection is set to 'rectilinear'. Horizontal control points are almost never any use when the output projection is equirectangular.

--
Bruno

Mihai Dobrescu

unread,
Mar 21, 2020, 4:45:52 AM3/21/20
to hugi...@googlegroups.com
Hello, sorry if I am off-topic, but I think there is something worth to mention here:


When I was looking for an automated way of warping, still with no success, I've found this technique.
There is also a step to detect vertical and horizontal lines inside.

Would it be feasible to have such feature?

Regards,
Mike

--
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/5424B0D9-2E7F-4529-86A6-707661E5E643%40postle.net.


--
Mihai Sorin Dobrescu
Reply all
Reply to author
Forward
0 new messages