Browse Source

some fixes again

dianamaro 2 years ago
parent
commit
90ee22e547
5 changed files with 67 additions and 64 deletions
  1. 3 3
      background.ipynb
  2. 2 0
      controllers/camera.ipynb
  3. 4 1
      controllers/position.ipynb
  4. 28 41
      hippoSIT.ipynb
  5. 30 19
      sandbox/tracking.ipynb

+ 3 - 3
background.ipynb

@@ -2,7 +2,7 @@
  "cells": [
   {
    "cell_type": "code",
-   "execution_count": 43,
+   "execution_count": 76,
    "metadata": {},
    "outputs": [],
    "source": [
@@ -22,7 +22,7 @@
   },
   {
    "cell_type": "code",
-   "execution_count": 44,
+   "execution_count": 77,
    "metadata": {},
    "outputs": [],
    "source": [
@@ -37,7 +37,7 @@
   },
   {
    "cell_type": "code",
-   "execution_count": 45,
+   "execution_count": 78,
    "metadata": {},
    "outputs": [],
    "source": [

+ 2 - 0
controllers/camera.ipynb

@@ -76,6 +76,8 @@
     "        while not self.stopped:\n",
     "            (self.grabbed, self.frame) = self.stream.read()\n",
     "            self.count()  # count FPS\n",
+    "            #cv2.waitKey(50)\n",
+    "            \n",
     "        self.stream.release()\n",
     "            \n",
     "    def read(self):\n",

+ 4 - 1
controllers/position.ipynb

@@ -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",

File diff suppressed because it is too large
+ 28 - 41
hippoSIT.ipynb


File diff suppressed because it is too large
+ 30 - 19
sandbox/tracking.ipynb