darrenlafreniere / lafarren-image-completer

Implementation of the research titled: "Image Completion Using Efficient Belief Propagation via Priority Scheduling and Dynamic Pruning"
http://www.lafarren.com/image-completer/
GNU General Public License v3.0
32 stars 18 forks source link

assert "numBatchCalculations > 0" failed in Get() #73

Open daviddoria opened 13 years ago

daviddoria commented 13 years ago

If I fill this image: http://daviddoria.com/Uploads/ImageCompleter/input.png

with this mask: http://daviddoria.com/Uploads/ImageCompleter/mask_full.png

it works fine (the result is bad, but it runs).

However, if I use this mask: http://daviddoria.com/Uploads/ImageCompleter/mask_small.png

it crashes with:

Image Completion Using Efficient Belief Propagation There are 108 nodes. There are 0 labels. /media/portable/Projects/src/lafarren-image-completer/src/image-completer-lib/impl/EnergyCalculatorContainer.cpp(334): assert "numBatchCalculations > 0" failed in Get(). Collecting stack trace information, please wait...

Call stack: [00] 0xb6fa38c8 [01] wxAppConsoleBase::OnAssertFailure(wchart const, int, wchart const, wchart const, wchart const) [02] 0xb6fa4ecb [03] wxOnAssert(char const, int, char const, char const, char const) [04] LfnIc::EnergyCalculatorContainer::Get(LfnIc::EnergyCalculator::BatchParams const&, int) /media/portable/Projects/src/lafarren-image-completer/src/image-completer-lib/impl/EnergyCalculatorContainer.cpp:338 [05] LfnIc::Node::CalculatePriority() const /media/portable/Projects/src/lafarren-image-completer/src/image-completer-lib/impl/Node.cpp:463 [06] LfnIc::NodeSet::UpdatePriority(LfnIc::Node const&) /media/portable/Projects/src/lafarren-image-completer/src/image-completer-lib/impl/NodeSet.cpp:204 [07] LfnIc::PriorityBpRunner::Run() /media/portable/Projects/src/lafarren-image-completer/src/image-completer-lib/impl/PriorityBpRunner.cpp:112 ^C

real 0m1.939s user 0m1.804s sys 0m0.096s

This mask then works again, so there is no problem with the grey pixels: http://daviddoria.com/Uploads/ImageCompleter/mask_big.png

The problem I guess is that the patches that are being used are bigger than the white region. It would be nice for this to crash more gracefully with a " There are 0 labels!" instead of this giant assertion error.