-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathMTF_drafting.py
More file actions
54 lines (35 loc) · 915 Bytes
/
Copy pathMTF_drafting.py
File metadata and controls
54 lines (35 loc) · 915 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
# -*- coding: utf-8 -*-
"""
Created on Tue Mar 13 09:16:15 2018
@author: Dustin
"""
import cv2
import numpy as np
import sfr_detection_functions as sfr
import matplotlib.pyplot as plt
sfr_reference = cv2.imread('SFRreg_pillared_tilted_trans.png',0)
img = sfr_reference[ 120:340,190:410]
for i in range( 0,img.shape[0]):
for j in range( 0,img.shape[1]):
if img[i,j] < 119:
img[i,j] = 119
elif img[i,j] > 223:
img[i,j] = 223
img_s = sfr.rescale( img)
plt.figure()
plt.plot( img_s[100,:])
g1 = sfr.gauss_blur(img_s)
plt.plot( g1[100,:])
g2 = sfr.gauss_blur(g1)
plt.plot( g2[100,:])
g3 = sfr.gauss_blur(g2)
plt.plot( g3[100,:])
def diff(x):
y = np.zeros(len(x)-2)
for i in range(1,len(x)-2):
y[i] = -0.5*x[i-1] + 0.5*x[i+1]
return y
dimg = diff(g3[100,:])
fimg = np.fft.rfft( dimg )
plt.figure()
plt.plot( fimg)