Skip to main content
Código formatado
Fonte Link
JeanExtreme002
  • 6,3mil
  • 3
  • 26
  • 63
  1. item

import cv2 from os import listdir, path imagem = cv2.imread("lampada.png") cv2.imshow("Original", imagem)

print "Altura (height): %d pixels" % (imagem.shape[0]) print "Largura (width): %d pixels" % (imagem.shape[1]) print "Canais (channels): %d" % (imagem.shape[2])

cv2.waitKey(0)

import cv2
from os import listdir, path
imagem = cv2.imread("lampada.png")
cv2.imshow("Original", imagem)

print "Altura (height): %d pixels" % (imagem.shape[0])
print "Largura (width): %d pixels" % (imagem.shape[1])
print "Canais (channels): %d"      % (imagem.shape[2])
    
cv2.waitKey(0)

ou

  1. item

########################

Open a file

path = "/var/www/html/" dirs = os.listdir( path )

This would print all the files and directories

for file in dirs: print file

########################
# Open a file
path = "/var/www/html/"
dirs = os.listdir( path )

# This would print all the files and directories
for file in dirs:
   print file
  1. item

import cv2 from os import listdir, path imagem = cv2.imread("lampada.png") cv2.imshow("Original", imagem)

print "Altura (height): %d pixels" % (imagem.shape[0]) print "Largura (width): %d pixels" % (imagem.shape[1]) print "Canais (channels): %d" % (imagem.shape[2])

cv2.waitKey(0)

ou

  1. item

########################

Open a file

path = "/var/www/html/" dirs = os.listdir( path )

This would print all the files and directories

for file in dirs: print file

  1. item
import cv2
from os import listdir, path
imagem = cv2.imread("lampada.png")
cv2.imshow("Original", imagem)

print "Altura (height): %d pixels" % (imagem.shape[0])
print "Largura (width): %d pixels" % (imagem.shape[1])
print "Canais (channels): %d"      % (imagem.shape[2])
    
cv2.waitKey(0)

ou

  1. item
########################
# Open a file
path = "/var/www/html/"
dirs = os.listdir( path )

# This would print all the files and directories
for file in dirs:
   print file
Fonte Link

  1. item

import cv2 from os import listdir, path imagem = cv2.imread("lampada.png") cv2.imshow("Original", imagem)

print "Altura (height): %d pixels" % (imagem.shape[0]) print "Largura (width): %d pixels" % (imagem.shape[1]) print "Canais (channels): %d" % (imagem.shape[2])

cv2.waitKey(0)

ou

  1. item

########################

Open a file

path = "/var/www/html/" dirs = os.listdir( path )

This would print all the files and directories

for file in dirs: print file