Understanding how images are represented
In order to understand what images are in terms of computer representation and the data they contain, we are going to start with some examples. The first thing to do is to organize your project to follow this chapter's code as follows:
- As before, inside your
geopy
project, make a copy of yourChapter5
folder and rename it toChapter6
. - Inside
Chapter6
, navigate to theexperiments
folder and create a new file inside it namedimage_experiments.py
. Open it for editing.
We will start by inspecting a small sample image that has a structure similar to a large satellite image.
Nothing fancy, you will see four squares of different colors. But if we take a step further and add a grid to it, we can see a little bit more information.
The image was divided into 16 squares of equal size. Each one of these squares is a so-called pixel. A pixel is the smallest portion of information that an image (that is, raster data) contains. While talking about geoprocessing...