当前位置: 首页>>代码示例>>Python>>正文


Python Image.splitChannels方法代码示例

本文整理汇总了Python中SimpleCV.Image.splitChannels方法的典型用法代码示例。如果您正苦于以下问题:Python Image.splitChannels方法的具体用法?Python Image.splitChannels怎么用?Python Image.splitChannels使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在SimpleCV.Image的用法示例。


在下文中一共展示了Image.splitChannels方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: Image

# 需要导入模块: from SimpleCV import Image [as 别名]
# 或者: from SimpleCV.Image import splitChannels [as 别名]
#! /usr/bin/env python
from SimpleCV import Camera, Display, Image
import time
import matplotlib.pyplot as plt
import cv2
import numpy as np


img= Image('/home/pi/Documents/Lab3/foto4.png')
(r,g,b)=img.splitChannels(False)

r.save('/home/pi/Documents/Lab3/red4.png')
g.save('/home/pi/Documents/Lab3/green4.png')
b.save('/home/pi/Documents/Lab3/blue4.png')


#b,g,r=cv2.split(img)
#img=cv2.merge((b,g,r))
开发者ID:Nano1993,项目名称:Lab3,代码行数:20,代码来源:RGB.py

示例2: Camera

# 需要导入模块: from SimpleCV import Image [as 别名]
# 或者: from SimpleCV.Image import splitChannels [as 别名]
import matplotlib.pyplot as plt
#cam = Camera()
#asdf=cam.getImage()
#time.sleep(10)
#prueba=cam.getImage()
#prueba.save("prueba1.jpg")
prueba=Image("prueba1.jpg")
escalagris=prueba.grayscale()
escalagris.save("gray.jpg")
histograma=escalagris.histogram(255)
plt.subplot(4,1,1)
plt.plot(histograma)
plt.grid()
plt.title("Histograma Grayscale cuadriculado")
#una vez echo el filtro en gris se procede a hacerlo en RGB(RED GREEn BLUE)
(red,green,blue)=prueba.splitChannels(False)
red_histogram=red.histogram(255)
plt.subplot(4,1,2)
plt.plot(red_histogram)
plt.grid()
plt.title("Histograma red")
green_histogram=green.histogram(255)
plt.subplot(4,1,3)
plt.plot(green_histogram)
plt.grid()
plt.title("Histograma green")
blue_histogram=blue.histogram(255)
plt.subplot(4,1,4)
plt.plot(blue_histogram)
plt.grid()
plt.title("Histograma blue")
开发者ID:yavier123,项目名称:labpdi2,代码行数:33,代码来源:pdilab22.py

示例3:

# 需要导入模块: from SimpleCV import Image [as 别名]
# 或者: from SimpleCV.Image import splitChannels [as 别名]



#imagen en escala de grises
imgGray=img.grayscale()
imgGray.save("grayLab2.png")
hist=imgGray.histogram(255)

plt.figure(1)
plt.plot(hist)
plt.savefig("histogray.png")


#imagen en escala RGB
(red,green,blue)=img.splitChannels(False)

#Histograma imagen RGB
red_histogram=red.histogram(255)
plt.figure(2)
plt.plot(red_histogram)
plt.savefig("histogred.png")

green_histogram=green.histogram(255)
plt.figure(3)
plt.plot(green_histogram)
plt.savefig("histogreen.png")

blue_histogram=blue.histogram(255)
plt.figure(4)
plt.plot(blue_histogram)
开发者ID:franmir,项目名称:lab3-PDI,代码行数:32,代码来源:Bordes.py

示例4: histograma

# 需要导入模块: from SimpleCV import Image [as 别名]
# 或者: from SimpleCV.Image import splitChannels [as 别名]
imgGray=a.grayscale()
#imgGray.save("hola42AGray.png")
#a.save("holaA42.png")

def histograma(hist):
    
    hist=hist.histogram(255)
##    hist.save("hola4Hist.txt")
    pylab.plot(hist)
    pylab.draw()
    pylab.pause(0.0001)


b=histograma(imgGray)

(R,G,B)=a.splitChannels(False)
##B.show()
##b=histograma(G)


def histogramac(histc):
    
    histc=histc.histogram(255)
    B.show()
    pylab.plot(histc)
    pylab.draw()
    pylab.pause(0.0001)

##b=histogramac(B)

### ACTIVIDAD 2
开发者ID:Wenarepo,项目名称:HOLArepo,代码行数:33,代码来源:cosa6.py

示例5: Image

# 需要导入模块: from SimpleCV import Image [as 别名]
# 或者: from SimpleCV.Image import splitChannels [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:
开发者ID:Grupopdicyf,项目名称:PDI_2016,代码行数:33,代码来源:src_algorithm_final_test.py

示例6: Image

# 需要导入模块: from SimpleCV import Image [as 别名]
# 或者: from SimpleCV.Image import splitChannels [as 别名]
__author__ = 'Sam'



from SimpleCV import Image, Color

eye = Image('eye.tif')

(empty, eye_green, emptier) = eye.splitChannels(False)

eye_green = eye_green * 2.5
eye_gray = eye_green.grayscale()

eye_gray = eye_gray.smooth()


#Canny edge detection algorithm. t1 specifies the threshold value to begin an edge. t2 specifies the strength required
#build an edge off of a point found by T2.
eye_edges = eye_gray.edges(t1 = 70, t2=35)


edge_test = eye_gray + eye_edges


eye_final = eye_edges

#Perform closing to find individual objects
eye_final = eye_final.dilate(2)
eye_final = eye_final.erode()

eye_final = eye_final.dilate(4)
开发者ID:SamViesselman,项目名称:SeniorDesignComputerVision,代码行数:33,代码来源:Image+Processing.py

示例7: Camera

# 需要导入模块: from SimpleCV import Image [as 别名]
# 或者: from SimpleCV.Image import splitChannels [as 别名]
#! /usr/bin/python
from SimpleCV import Image, Camera, Color #nueva libreria color para los comandos de color
#cam = Camera()
#img = cam.getImage()
#img.save("lunar1.jpg")
pruebalunar=Image("lunar6nico.png") #nombre de lka imagen que quieres cargar
lunargris=pruebalunar.grayscale()
lunargris.save("fotoslunarprurba.png")
(red,green,blue)=pruebalunar.splitChannels(False) # la separo en RGB
red.save("fotoenrojo.png")
green.save("fotoenverde.png")
blue.save("fotoenazul.png")

#codigo para encontrarn manchas solo se a echo en escala de grises  
prueba69=green.binarize() #la binarizo por que se vera mejor asi 
mancha=prueba69.findBlobs() #ocupo el comando para encontrar lasmanchas (lunares)
mancha.show(Color.YELLOW)
prueba69.save("porfavorguardate3.png")


invertidos=green.invert()#se invierte la imagen para obtener manchas negras en la foto
blob=invertidos.findBlobs()#se ve si se encuentrasn las mannchas en la foto invertida
blob.show(width=2)
pruebalunar.addDrawingLayer(invertidos.dl())
pruebalunar.show()
pruebalunar.save("porfavorguardate2.png") #guardamos la imagen 


#enncontrar manchas por color especifico para el cual tenemos:
brown_distance=green.colorDistance(Color.BLACK).invert()##cmo buscamos de color negro , le pknemos black 
blobs2_=brown_distance.findBlobs()
开发者ID:yavier123,项目名称:lab3pdi2016,代码行数:33,代码来源:fotoslunar.py


注:本文中的SimpleCV.Image.splitChannels方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。