text_plain_output_1.png
from skimage import data, color

from skimage import io

from skimage.transform import rescale, resize, downscale_local_mean

import cv2

import cv2

import imageio

import matplotlib.image as mpimg

import matplotlib.pyplot as plt

import matplotlib.pyplot as plt

import matplotlib.pyplot as plt

import os

import numpy as np
import pandas as pd
import os

from skimage import io
image = io.imread('../input/data-image/BurgosPuertaDeLaCoroneria/DPP_0245.JPG')

list = os.listdir('../input/data-image/BurgosPuertaDeLaCoroneria')

import matplotlib.image as mpimg
def process(filename):
    image = mpimg.imread('../input/data-image/BurgosPuertaDeLaCoroneria/' + filename)
for file in list:
    process(file)

import matplotlib.pyplot as plt
import cv2
from skimage import data, color
from skimage.transform import rescale, resize, downscale_local_mean

img = cv2.imread('../input/data-image/BurgosPuertaDeLaCoroneria/DPP_0247.JPG')
image = color.rgb2gray(img)

image_rescaled = rescale(image, 0.25, anti_aliasing=False)
image_resized = resize(image, (image.shape[0] // 4, image.shape[1] // 4),
                       anti_aliasing=True)
image_downscaled = downscale_local_mean(image, (4, 3))

fig, axes = plt.subplots(nrows=2, ncols=2)

ax = axes.ravel()

ax[0].imshow(image, cmap='gray')
ax[0].set_title("Original image")

ax[1].imshow(image_rescaled, cmap='gray')
ax[1].set_title("Rescaled image (aliasing)")

ax[2].imshow(image_resized, cmap='gray')
ax[2].set_title("Resized image (no aliasing)")

ax[3].imshow(image_downscaled, cmap='gray')
ax[3].set_title("Downscaled image (no aliasing)")

ax[0].set_xlim(0, 512)
ax[0].set_ylim(512, 0)
plt.tight_layout()
plt.show()

import cv2
import numpy as np
import matplotlib.pyplot as plt
import imageio
import imutils
cv2.ocl.setUseOpenCL(False)

trainImg = imageio.imread('../input/data-image/BurgosPuertaDeLaCoroneria/DPP_0247.JPG')
trainImg_gray = cv2.cvtColor(trainImg, cv2.COLOR_RGB2GRAY)
queryImg = imageio.imread('../input/data-image/BurgosPuertaDeLaCoroneria/DPP_0246.JPG')
queryImg_gray = cv2.cvtColor(queryImg, cv2.COLOR_RGB2GRAY)
fig, (ax1, ax2) = plt.subplots(nrows=1, ncols=2, constrained_layout=False, figsize=(16, 9))
ax1.imshow(queryImg, cmap='gray')
ax1.set_xlabel('Query image', fontsize=14)
ax2.imshow(trainImg, cmap='gray')
ax2.set_xlabel('Train image (Image to be transformed)', fontsize=14)
plt.show()