# Revision history [back]

this is a plain threshold operation.

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

Mat binary = fgmask > 120;

or :

Mat binary;


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;


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;


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;


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;