Commit bf4b3934 authored by Niels-Oliver Walkowski's avatar Niels-Oliver Walkowski
Browse files

fix indention and spaces

parent 1b9fd215
......@@ -66,43 +66,9 @@ class Contrast(np.ndarray):
if point > self._threshold:
contrast_points.append((frm_nr, bin_index, int(point)))
contrast_points = np.asarray(contrast_points, np.uint8)
contrast_points = np.asarray(contrast_points, np.uint8)
shape = contrast_points.shape
self.resize(shape, refcheck=False)
self[:,:] = contrast_points
return deepcopy(self) # TODO does not create a new object
class LightDark(object):
"""representations of light/dark contrasts"""
def __init__(self, frames):
self._channel = 2
self._frm_step = 50
self._bins = 16
self._threshold = 60000
self._save = False
self._frames = frames
def hist_vstack(self):
contrast_points = []
# pwd list sollte in Frames sein und hier nur durchlaufen werden
for frm_nr in range(self._frames.start, self._frames.end, self._frm_step):
pwd = self._frames.folder + self._frames.prefix + str(frm_nr) + '.png'
img = cv2.imread(pwd)
if self._channel == 2:
_img = cv2.cvtColor(img, cv2.COLOR_BGR2RGB)
luminances = luminance(_img)
hist_value, _ = np.histogram(luminances, bins=self._bins, range=(0, 255))
else:
img_hsv = cv2.cvtColor(img, cv2.COLOR_BGR2HSV_FULL)
hist_value = cv2.calcHist([img_hsv], [self._channel], None, [16], [0, 256])
for bin_index, point in enumerate(hist_value):
if point > self._threshold:
contrast_points.append((frm_nr, bin_index, int(point)))
return contrast_points
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment