Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

cv::subtract() saturates the result, negative numbers will be truncated to 0.

to avoid this, try one of:

  • selecting a larger (and signed) result type: subtract(src,dst,result, CV_16S); for the further processing
  • use cv::absDiff() instead of subtract()