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

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.

主站蜘蛛池模板: 古丈县| 灌南县| 隆昌县| 皋兰县| 英山县| 淄博市| 乌拉特后旗| 关岭| 滨州市| 彰武县| 大方县| 嘉荫县| 龙口市| 绥宁县| 自治县| 蒙城县| 绥德县| 突泉县| 永修县| 新源县| 达拉特旗| 长葛市| 贵阳市| 马公市| 连南| 徐汇区| 太和县| 景泰县| 清原| 体育| 桦南县| 内丘县| 临江市| 大厂| 永昌县| 平塘县| 班戈县| 荔波县| 长沙县| 南乐县| 阜平县|