Transpozesini almak,Negatifini almak vs.

import matplotlib.pyplot as plt
      import matplotlib.image as mpimg
      import numpy as np

      img=mpimg.imread(r'C:\Users\a\Desktop\howl2.jpg')
      img.ndim
        Out [1] :  3

      img.shape
      plt.imshow(img)
      plt.show()
       img[:100,:].max()
       plt.imshow(img)
       plt.show()
       img_1=img[1:375:2,:,:]
       plt.imshow(img_1)
       plt.show()



        img_2=img[:,1:500:2,:]
        plt.imshow(img_2)
        plt.show()











       plt.subplot(1,3,1),plt.imshow(img)    #üç resim de görüntülenir
       plt.subplot(1,3,2),plt.imshow(img_1)
       plt.subplot(1,3,3),plt.imshow(img_2)
       plt.show()
  img.ndim,img.shape
       Out[2] : (3, (540, 960, 3))

  img_20=np.zeros((500,375,3))
  img_20.shape
    Out[3] : (500, 375, 3)

 img_20.ndim,img_20.shape
 Out[4] : (3, (500, 375, 3))

     for i in range(375):
           for j in range(500):
                img_20[j,i,:]=img[i,j,:]

      img_30=np.zeros((500,375,3))
       img_30.shape
       for i in range(375):
             for j in range(500):
               img_30[j,i,:]=1-img[i,j,:]              #resmin negatifini aldık

      plt.subplot(1,3,1),plt.imshow(img)              #üç resim de görüntülenir
       plt.subplot(1,3,2),plt.imshow(img_20)
       plt.subplot(1,3,3),plt.imshow(img_30)
       plt.show()
          
       plt.subplot(2,3,1),plt.imshow(img)       #4 resim de görüntülenir
       plt.subplot(2,3,2),plt.imshow(img_20)
       plt.subplot(2,3,3),plt.imshow(img_30)
       plt.subplot(2,3,4),plt.imshow(img_30)
       plt.show()

      img_40=np.zeros((375,500,3))
      img_40.shape
         for i in range(375):
             for j in range(500):
                img_40[375-i-1,500-j-1,:]=1-img[i,j,:]

      img_50=np.zeros((375,500,3))
      img_50.shape
        for i in range(375):
            for j in range(500):
                img_40[375-i-1,j,:]=1-img[i,j,:]

       plt.subplot(2,3,1),plt.imshow(img)      #5 resim de görüntülenir
       plt.subplot(2,3,2),plt.imshow(img_20)
       plt.subplot(2,3,3),plt.imshow(img_30)
       plt.subplot(2,3,4),plt.imshow(img_40)
       plt.subplot(2,3,5),plt.imshow(img_50)
       plt.show()
 

Yorumlar

Bu blogdaki popüler yayınlar

Python ile Görüntü İşleme Örnekleri

Git Nedir? - What is Git?

İlişkisel Veritabanı Modeli