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
def FrontierSimplePower12(x): | |
if x <= 500: | |
return 53 | |
else: | |
return 53 + (x-500)*(0.1286+0.038447) | |
def constellation(x): | |
rate = 0.074 | |
return 3.42+(0.038447+rate)*x | |
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
def distance(point1,point2): | |
return sqrt((point1[0]-point2[0])**2 + (point1[1]-point2[1])**2) | |
def gaussianLP(D0,imgShape): | |
base = np.zeros(imgShape[:2]) | |
rows, cols = imgShape[:2] | |
center = (rows/2,cols/2) | |
for x in range(cols): | |
for y in range(rows): | |
base[y,x] = exp(((-distance((y,x),center)**2)/(2*(D0**2)))) |
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
def distance(point1,point2): | |
return sqrt((point1[0]-point2[0])**2 + (point1[1]-point2[1])**2) | |
def butterworthLP(D0,imgShape,n): | |
base = np.zeros(imgShape[:2]) | |
rows, cols = imgShape[:2] | |
center = (rows/2,cols/2) | |
for x in range(cols): | |
for y in range(rows): | |
base[y,x] = 1/(1+(distance((y,x),center)/D0)**(2*n)) |
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
def distance(point1,point2): | |
return sqrt((point1[0]-point2[0])**2 + (point1[1]-point2[1])**2) | |
def idealFilterLP(D0,imgShape): | |
base = np.zeros(imgShape[:2]) | |
rows, cols = imgShape[:2] | |
center = (rows/2,cols/2) | |
for x in range(cols): | |
for y in range(rows): | |
if distance((y,x),center) < D0: |
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 cv2 | |
import numpy as np | |
import matplotlib.pyplot as plt | |
plt.figure(figsize=(6.4*5, 4.8*5), constrained_layout=False) | |
img_c1 = cv2.imread("left01.jpg", 0) | |
img_c2 = np.fft.fft2(img_c1) | |
img_c3 = np.fft.fftshift(img_c2) | |
img_c4 = np.fft.ifftshift(img_c3) |
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 bluetooth | |
import subprocess | |
class BluetoothComm: | |
def __init__(self): | |
self.server_socket=bluetooth.BluetoothSocket( bluetooth.RFCOMM ) | |
port = 1 | |
self.server_socket.bind(("",port)) | |
self.server_socket.listen(1) | |
self.client_socket,address = self.server_socket.accept() | |
print("Accepted connection from ",address) |
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 bluetooth | |
server_socket=bluetooth.BluetoothSocket( bluetooth.RFCOMM ) | |
port = 1 | |
server_socket.bind(("",port)) | |
server_socket.listen(1) | |
client_socket,address = server_socket.accept() | |
print("Accepted connection from ",address) | |
while True: |
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
from chalice import Chalice, Response | |
from pdf2image import convert_from_bytes | |
import os | |
from io import BytesIO | |
app = Chalice(app_name='pdf2image') | |
@app.route('/') | |
def index(): |
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
from wand.image import Image | |
import os | |
# Download and read pdf file | |
os.system("curl https://www.w3.org/WAI/ER/tests/xhtml/testfiles/resources/pdf/dummy.pdf -o /tmp/file.pdf") | |
f = open('/tmp/file.pdf','rb') | |
infile = f.read() | |
f.close() | |
with Image(blob=infile,resolution=150) as img_pdf: |
NewerOlder