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

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.

主站蜘蛛池模板: 郁南县| 乐业县| 绵阳市| 洛南县| 化州市| 慈溪市| 克拉玛依市| 海淀区| 略阳县| 平南县| 上栗县| 大兴区| 鲁山县| 西乌| 延津县| 永年县| 伊宁市| 博爱县| 确山县| 武隆县| 扎囊县| 甘德县| 钦州市| 淅川县| 侯马市| 鹤峰县| 太白县| 丘北县| 额尔古纳市| 景泰县| 深水埗区| 朝阳县| 高阳县| 永平县| 岑溪市| 土默特左旗| 泊头市| 石河子市| 房产| 明光市| 凉城县|