SEAndroid, Algorithms, Numpy
Android N -> O 被自己的石頭砸到腳
對於晶片廠來說Android決解了軟體開發的問題, 也加速了ODM/OEM的開發時程.
沒錯…但對於手機/電視之外的應用..存在些問題.
另外差異化及客制帶來些不定時炸彈.
Sepolicy for Android Treble
使用numpy array修改pixel values.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#/usr/bin/env python | |
# Change R,G,B color and keep alpha values in PNG image file. | |
import Image | |
import numpy as np | |
# load image to np array | |
img_file = "test.png" | |
color_rgb = [59, 89, 152] | |
img = Image.open(img_file) | |
img_arry = np.array(img) | |
print(img_arry.shape) | |
# Change color RGB | |
img_arry[:,:,0:3] = color_rgb | |
# save image | |
img = Image.fromarray(img_arry) | |
img.save("output.png") |
網路資源
Machine Learning 101 - Jason Mayes