Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

this is a plain threshold operation.

stop worrying, and throw away your loop in favor of wither:

Mat binary = fgmask > 120;

or :

Mat binary;
threshold(fgmask, binary, 120, 255, 0);

in other words, with opencv, the last thing on earth you should do is, write your own per-pixel loops, and then worry about optimizing that.

this is a plain threshold operation.

stop worrying, and throw away your loop in favor of wither:either:

Mat binary = fgmask > 120;

or :

Mat binary;
threshold(fgmask, binary, 120, 255, 0);

in other words, with opencv, the last thing on earth you should do is, write your own per-pixel loops, and then worry about optimizing that.

this is a plain threshold operation.

stop worrying, and throw away your loop in favor of either:

Mat binary = fgmask > 120;

120;

or :

Mat binary;
threshold(fgmask, binary, 120, 255, 0);

in other words, with opencv, the last thing on earth you should do is, write your own per-pixel loops, and then worry about optimizing that.

this is a plain threshold operation.

stop worrying, and throw away your loop in favor of either:

Mat binary = fgmask > 120;

or :

Mat binary;
threshold(fgmask, binary, 120, 255, 0);

in other words, with opencv, the last thing on earth you should do is, write your own per-pixel loops, and then worry about optimizing that.that. doing so, you actively defeat opencv's built in parallelization.

this is a plain threshold operation.

stop worrying, and throw away your loop in favor of either:

Mat binary = fgmask > 120;

or :

Mat binary;
threshold(fgmask, binary, 120, 255, 0);

in other words, with opencv, the last thing on earth you should do is, write your own per-pixel loops, and then worry about optimizing that. doing so, you your current way actively defeat defeats opencv's built in builtin parallelization.