mirror of
https://github.com/balajsra/EECS-442-WN19-DIC-Project.git
synced 2025-09-04 01:43:15 +00:00
Spacing and Tab Fixes in __main__.py
Renamed functions to use underscores and lowercase rather than camel case. Made minor spacing changes.
This commit is contained in:
@@ -4,10 +4,10 @@ from matplotlib import pyplot as plt
|
||||
import os
|
||||
import file_data
|
||||
|
||||
def main():
|
||||
|
||||
def main():
|
||||
# Read in all images
|
||||
images = readImages()
|
||||
images = read_images()
|
||||
|
||||
# Read in data from Section001_Data.txt
|
||||
specimen, load_disp_data = file_data.read_file("../Section001_Data.txt")
|
||||
@@ -17,7 +17,7 @@ def main():
|
||||
strains = []
|
||||
|
||||
# Get distances using sift
|
||||
distances = getSiftDistance(images[0], images[1])
|
||||
distances = get_sift_distance(images[8], images[9])
|
||||
|
||||
# These distances are coming out as zero for some reason.
|
||||
# Still trying to figure out if it's a bug in the code I
|
||||
@@ -39,22 +39,26 @@ def main():
|
||||
"""
|
||||
|
||||
|
||||
def readImages():
|
||||
image_dir = '../images/'
|
||||
def read_images():
|
||||
image_dir = '../Images/'
|
||||
filenames = os.listdir(image_dir)
|
||||
|
||||
images = []
|
||||
for file in filenames:
|
||||
images.append(cv2.imread(os.path.join(image_dir, file)))
|
||||
|
||||
return images
|
||||
|
||||
def getStrain(length, displacement):
|
||||
|
||||
def get_strain(length, displacement):
|
||||
return displacement / length
|
||||
|
||||
def getYoungsModulus(strain, stress):
|
||||
return strain / stress
|
||||
|
||||
def getSiftDistance(img1, img2):
|
||||
def get_youngs_modulus(strain, stress):
|
||||
return stress / strain
|
||||
|
||||
|
||||
def get_sift_distance(img1, img2):
|
||||
""" Gets distance between matching pts in
|
||||
img1 and img2.
|
||||
"""
|
||||
@@ -96,7 +100,5 @@ def getSiftDistance(img1, img2):
|
||||
return distances
|
||||
|
||||
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
main()
|
Reference in New Issue
Block a user