Learn Before
Concept
Slicing / Copying Portions of the Image
Using the idea that the data is stored inside a numpy array, we can splice the information from the array.
Given an img object, we can use:
sliced_img = img[500:700, 600:900] img[100:300, 650:950] = tag
It is important to pick a region that is the same size as what you copied.
Therefore, you can use this idea with a UI to select a region and get the right pixel values. Otherwise to slice/copy you need to know the exact pixel values ahead of time.
0
1
Updated 2021-06-22
Tags
Python Programming Language
Data Science