本文整理汇总了Python中SimpleCV.Image.sideBySide方法的典型用法代码示例。如果您正苦于以下问题:Python Image.sideBySide方法的具体用法?Python Image.sideBySide怎么用?Python Image.sideBySide使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类SimpleCV.Image
的用法示例。
在下文中一共展示了Image.sideBySide方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: Image
# 需要导入模块: from SimpleCV import Image [as 别名]
# 或者: from SimpleCV.Image import sideBySide [as 别名]
from SimpleCV import Image
import time
img = Image('ladies.jpg')
# Dilate the image twice to fill in gaps
noPegs = img.dilate(2)
# Then erode the image twice to remove some noise
filled = noPegs.erode(2)
allThree = img.sideBySide(noPegs.sideBySide(filled))
allThree.scale(.5).show()
time.sleep(10)
示例2: elif
# 需要导入模块: from SimpleCV import Image [as 别名]
# 或者: from SimpleCV.Image import sideBySide [as 别名]
rhotemp2=calcrho(Btemp,Atemp)
if (np.linalg.norm(rho-rhotemp)<tol):
bor[j+1,i+1,:]=red
elif (np.linalg.norm(rho-rhotemp2)<tol):
bor[j+1,i+1,:]=red
imgbor=Image(bor) ## se transforma la matriz con el borde a una imagen
imgdet=img+imgbor ## se aplica el borde detectado a la imagen original
## Deteccion manual, findBlobs() sobre canal verde binarizado:
img2=img
(red, green, blue)=img.splitChannels(False) ## Separa los canales RGB de la imagen
##Comando Blobs con binarize en imagen aplicada con canal verde
imginvgreen1=green.binarize() ## se convierte imagen a blanco y negro
blobs1=imginvgreen1.findBlobs() ## se buscan los grupos de pixeles
blobs1.draw((200,0,0),width=3) ## se dibujan los grupos en la imagen binarizada
img2.addDrawingLayer(imginvgreen1.dl()) ## se dibujan en la imagen original
fot2=img2.show() ## se muestra por 5 segundos imagen con deteccion manual
time.sleep(5)
fot2.quit()
imgfinal2=img.sideBySide(imgbor.sideBySide(imgdet))## se junta a la imagen original(izq), con detector de borde(centro) e imagen con borde detectado (der).
fot3=imgfinal2.show() ## se muestra por 5 segundos dicha imagen
示例3: elif
# 需要导入模块: from SimpleCV import Image [as 别名]
# 或者: from SimpleCV.Image import sideBySide [as 别名]
bordesVd[i+1][j+1]=borde_rojo
elif (np.linalg.norm(rho-rhot2)<eps):
bordesVi[i+1][j+1]=borde_rojo
imborHs=Image(bordesHs)
imborHi=Image(bordesHi)
imborVd=Image(bordesVd)
imborVi=Image(bordesVi)
imbor=imborHs+imborHi+imborVd+imborVi
imbor.save('muestras/bordes.png')
imdet=imbor+res
imdet.sideBySide(imbor)
imdt = imdet.resize(640,480)
imnd=imagen.sideBySide(imdt)
imnd.show()
imnd.save('muestras/lunar_con_bordes.png')
###
matrix2= resu.getNumpy().astype(dtype='float64')
# borde horizontal
for i in range(0,filas-2):
for j in range(0,columnas-2):
At=matrix2[i][j+1] # pixel del lunar
Bt=matrix2[i+2][j+1] # pixel de la piel
rhot=Rho(At,Bt)
rhot2=Rho(Bt,At)
if (np.linalg.norm(rho-rhot)<eps2): #recorre la matriz en busca de bordes
示例4:
# 需要导入模块: from SimpleCV import Image [as 别名]
# 或者: from SimpleCV.Image import sideBySide [as 别名]
plt.stem(redhist);plt.title('Gray histogram');plt.axis('tight')
plt.subplot(222)
plt.stem(redhist);plt.title('Red histogram');plt.axis('tight')
plt.subplot(223)
plt.stem(greenhist);plt.title('Green histogram');plt.axis('tight')
plt.subplot(224)
plt.stem(bluehist);plt.title('Blue histogram');plt.axis('tight')
plt.savefig('fotos/histogramas.png')
red.save('fotos/lunar_en_rojo.png')
green.save('fotos/lunar_en_verde.png')
blue.save('fotos/lunar_en_azul.png')
imagen=Image("fotos/lunar01.png")
#imagen.show()
img_bin=imagen.sideBySide(imagen.binarize() )
img_bin.save('lunar_binario.png')
imgbin=imagen.binarize()
#sobel detector
imsobel= imgGray.sobel()
imsobel.show()
kuns=imgGray.invert().findBlobs()[-1]
mask=kuns.getFullMask()
mask.show()
# cani edges detector
imedge= imgGray.edges()
imedge.show()
示例5: Display
# 需要导入模块: from SimpleCV import Image [as 别名]
# 或者: from SimpleCV.Image import sideBySide [as 别名]
# http://www.youtube.com/watch?v=cAL6u6Q0Xuc
from SimpleCV import Image, Display
import time
#webcam-URLs
marktplatz = 'http://www.tuebingen.de/camera/webcam...'
marktgasse = 'http://leuchtengalerie.com/webcam/leu...'
neckarbruecke1 = 'http://www.tagblatt.de/cms_media/webc...'
neckarbruecke2 = 'http://tuebingen-info.de/fileadmin/we...'
display = Display((1240, 960))
counter = 0
while not display.isNotDone():
img1 = Image(marktplatz)
img1 = img1.adaptiveScale((640, 480))
img2 = Image(marktgasse)
img2 = img2.adaptiveScale((640, 480))
img3 = Image(neckarbruecke1)
img3 = img3.adaptiveScale((640, 480))
img4 = Image(neckarbruecke2)
img4 = img4.adaptiveScale((640, 480))
top = img1.sideBySide(img2)
bottom = img3.sideBySide(img4)
combined = top.sideBySide(bottom, side="bottom")
combined.save(display)
combined.save("webcam" +str(counter).zfill(4) +".jpg")
time.sleep(60)
counter = counter + 1
示例6: Display
# 需要导入模块: from SimpleCV import Image [as 别名]
# 或者: from SimpleCV.Image import sideBySide [as 别名]
from SimpleCV import Image, Display
disp = Display()
img = Image("C:\\Users\\Vijay\\Pictures\\aidan july 2010 pictures 012.jpg").resize(400, 500)
imgBin = img.binarize()
imgDilate = img.dilate(2)
imgErode = img.erode(2)
while disp.isNotDone():
img.sideBySide(imgBin).sideBySide(imgDilate).sideBySide(imgErode).scale(0.5).show()
示例7: print
# 需要导入模块: from SimpleCV import Image [as 别名]
# 或者: from SimpleCV.Image import sideBySide [as 别名]
print "window: {0}".format(window)
# how big of a signal we convolve
samplesz = window / 10
print "sample: {0}".format(samplesz)
dmap = np.zeros([img.width-window,img.height],dtype='int32')
integral = cv2.integral(img.getGrayNumpyCv2())
# we'll do this with iteration first to test
# proof of concept.
print (img.width,img.height)
# need to double check these bounds with the integral image
# really wish I could get rid of this iteration
for vidx in range(1,img.height-1): # for each row
print "row {0}".format(vidx)
for hidx in range(1,img.width-window-1): #for each pixel in the row
# get the sum of a horz chunk
sample = idxToSum(hidx,hidx+samplesz,vidx,integral)
# try and grok this, go thru a search window, calc the abs diff of sums
# between or sample and the test window, toss in a list
vals = [np.abs(sample-idxToSum(hidx+sidx,hidx+sidx+samplesz,vidx,integral)) for sidx in range((window/2)-samplesz,window-samplesz) ]
# find the minimum match
best = np.where(np.array(vals)==np.min(vals))[0]
# offset is the hidx of the current window
dmap[hidx][vidx] = best[-1] # if we get > 1 use the furthest one
# create the raw out
result = Image(dmap)
result.save('outputRAW.png')
# create the cleaned up output
result = result.medianFilter().equalize().invert().blur(window=(5,5))
result.save('outputEqualize.png')
sbs = img.sideBySide(result)
sbs.save('result.png')
示例8:
# 需要导入模块: from SimpleCV import Image [as 别名]
# 或者: from SimpleCV.Image import sideBySide [as 别名]
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()
blobs2_.draw(color=Color.PUCE ,width=3)#se va hacer el mismo ejemplo de la guia
brown_distance.show()
green.addDrawingLayer(brown_distance.dl())
green.show()
green.save("Porfavorguaradte5.png")
#lineas=pruebalunar.findLines()
#lineas.draw(width=3)
#pruebalunar.show()
circles=pruebalunar.findCircle(canny=100,thresh=350,distance=15)
circles=circles.sortArea()
circles.draw(width=4)
img_with_circles= pruebalunar.applyLayers()
edges_in_image= pruebalunar.edges(t2=200)
final=pruebalunar.sideBySide(edges_in_image.sideBySide(img_with_circles)).scale(0.5)
final.show()
final.save("porfavorguardate.png")
示例9: Image
# 需要导入模块: from SimpleCV import Image [as 别名]
# 或者: from SimpleCV.Image import sideBySide [as 别名]
from SimpleCV import Image
import time
img = Image('ladies.jpg')
# Using Otsu's method
otsu = img.binarize()
# Specify a low value
low = img.binarize(75)
# Specify a high value
high = img.binarize(125)
img = img.resize(int(img.width*.5), int(img.height*.5))
otsu = otsu.resize(int(otsu.width*.5), int(otsu.height*.5))
low = low.resize(int(low.width*.5), int(low.height*.5))
high = high.resize(int(high.width*.5), int(high.height*.5))
top = img.sideBySide(otsu)
bottom = low.sideBySide(high)
combined = top.sideBySide(bottom, side="bottom")
combined.show()
time.sleep(20)