This file contains hidden or 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
| # defining Class | |
| class university: | |
| pass |
This file contains hidden or 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
| import cv2 | |
| import numpy as np | |
| image = cv2.imread('image.png') | |
| # Store height and width of the image | |
| height, width = image.shape[:2] | |
| quarter_height = height / 4 | |
| quarter_width = width / 4 |
This file contains hidden or 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
| import cv2 | |
| #to read the image | |
| img = cv2.imread("image.png") | |
| #Saving the image | |
| cv2.imwrite("new.jpg", img) | |
This file contains hidden or 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
| import cv2 | |
| #to read the image | |
| img = cv2.imread("image.png") | |
| #Saving the image | |
| cv2.imwrite("new.jpg", img) | |
This file contains hidden or 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
| import cv2 | |
| #reading the image | |
| img = cv2.imread('image.png') | |
| #displaying image | |
| cv2.imshow('image', img) | |
| #wait and destroy | |
| cv2.waitKey(0) | |
| cv2.destoryAllWindows() |
This file contains hidden or 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
| import cv2 | |
| #reading image | |
| img=imread("image.png") |
This file contains hidden or 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
| import numpy as np | |
| import cv2 | |
| # Open the image. | |
| img = cv2.imread('damaged.png') | |
| # Load the mask. | |
| mask = cv2.imread('mask.png', 0) | |
| # Inpaint. |
This file contains hidden or 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
| import cv2 | |
| import numpy as np | |
| image1 = cv2.imread('image.png') | |
| # cv2.cvtColor is applied over the | |
| # image input with applied parameters | |
| # to convert the image in grayscale | |
| img = cv2.cvtColor(image1, cv2.COLOR_BGR2GRAY) | |
This file contains hidden or 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
| import cv2 | |
| import numpy as np | |
| # Read image from disk. | |
| img = cv2.imread('cat.png') | |
| # Canny edge detection. | |
| edges = cv2.Canny(img, 100, 200) | |
| # Write image back to disk. |
This file contains hidden or 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
| import cv2 | |
| image = cv2.imread('python.png') | |
| window_name = 'Image' | |
| # Using cv2.copyMakeBorder() method | |
| image = cv2.copyMakeBorder(image, 10, 10, 10, 10, cv2.BORDER_CONSTANT) | |
| cv2.imshow(window_name, image) |