Skip to content
Snippets Groups Projects

Resolve "Document algorithm functions and classes"

Merged Anders Langlie requested to merge 49-document-algorithm-functions-and-classes into master
11 files
+ 98
131
Compare changes
  • Side-by-side
  • Inline

Files

class SalamanderImage():
from cv2 import cv2
descriptors = []
import numpy as np
filename = ''
import algorithm.dsift as dsift
def __init__(self, filename):
self.filename
class SalamanderImage:
 
descriptors = []
 
filename = ''
 
 
def __init__(self, filename):
 
self.filename = filename
 
self.descriptors = self.calculate_descriptors()
 
 
def calculate_descriptors(self):
 
"""
 
Calculates the descriptors of the member image
 
 
Returns: The calculated descriptors
 
 
"""
 
 
image = cv2.imdecode(np.fromfile(self.filename, dtype=np.uint8), cv2.IMREAD_GRAYSCALE)
 
 
if image is None:
 
raise FileNotFoundError("Cannot find image file " + self.filename)
 
return dsift.compute_descriptors(image)
Loading