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 :: how to create a virtual environment in python 
Python :: connect mongodb with python 
Python :: pygame collisions 
Python :: how to get the index of the first integer in a string python 
Python :: django signals post_save not working 
Python :: extract all capital words dataframe 
Python :: reverse function python 
Python :: which function to use in random module for a list in python 
Python :: django run management command from code 
Python :: selenium python find element by class name with space 
Python :: functions python examples 
Python :: how to host python flask web application 
Python :: pytorch calculate mse mae 
Python :: django model get field verbose name 
Python :: python ctypes maximize window 
Python :: seaborrn set figsize 
Python :: python how to draw a circle 
Python :: train dev test split sklearn 
Python :: pandas dataframe display cell size 
Python :: python import file from different directory 
Python :: python reverse list 
Python :: jointplot title 
Python :: creating a bar plot bar | creating a bar chart 
Python :: make venv 
Python :: how to make string bold in python 
Python :: swap two columns python 
Python :: remove element from list by index 
Python :: django filter by category 
Python :: raw input py 
Python :: python backslash in string 
ADD CONTENT
Topic
Content
Source link
Name
5+9 =