-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added new and fun filters :) filters.py: New sub-module with filters represented as Callables __main__.py: Added filter button UI
- Loading branch information
1 parent
d063965
commit 31c39a6
Showing
2 changed files
with
111 additions
and
3 deletions.
There are no files selected for viewing
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
import cv2 | ||
import numpy as np | ||
# from typing import Tuple, Dict, TypeVar, List, Callable, Union | ||
|
||
# setting = TypeVar('setting', str, int, float, bool, List[int]) | ||
|
||
############################################################################### | ||
# IMAGE FILTERS | ||
############################################################################### | ||
|
||
|
||
def times1000(img: np.ndarray) -> np.ndarray: | ||
return (img * 1000).astype(np.uint8) | ||
|
||
|
||
def times2000(img: np.ndarray) -> np.ndarray: | ||
return (img * 10000).astype(np.uint8) | ||
|
||
|
||
def grayscale(img: np.ndarray) -> np.ndarray: | ||
return np.stack((cv2.cvtColor(img, cv2.COLOR_BGR2GRAY), ) * 3, axis=-1) | ||
|
||
############################################################################### | ||
# VIDEO FILTERS (WIP... since there is no video processing yet...) | ||
############################################################################### |