Created
September 12, 2018 07:38
-
-
Save codingforpleasure/4cb308e7804b83c263d828ba6c34c2c5 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
# here is my python code: | |
gray = cv2.cvtColor(img, cv2.COLOR_BGR2GRAY) | |
gray = cv2.bitwise_not(gray) | |
top = int(0.25 * gray.shape[0]) | |
bottom = int(0.25 * gray.shape[0]) | |
left = int(0.25 * gray.shape[1]) | |
right = int(0.25 * gray.shape[1]) | |
gray = cv2.copyMakeBorder(gray, top, bottom, left, right, cv2.BORDER_CONSTANT, value=255) | |
kernel = cv2.getStructuringElement(cv2.MORPH_RECT, (2 * 5 + 1, 2 * 5 + 1), (5, 5)) | |
res = cv2.dilate(gray, kernel) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment