S
S
sswwssww2019-11-14 15:26:55
Python
sswwssww, 2019-11-14 15:26:55

How to cut an image into specific pieces?

There is an image: 5dcd4625baa03265637591.png
You need to cut it like this:
5dcd480698543299923459.png

Answer the question

In order to leave comments, you need to log in

1 answer(s)
V
Vladimir Kuts, 2019-11-14
@sswwssww

import os
import glob
%matplotlib inline
from skimage.measure import compare_ssim
import imutils
import cv2
from PIL import Image
import matplotlib.pyplot as plt

FILE = os.path.join('./', '5dcd4625baa03265637591.png')

imageA = cv2.imread(FILE)


fig, axs = plt.subplots(nrows=10, ncols=1, figsize=(30, 10))
img1 = imageA[60:100]
axs[0].imshow(img1)

step = 60
curr = 100

for i in range(1,10):
    img = imageA[curr:curr + step]
    axs[i].imshow(img)
    curr += step

5dcd68e0cedf7339287156.png

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question