Search
 
SCRIPT & CODE EXAMPLE
 

PYTHON

gaussian filter

import PIL
from pathlib import Path
from PIL import UnidentifiedImageError

path = Path("INSERT PATH HERE").rglob("*.jpeg")
for img_p in path:
    try:
        img = PIL.Image.open(img_p)
    except PIL.UnidentifiedImageError:
            print(img_p)
Comment

python gaussian filter

>>> from scipy import misc
>>> import matplotlib.pyplot as plt
>>> fig = plt.figure()
>>> plt.gray()  # show the filtered result in grayscale
>>> ax1 = fig.add_subplot(121)  # left side
>>> ax2 = fig.add_subplot(122)  # right side
>>> ascent = misc.ascent()
>>> result = gaussian_filter(ascent, sigma=5)
>>> ax1.imshow(ascent)
>>> ax2.imshow(result)
>>> plt.show()
Comment

gaussian filter

import numpy as np
import cv2
from matplotlib import pyplot as plt
from PIL import Image, ImageFilter
%matplotlib inline
image = cv2.imread('image.png') 
image = cv2.cvtColor(image, cv2.COLOR_BGR2HSV) 
figure_size = 9
new_image = cv2.GaussianBlur(image, (figure_size, figure_size),0)
plt.figure(figsize=(11,6))
plt.subplot(121), plt.imshow(cv2.cvtColor(image, cv2.COLOR_HSV2RGB)),plt.title('Original')
plt.xticks([]), plt.yticks([])
plt.subplot(122), plt.imshow(cv2.cvtColor(new_image, cv2.COLOR_HSV2RGB)),plt.title('Gaussian Filter')
plt.xticks([]), plt.yticks([])
plt.show()
Comment

PREVIOUS NEXT
Code Example
Python :: join tuple to string python 
Python :: filter directory in python 
Python :: how to add a column with more rows to a dataframe 
Python :: queue in python 
Python :: method get first last name python 
Python :: replace nan 
Python :: python script that turns bluetooth on 
Python :: super title python 
Python :: django model query join 
Python :: get first letter of each word in string python 
Python :: pyqt set focus 
Python :: convert python list to pyspark column 
Python :: sqlite3.ProgrammingError: Incorrect number of bindings supplied. The current statement uses 1, and there are 7 supplied. 
Python :: Detect Word Then Send Message (discord.py) 
Python :: how to use coordinates in python 
Python :: how to get more than one longest string in a list python 
Python :: defaultdict python dict inside dict 
Python :: move object towards coordinate slowly pygame 
Python :: cropping image google colab 
Python :: how to use sin inverse and cos inverse in python 
Python :: convert int to string python 
Python :: discord.py read custom status 
Python :: save and load model during training pytorch 
Python :: radix sort strings python 
Python :: python time 
Python :: check if key exists in sesison python 
Python :: Python NumPy asarray Function Syntax 
Python :: how to use information from env variables in python 
Python :: Python get first element from list 
Python :: what is iteration in python 
ADD CONTENT
Topic
Content
Source link
Name
1+1 =