- Install and run docker engine, git and curl -
sudo apt-get update
sudo apt-get install git -y
sudo apt-get install \
apt-transport-https \
ca-certificates \
curl \
gnupg-agent \
software-properties-common -y
# Enter your code here. Read input from STDIN. Print output to STDOUT | |
import collections | |
x = int(input()) | |
str_num = input().split( ) | |
numbers = [] | |
for num in str_num: | |
numbers.append(int(num)) | |
# A simple program that captures video from webcam and displays it on the screen | |
import numpy as np | |
import cv2 | |
cap = cv2.VideoCapture(0) | |
while(True): | |
ret,frame = cap.read() | |
frame = cv2.resize(frame,(0,0),fx = 0.5, fy = 0.5) |
import numpy as np | |
import cv2 | |
# Global Variables | |
canvas = np.ones([500,500,3],'uint8')*255 | |
radius = 3 | |
color = (0,255,0) | |
pressed = False | |
# click callback |
import numpy as np | |
import cv2 | |
black = np.zeros([150,200,1],'uint8') | |
cv2.imshow("Black",black) | |
print(black[0,0,:]) | |
ones = np.ones([15,200,3],'uint8') | |
cv2.imshow("Ones",ones) | |
print(ones[0,0,:]) |
import numpy as np | |
import cv2 | |
image = cv2.imread("image.jpg") | |
cv2.imshow("Original",image) | |
#@ Gaussian Blur : | |
# Gaussian Blur filter smooths an image by averaging pixel values with its neighbors. | |
# It's called a Gaussian Blur because the average has a Gaussian falloff effect. | |
# In other words, pixels that are closer to the target pixel have a higher impact with the average than pixels that are far away. |
import numpy as np | |
import cv2 | |
color = cv2.imread("image.jpg",1) # Read image in color (1) mode | |
cv2.imshow("Image",color) | |
cv2.moveWindow("Image",0,0) | |
print(color.shape) | |
height,width,channels = color.shape | |
b,g,r = cv2.split(color) # Split image into Blue, Green and Red channels |
import numpy as np | |
import cv2 | |
img = cv2.imread("image.jpg") | |
# Scale | |
img_half = cv2.resize(img,(0,0),fx=0.5,fy=0.5) | |
img_stretch = cv2.resize(img,(600,600)) | |
img_stretch_near = cv2.resize(img,(600,600),interpolation=cv2.INTER_NEAREST) |
import numpy as np | |
import cv2 | |
bw = cv2.imread("image.pmg",0) # read as BmW | |
height,width = bw.shape[0:2] | |
cv2.imshow("Original BW",bw) | |
binary = np.zeros([height,width,1],'uint8') | |
thresh = 85 |
#!/usr/bin/env python3 | |
"""Simple HTTP Server With Upload. | |
This module builds on BaseHTTPServer by implementing the standard GET | |
and HEAD requests in a fairly straightforward manner. | |
see: https://gist.github.com/UniIsland/3346170 | |
""" | |
sudo apt-get update
sudo apt-get install git -y
sudo apt-get install \
apt-transport-https \
ca-certificates \
curl \
gnupg-agent \
software-properties-common -y