👨‍💻 Блог Анатолия Гуляева

Image processing using NumPy and SciPy

script

little script written in python that sort an image array by column:

image_processing.py
import numpy as np
import scipy.misc

image = "/Users/username/image.jpg"

image_array = scipy.misc.imread(image)
a = np.sort(image_array, axis=0)

scipy.misc.imsave('outimage.jpg', a)

examples

Two images processed with my Python script. Left image is original. You can see japanese street on it. The right is the same image, but pixels are sorted by column.
Two images processed with my Python script. Left image is original. You can see anime girl on it. The right is the same image, but pixels are sorted by column.
Two images processed with my Pyhton script. Left image is original. You can see trees and lake in sunset on it. The right is the same image, but pixels are sorted by column.

Нашли ошибку? Выделите мышкой и нажмите Ctrl/⌘+Enter

Комментарии