added filtering and masking to finger detection