Created
February 29, 2020 17:40
-
-
Save Vadbeg/a6a0faadfe70ebdafb24941b0ae4c18b to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def create_blank_image(height, width, rgb_color=(0, 0, 255)): | |
""" | |
Creates np.array, each channel of which is filled with value from rgb_color | |
Was stolen from: | |
:source: https://stackoverflow.com/questions/4337902/how-to-fill-opencv-image-with-one-solid-color | |
""" | |
image = np.zeros((height, width, 3), np.uint8) | |
color = tuple(reversed(rgb_color)) | |
image[:] = color | |
return image |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment