|
@@ -115,7 +115,10 @@
|
|
|
" masked_frame = cv2.bitwise_and(src1=frame, src2=self.mask)\n",
|
|
|
"\n",
|
|
|
" # Substracts background from current frame\n",
|
|
|
- " subject = cv2.subtract(masked_frame, self.background)\n",
|
|
|
+ " if 'subtract' in self.cfg and self.cfg['subtract'] < 0:\n",
|
|
|
+ " subject = cv2.subtract(masked_frame, self.background)\n",
|
|
|
+ " else:\n",
|
|
|
+ " subject = cv2.subtract(self.background, masked_frame)\n",
|
|
|
"\n",
|
|
|
" # Converts subject to grey scale\n",
|
|
|
" subject_gray = cv2.cvtColor(subject, cv2.COLOR_BGR2GRAY)\n",
|