官术网_书友最值得收藏!

Introduction

If you've ever seen a "behind-the-scenes" video of your favorite Hollywood movie, you might have noticed that some of the animated scenes are shot in front of a green screen. Then, during editing, the green screen is replaced with a mind-blowing futuristic vista or a dystopian scene that's beyond your wildest imagination.

Now, think of one single frame from that scene in the movie. The original frame was shot in front of a green background. Then, the image was modified to obtain a particular result, that is, a different background.

Furthermore, sometimes, you want to process an image to directly obtain the result you seek so that you can receive an intermediate result that will make further steps easier and achievable. The following is a sample picture that was taken in front of the green screen:

Figure 2.1: A picture taken in front of a green screen

Figure 2.1: A picture taken in front of a green screen

This activity of modifying or processing an image to obtain a particular result is known as image processing.

In the previous chapter, we went over the basics of images – what pixels are, what pixel coordinates are, how to extract pixel values using pixel coordinates, and more. We'll start this chapter by understanding what we mean by image processing and why we need it. By the end of this chapter, you will be able to process images such as the one shown previously and replace the green screen with a background of your choice using a very basic image processing technique referred to as masking.

This chapter can be broken down into two major parts. First, we will focus on basic techniques, such as translation, rotation, resizing, and cropping, and a more general geometric transformation called affine transformation. We will end the section by looking at perspective transformation. Then, we will discuss binary images and arithmetic operations that we can carry out on images. We will also talk about masking in this section.

Both sections will be accompanied by exercises and activities that you can try to complete. Now, let's start with the first section of this chapter – Geometric Transformations.

主站蜘蛛池模板: 东乌珠穆沁旗| 南昌市| 北京市| 石家庄市| 定边县| 太康县| 库伦旗| 巴塘县| 安庆市| 巴青县| 江陵县| 金川县| 石家庄市| 杭州市| 新蔡县| 鹤山市| 邯郸县| 临泉县| 罗平县| 乐亭县| 游戏| 乌海市| 巴彦县| 辽阳县| 大石桥市| 东平县| 饶阳县| 白银市| 措勤县| 广东省| 浙江省| 曲水县| 磐石市| 息烽县| 东乌珠穆沁旗| 西宁市| 海门市| 中江县| 彩票| 电白县| 阿克|