diff --git a/project/minimal_examples/apply_filters.py b/project/minimal_examples/apply_filters.py index 859f9c84f06fb55fac68f20f109b9f8fcf24c401..383358b42e6828df956ec5b1bc87f0a9b085b36f 100644 --- a/project/minimal_examples/apply_filters.py +++ b/project/minimal_examples/apply_filters.py @@ -8,18 +8,19 @@ from skimage.io import imread from skimage.filters import sobel # Read image from file -image = imread("../figures/examples_from_dataset/banana.jpg", as_gray=False) +image = cv2.imread("../figures/examples_from_dataset/banana.jpg") +#image = imread("../figures/examples_from_dataset/banana.jpg", as_gray=False) # Alternative way to read image # Resizing image to 50x50 image_resized = cv2.resize(image, (50, 50)) cv2.imwrite('../figures/examples_from_dataset/banana-resized.jpg', image_resized) # Use Canny edge detection filter and save to file -edge_img = cv2.Canny(image, threshold1=50, threshold2=80) +edge_img = cv2.Canny(image, threshold1=150, threshold2=300) cv2.imwrite('../figures/examples_from_dataset/banana-edges.jpg', edge_img) # Use Canny edge detection filter for resized image and save to file -edge_img_resized = cv2.Canny(image_resized, threshold1=50, threshold2=80) +edge_img_resized = cv2.Canny(image_resized, threshold1=150, threshold2=300) cv2.imwrite('../figures/examples_from_dataset/banana-edges-resized.jpg', edge_img_resized) # Use sobel filter and save to file diff --git a/project/minimal_examples/extract_features.py b/project/minimal_examples/extract_features.py index 4ae554796f8a5d0944527822192b0e6344bc5ee6..a08a7f0f6913d472f99b293f515f3aab07d11bd6 100644 --- a/project/minimal_examples/extract_features.py +++ b/project/minimal_examples/extract_features.py @@ -12,6 +12,7 @@ from skimage.io import imread # Read image from file image = imread("../figures/examples_from_dataset/banana.jpg", as_gray=False) +# image = cv2.imread("../figures/examples_from_dataset/banana.jpg") # Alternative way to read image print("Shape of original image: ", image.shape) # Save features in file