different result in grabcut (Bug #1652)


Added by Stefano Fabri about 13 years ago. Updated almost 13 years ago.


Status:Cancelled Start date:2012-03-06
Priority:Normal Due date:
Assignee:Andrey Kamaev % Done:

0%

Category:imgproc, video
Target version:2.4.0
Affected version: Operating System:
Difficulty: HW Platform:
Pull request:

Description

This simple test seems to reproduce a bug in grabcut segmentation.


grabcut_test.cpp (703 Bytes) Stefano Fabri, 2012-03-06 11:27 pm

image.ppm (65.9 kB) Stefano Fabri, 2012-03-06 11:27 pm

mask.ppm (22 kB) Stefano Fabri, 2012-03-06 11:27 pm


Associated revisions

Revision d6d1ff0a
Added by Andrey Kamaev almost 13 years ago

Added regression test for #1652

Revision 4bc105c4
Added by Roman Donchenko over 11 years ago

Merge pull request #1652 from nghiaho12:kalman

History

Updated by Alexander Shishkov almost 13 years ago

  • Target version deleted ()

Updated by Andrey Kamaev almost 13 years ago

Thanks for your report, but it is not a bug.
GrabCut uses kmeans which uses random numbers for the initial guess. So results from subsequent runs can be slightly different.

  • Status changed from Open to Cancelled
  • Assignee set to Andrey Kamaev

Updated by Alexander Shishkov almost 13 years ago

  • Target version set to 2.4.0

Updated by Ilya Lysenkov almost 13 years ago

You can get the same results by explicitly setting the seed of the random numbers generator. Add these lines before each call of the grabCut function:

RNG &rng = theRNG();
rng.state = 0xffffffff;

Also available in: Atom PDF