Friday 12 February 2016

Bare Minimum Basics - Image Processing with Python

In [1]:
from matplotlib.image import imread
from matplotlib import pyplot as plt
import numpy as np
import pylab

def show_img(img):
 width = img.shape[1]/75.0
 height = img.shape[0]*width/img.shape[1]
 f = plt.figure(figsize=(width, height))
 plt.imshow(img)
 plt.show()
#    
image = imread("dna.jpeg")
show_img(image)
#
from skimage import data, io, filter
#
image1 = data.coins() # or any NumPy array!
edges = filter.sobel(image1)
io.imshow(edges)
show_img(image1)
show_img(edges)
#
In [ ]:

No comments:

Post a Comment