Fwd: enblend patch

68 views
Skip to first unread message

Wirz

unread,
Sep 24, 2019, 10:37:44 AM9/24/19
to hugin-ptx, T. Modes
I initially sent this mail 24 hours ago but it seems to have vanished.
Again, with an updated patch.

lukas


-------- Forwarded Message --------
Subject: enblend patch
Date: Sun, 22 Sep 2019 23:27:03 +0300
From: Wirz <sp...@lukas-wirz.de>
To: hugin and other free panoramic software <hugi...@googlegroups.com>

Hi,

attached is a patch that I would suggest to be applied to enblend. It
does not solve any problem (with respect to the result image) that I am
aware of.

The problem that I'm fixing is in graphcut.h, in the function A_star:
There was first an object of type CostComparer<ImageType> created, then
this object is used to initialise a priority_queue (making a copy of the
object), and later a member variable (totalScore) of the initial
CostComparer was set (and never used). However, this does not affect
the copy that has been used to init the Queue, so there were accesses to
uninitialized memory.

Furthermore, my testing suggests, that the A_star function would in many
cases terminate later than possible (because the comparison with
totalScore gave wrong results) which leads to measurable performance issues.

My solution is to replace the previous functor class by a lambda. The
variable totalScore is (also by the copy) caught as a reference.
Testing shows faster runtime, equal output, and valgrind complains much
less.

Does that make sense? Should I make any modifications?

cheers, lukas

graphcut3.patch
signature.asc

Wirz

unread,
Sep 24, 2019, 10:37:44 AM9/24/19
to hugin and other free panoramic software
graphcut.patch
signature.asc

T. Modes

unread,
Sep 24, 2019, 1:43:29 PM9/24/19
to hugin and other free panoramic software
Am Dienstag, 24. September 2019 16:37:44 UTC+2 schrieb lukas:
I initially sent this mail 24 hours ago but it seems to have vanished.
Again, with an updated patch.

Thanks Lukas. I will have a look on it. But the next days I have other things to do, so it will take some time; but I will do it.

Thomas

Wirz

unread,
Sep 25, 2019, 7:20:31 AM9/25/19
to hugi...@googlegroups.com
Hi Thomas,

Sure, there is no hurry. I might also send another patch soon, I
finally understood what causes the black corners/fringes but don't know
how to fix it yet.

cheers, lukas
signature.asc

T. Modes

unread,
Oct 19, 2019, 3:05:03 AM10/19/19
to hugin and other free panoramic software
Hi Lukas,

I committed your patch (with some slightly modifications) to enblend repository. Thanks for the patch.

Thomas
Reply all
Reply to author
Forward
0 new messages