वास्तविक दुनिया में उपयोग

Python में इमेज प्रोसेसिंग

Rebeca Gonzalez

Data engineer

उपयोग

  • किनारे/कोनों का पता लगाने से पहले ग्रेस्केल में बदलना
  • नॉइज़ घटाना और इमेज बहाल करना
  • डिटेक्ट किए चेहरों को ब्लर करना
  • ऑब्जेक्ट के आकार का अनुमान

Python में इमेज प्रोसेसिंग

गोपनीयता सुरक्षा

Python में इमेज प्रोसेसिंग

गोपनीयता सुरक्षा

# Import Cascade of classifiers and gaussian filter
from skimage.feature import Cascade

from skimage.filters import gaussian
Python में इमेज प्रोसेसिंग

गोपनीयता सुरक्षा

# Detect the faces
detected = detector.detect_multi_scale(img=image, 
                                       scale_factor=1.2, step_ratio=1, 
                                       min_size=(50, 50), max_size=(100, 100))

# For each detected face for d in detected: # Obtain the face cropped from detected coordinates face = getFace(d)
Python में इमेज प्रोसेसिंग

गोपनीयता सुरक्षा

def getFace(d):
    ''' Extracts the face rectangle from the image using the
    coordinates of the detected.'''
    # X and Y starting points of the face rectangle
    x, y  = d['r'], d['c']

# The width and height of the face rectangle width, height = d['r'] + d['width'], d['c'] + d['height']
# Extract the detected face face= image[x:width, y:height] return face
Python में इमेज प्रोसेसिंग

गोपनीयता सुरक्षा

# Detect the faces
detected = detector.detect_multi_scale(img=image, 
                                       scale_factor=1.2, step_ratio=1, 
                                       min_size=(50, 50), max_size=(100, 100))

# For each detected face for d in detected: # Obtain the face cropped from detected coordinates face = getFace(d)
# Apply gaussian filter to extracted face gaussian_face = gaussian(face, multichannel=True, sigma = 10)
# Merge this blurry face to our final image and show it resulting_image = mergeBlurryFace(image, gaussian_face)
Python में इमेज प्रोसेसिंग

गोपनीयता सुरक्षा

def mergeBlurryFace(original, gaussian_image):
    # X and Y starting points of the face rectangle
    x, y  = d['r'], d['c']
    # The width and height of the face rectangle
    width, height = d['r'] + d['width'],  d['c'] + d['height']

    original[ x:width, y:height] =  gaussian_image
    return original
Python में इमेज प्रोसेसिंग

गोपनीयता सुरक्षा

Python में इमेज प्रोसेसिंग

और भी उपयोग

Python में इमेज प्रोसेसिंग

अभ्यास करते हैं!

Python में इमेज प्रोसेसिंग

Preparing Video For Download...