Merge pull request #37 from Summer404NotFound/main

Update eye_processor.py
This commit is contained in:
Prohurtz 2022-10-23 21:30:57 -04:00 committed by GitHub
commit 05fb998f7f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -309,12 +309,13 @@ class EyeProcessor:
# Increase our threshold value slightly, in order to have a better possibility of getting back
# something to do blob tracking on.
hist = cv2.calcHist([self.current_image_gray], [0], None, [256], [0, 256])
histr = hist.ravel()
peaks, properties = sp.find_peaks(histr, distance=5)
minpeak = np.min(peaks)
thresholdoptics = np.array(minpeak + int(self.config.threshold + 12))
larger_threshold = cv2.inRange(self.current_image_gray,lowb,thresholdoptics) #faster than cv2.threshold
hist = cv2.calcHist([self.current_image_gray], [0], None, [256], [0, 256])
histr = hist.ravel()
peaks, properties = sp.find_peaks(histr, distance=5)
minpeak = np.min(peaks)
thresholdoptics = np.array(minpeak + int(self.config.threshold + 12))
larger_threshold = cv2.inRange(self.current_image_gray,lowb,thresholdoptics) #faster than cv2.threshold
larger_threshold = cv2.bitwise_not(larger_threshold)
# Blob tracking requires that we have a vague idea of where the eye may be at the moment. This
# means we need to have had at least one successful runthrough of the Pupil Labs algorithm in
# order to have a projected sphere.
@ -589,7 +590,7 @@ class EyeProcessor:
minpeak = np.min(peaks)
thresholdoptics = np.array(minpeak + int(self.config.threshold))
thresh = cv2.inRange(self.current_image_gray,lowb,thresholdoptics) #faster than cv2.threshold
thresh = cv2.bitwise_not(thresh)