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
#!/usr/bin/env python | |
from pathlib import Path | |
import os | |
import cv2 | |
import argparse | |
# Supported OpenCV Backend Ubuntu 24.04.1 LTS | |
os.environ["QT_QPA_PLATFORM"] = "xcb" | |
os.environ["OPENCV_UI_BACKEND"] = "xcb" |
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
#!/usr/bin/env python3 | |
def create_response(): | |
'''Create polited and humble response to reviewer suggestions''' | |
a = ['y', 'u', 'e', 'n', 'f', ' ', '?', 'a', 'p', ' ', 'r', 's', 'd', 'u', 'o', 't', 'i', ' ', 'c', 'u', 'g', 'k', 'i'] | |
b = [4, 17, 2, 12, 8, 3, 21, 0, 18, 7, 1, 15, 20, 6, 5, 16, 19, 14, 10, 9, 13, 11, 12] | |
out = ''.join([x for _,x in sorted(zip(b,a))]) | |
return out | |
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
#!/usr/bin/env python3 | |
import numpy as np | |
import cv2 as cv | |
import os | |
import sys | |
import argparse | |
import matplotlib.pylab as plt |
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
#!/usr/bin/env python3 | |
# input video file: | |
input_file = 'input_video.mp4' | |
# termination criteria | |
criteria = (cv2.TERM_CRITERIA_EPS + cv2.TERM_CRITERIA_MAX_ITER, 30, 0.001) | |
# change this to your checkerboard dimensions: | |
width_number_of_squares = 14 |
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
''' Python implementation of basic background subtraction and object detection from | |
video using the OpenCV and numpy packages.''' | |
import cv2 | |
import numpy as np | |
# input video | |
cap = cv2.VideoCapture('video/file/directory/goes/here') | |
# initiating basic background subtraction, creating a background from history=n frames |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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
#!/usr/bin/env python3 | |
import numpy as np | |
import cv2 | |
import sys, os | |
import argparse | |
ap = argparse.ArgumentParser( | |
description='Input specific output pathway and framerate') | |
ap.add_argument("-i", "--input1",type=str, required=True, |