Просмотр исходного кода

removed animal contours from video

asobolev 1 год назад
Родитель
Сommit
50ea29f8be
3 измененных файлов с 32 добавлено и 18 удалено
  1. 25 14
      SIT.ipynb
  2. 4 1
      controllers/display.ipynb
  3. 3 3
      profiles/default.json

Разница между файлами не показана из-за своего большого размера
+ 25 - 14
SIT.ipynb


+ 4 - 1
controllers/display.ipynb

@@ -63,6 +63,8 @@
     "        # light or dark period\n",
     "        texts.append('Light' if self.pt.is_light else 'Dark')\n",
     "\n",
+    "        frame_to_save = frame.copy()  # save video without animal contours\n",
+    "        \n",
     "        # draw animal position center(s) and contours\n",
     "        if self.pt.positions_in_px is not None:\n",
     "            pos_in_px = self.pt.positions_in_px\n",
@@ -88,8 +90,9 @@
     "        # draw text infos\n",
     "        for i, text in enumerate(texts):\n",
     "            cv2.putText(frame, text, (10, 30 + 20*(i+1)), FONT, .5, COLORS['white'])\n",
+    "            cv2.putText(frame_to_save, text, (10, 30 + 20*(i+1)), FONT, .5, COLORS['white'])\n",
     "\n",
-    "        return frame"
+    "        return frame, frame_to_save"
    ]
   },
   {

+ 3 - 3
profiles/default.json

@@ -8,7 +8,7 @@
         "verbose": true
     },
     "video": {
-        "fps": 20,
+        "fps": 30,
         "file_path": "video.avi"
     },
     "position": {
@@ -69,8 +69,8 @@
         "iti_duration": 20,
         "punishment_duration": 10,
         "distractor_islands": 1,
-        "distractor_fail": true,
-        "enable_motors": true,
+        "distractor_fail": false,
+        "enable_motors": false,
         "motors_port": "COM12",
         "cable_motor_port": "COM13"
     }