fix: tune LEAP filter

This commit is contained in:
Prohurtz 2023-10-12 09:16:06 -05:00
parent d685ad18ea
commit d7c9b3b70b
4 changed files with 10 additions and 8 deletions

View File

@ -75,11 +75,11 @@ class EyeTrackSettingsConfig(BaseModel):
osc_right_eye_x_address: str = "/avatar/parameters/RightEyeX" osc_right_eye_x_address: str = "/avatar/parameters/RightEyeX"
osc_eyes_y_address: str = "/avatar/parameters/EyesY" osc_eyes_y_address: str = "/avatar/parameters/EyesY"
osc_invert_eye_close: bool = False osc_invert_eye_close: bool = False
gui_RANSACBLINK: bool = True gui_RANSACBLINK: bool = False
gui_legacy_ransac: bool = False gui_legacy_ransac: bool = False
gui_legacy_ransac_thresh_right: int = 80 gui_legacy_ransac_thresh_right: int = 80
gui_legacy_ransac_thresh_left: int = 80 gui_legacy_ransac_thresh_left: int = 80
gui_LEAP_lid: bool = False gui_LEAP_lid: bool = True
gui_osc_vrcft_v1: bool = False gui_osc_vrcft_v1: bool = False
gui_osc_vrcft_v2: bool = False gui_osc_vrcft_v2: bool = False
gui_vrc_native: bool = True gui_vrc_native: bool = True

View File

@ -358,9 +358,12 @@ class EllipseBasedPupilDilation:
maxp = float(self.data[int_y, int_x]) maxp = float(self.data[int_y, int_x])
minp = float(self.maxval) minp = float(self.maxval)
eyedilation = (pupil_area - maxp) / ( try:
minp - maxp eyedilation = (pupil_area - maxp) / (
) # for whatever reason when input and maxp are too close it outputs high minp - maxp
) # for whatever reason when input and maxp are too close it outputs high
except:
eyedilation = 0.5
eyedilation = 1 - eyedilation eyedilation = 1 - eyedilation
if outputSamples > 0: if outputSamples > 0:

View File

@ -118,8 +118,8 @@ class LEAP_C(object):
process.nice(psutil.BELOW_NORMAL_PRIORITY_CLASS) # Windows process.nice(psutil.BELOW_NORMAL_PRIORITY_CLASS) # Windows
process.nice() process.nice()
# See https://learn.microsoft.com/en-us/windows/win32/api/processthreadsapi/nf-processthreadsapi-getpriorityclass#return-value for values # See https://learn.microsoft.com/en-us/windows/win32/api/processthreadsapi/nf-processthreadsapi-getpriorityclass#return-value for values
min_cutoff = 0.9 min_cutoff = 0.1
beta = 5.0 beta = 10.0
# print(np.random.rand(22, 2)) # print(np.random.rand(22, 2))
# noisy_point = np.array([1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1]) # noisy_point = np.array([1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1])
self.one_euro_filter = OneEuroFilter( self.one_euro_filter = OneEuroFilter(

View File

@ -235,7 +235,6 @@ def RANSAC3D(self, hsrac_en):
ransac_xy_offset, ransac_xy_offset,
) = get_center_noclamp((self.rawx, self.rawy), self.radius) ) = get_center_noclamp((self.rawx, self.rawy), self.radius)
print(self.current_image_gray_clean.size, ransac_lower_x, ransac_upper_y)
frame = safe_crop( frame = safe_crop(
self.current_image_gray_clean, self.current_image_gray_clean,
int(ransac_lower_x), int(ransac_lower_x),