File:EmiMa-099-Prewitt-x-color.jpg
Summary
| Description |
English: Image "EmiMa-099" convolved with Prewitt-x operator in all 3 RGB color channels
Deutsch: EmiMa-099" wurde in allen dreien RGB-Farbkanälen mit dem Prewitt-x Operator gefaltet. |
| Date | |
| Source | Own work based on: EmiMa-099.jpg |
| Author | MartinThoma |
#!/usr/bin/env python
from PIL import Image
from scipy.ndimage import imread
from scipy.signal import convolve2d
import numpy as np
im = imread('EmiMa-099.jpg')
# Edge filter
weights = [[-1, -1, -1]], [0, 0, 0], [1, 1, 1]
im0 = convolve2d(im[:,:,0], weights, mode='same')
im1 = convolve2d(im[:,:,1], weights, mode='same')
im2 = convolve2d(im[:,:,2], weights, mode='same')
rgbArray = np.zeros((im0.shape[0], im0.shape[1], 3), 'uint8')
rgbArray[..., 0] = im0
rgbArray[..., 1] = im1
rgbArray[..., 2] = im2
img = Image.fromarray(rgbArray)
img.save('EmiMa-099-Prewitt-x-color.jpg')
Licensing
I, the copyright holder of this work, hereby publish it under the following license:
| This file is made available under the Creative Commons CC0 1.0 Universal Public Domain Dedication. | |
| The person who associated a work with this deed has dedicated the work to the public domain by waiving all of their rights to the work worldwide under copyright law, including all related and neighboring rights, to the extent allowed by law. You can copy, modify, distribute and perform the work, even for commercial purposes, all without asking permission.
|