Kayıtlar

python görüntü işleme etiketine sahip yayınlar gösteriliyor

Python'da Görüntü İşleme - Resmi Siyah Beyaz Yapma

Resim
# Derleyici JUPYTER -> ANACONDA 3 - Python 3 # online geliştirme yapabileceğiniz bir ortam # Kodun  arasında  boşluk varsa bu derleyici ayrı bir kutuda yazılmış anlamına gelir.  #  Buna dikkat   edelim import  matplotlib.pyplot  as  plt import  numpy  as  np from scipy.misc import imsave def convertRGB_to_GrayLevel(image_1) :     img_1=plt.imread(image_1)     img_2=np.zeros((img_1.shape[0],img_1.shape[1]))     for i in range(img_1.shape[0]):         for j in range(img_2.shape[1]):             img_2[i,j]=img_1[i,j,0]/3+img_1[i,j,1]/3+img_1[i,j,2]/3      imsave(image_1+ "_gray.jpeg" ,img_2)     plt.subplot(1,2,1)     plt.imshow(img_1)     plt.subplot(1,2,2)     plt.imshow(img_2,cmap= 'gray' )     plt.show() convertRGB_to_GrayLevel( 'widenYourWorld.jpeg'...

Python'da Görüntü İşleme: Resmi içten çember ile çevirme kodu

Resim
import math #Distance - Mesafe bulma def findDistance (x,y):     return math.sqrt((x[ 0 ]-y[ 0 ]) ** 2+(x[1]-y[1]) ** 2) d=findDistance([3, 0 ],[ 0 ,4]) from scipy import ndimage from scipy import misc f=misc.face() import matplotlib.pyplot as plt plt.imshow(f) plt.show() f.ndim f.shape type(f) #Renk değiştirme f[:,:,2]= 0 #Rakunu gösterme plt.imshow(f) plt.show() f.shape type (f.shape) im_size=f.shape im_size[ 0 ] center=[im_size[ 0 ] / 2,im_size[1] / 2] from  scipy  import  ndimage from  scipy  import  misc f=misc.face() #Resmin sınırının içine çember çizip resim ile çember arasındaki RGB değerleri 0 yapma for i in range(im_size[ 0 ]):      for  j  in  range(im_size[1]):         if findDistance([i,j],center)>384:             f[i,j,:]= 0 plt.imshow(f) plt.show() Kaynakça: https://do...