#5, First Floor, 4th Street , Dr. Subbarayan Nagar Kodambakkam, Chennai-600 024 pro@slogix.in

Office Address

  • #5, First Floor, 4th Street Dr. Subbarayan Nagar Kodambakkam, Chennai-600 024 Landmark : Samiyar Madam
  • pro@slogix.in
  • +91- 81240 01111

Social List

How to do image processing using python scipy.ndimage?
Description

To know how to do image processing with scipy.ndimage in python.

Input:

Face Image of panda.

Output

Gray scale image.
Rotated image.

Process

  Import necessary library.

  Load image from misc.face() package.

  Convert gray scale image using arguments.

  Rotate the image using scipy.ndimage().

  Plot the final images.

Sapmle Code

from scipy import misc,ndimage
from matplotlib import pyplot as plt
import numpy as np

#get face image of panda from misc package
image = misc.face()

#plot or show image of face
print(“Original image”)
plt.imshow(image)
plt.show()

#gray scale image
print(“Gray scale image”)
image1 = misc.face(gray = True)
#plot or show image of face
plt.imshow(image1)
plt.show()

#rotating image
print(“Rotated image”)
image_rotate = ndimage.rotate(image, 35)
plt.imshow(image_rotate)
plt.show()

Screenshots