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