-
Notifications
You must be signed in to change notification settings - Fork 3
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Function that determines the contrast ratio, max and min brightness #156
base: master
Are you sure you want to change the base?
Conversation
…ghtness the function is to determine the maximum and minimum brightness values of pixels of different colors and, thanks to them, calculate the contrast ratio using the formula approved by WCAG Conclusion: brightness and contrast values
@@ -428,3 +428,25 @@ def find_regexp_text(recognized_list: list, pattern): | |||
if len(match) > 0: | |||
result.append((roi, content, tuple(match))) | |||
return list(set(result)) | |||
|
|||
|
|||
def br_determinant(img): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
image_path
maximum brightness and contrast values on the image itself | ||
|
||
Args: | ||
img (str): image that is converted from the BGR color space to YUV |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
create an Image type from Pillow
@@ -428,3 +428,25 @@ def find_regexp_text(recognized_list: list, pattern): | |||
if len(match) > 0: | |||
result.append((roi, content, tuple(match))) | |||
return list(set(result)) | |||
|
|||
|
|||
def br_determinant(img): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
change name 2 constarst
The function is to determine the maximum and minimum brightness values of pixels of different colors and, thanks to them, calculate the contrast ratio using the formula approved by WCAG
Conclusion: brightness and contrast values