本文整理汇总了Python中SimpleCV.Image.transpose方法的典型用法代码示例。如果您正苦于以下问题:Python Image.transpose方法的具体用法?Python Image.transpose怎么用?Python Image.transpose使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类SimpleCV.Image
的用法示例。
在下文中一共展示了Image.transpose方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: Image
# 需要导入模块: from SimpleCV import Image [as 别名]
# 或者: from SimpleCV.Image import transpose [as 别名]
#!/usr/bin/python
from SimpleCV import Camera, Display, Image
import numpy as np
import scipy.misc
img = Image("img4.png")
img = img.transpose()
(imgred, imggreen, imgblue) = img.splitChannels(False)
rhor = np.array([0.6650,0.7699,0.8573,0.4735,0.5482,0.6104,0.4339,0.5023,0.5593])
epsilon = 0.42
Edges = np.zeros((480,640))
x = [0,0,0,0,0,0,0,0]
for i in range (1,479):
for j in range (1,639):
[r1,g1,b1] = imgred.getPixel(i-1,j)
[r2,g2,b2] = imgred.getPixel(i+1,j)
[r3,g3,b3] = imggreen.getPixel(i-1,j)
[r4,g4,b4] = imggreen.getPixel(i+1,j)
[r5,g5,b5] = imgblue.getPixel(i-1,j)
[r6,g6,b6] = imgblue.getPixel(i+1,j)
kappahoriz1 = np.array([r1/r2,r1/g4,r1/b6,g3/r2,g3/g4,g3/b6,b5/r2,b5/g4,b5/b6])
kappahoriz2 = np.array([r2/r1,r2/g3,r2/b5,g4/r1,g4/g3,g4/b5,b6/r1,b6/g3,b6/b5])
difhor1 = kappahoriz1 - rhor
difhor2 = kappahoriz2 - rhor
for k in range (0,7):
if difhor1[k] < 0: