- Run the following commands
-$ sudo apt install $(cat cv2_requirements_apt.txt)
-$ sudo ldconfig
-$ sudo dpkg -i opencv_3.1.0_armhf.deb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
sudo dd if=/dev/zero of=/swap bs=10M count=100 #Creates a file of size 1000M | |
sudo losetup /dev/loop0 /swap | |
sudo mkswap /dev/loop0 | |
sudo swapon /dev/loop0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import dxfgrabber | |
import cv2 | |
import numpy as np | |
import sys | |
""" | |
def absdiff(num1, num2): | |
if num1 <= num2: | |
return num2 - num1 | |
else: |

This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
gimpH = 230 | |
gimpS = 36 | |
gimpV = 70 | |
opencvH = gimpH / 2 | |
opencvS = (gimpS / 100) * 255 | |
opencvV = (gimpV / 100) * 255 | |
print('H: {}\nS: {}\nV: {}\n'.format(opencvH, opencvS, opencvV)) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import requests | |
import time | |
localtime = int(time.time()) | |
r = requests.post('http://COPERNICUS_HOST:PORT/login.xml', data={ | |
'username': 'PLAINTEXT_USERNAME', | |
'password': 'PLAINTEXT_PASSWORD', | |
'mode': 191, | |
'producttype': 0, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import re | |
LINEBREAK_REGEX = re.compile(r'((\r\n)|[\n\v])+') | |
NONBREAKING_SPACE_REGEX = re.compile(r'(?!\n)\s+') | |
def normalize_whitespace(text): | |
""" | |
Given ``text`` str, replace one or more spacings with a single space, and one | |
or more linebreaks with a single newline. Also strip leading/trailing whitespace. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import subprocess | |
import time | |
import os | |
import sys | |
if len(sys.argv) > 1: | |
directory = sys.argv[1] | |
else: | |
directory = './videos' | |
directory = os.path.abspath(directory) |
OlderNewer