Creating composite images

If you got bored with all the science, now it's time for you to dive into the more fun part of image mixing. A very popular technique that is handled very efficiently by popular image processing suites is compositing two or more images, to make selected elements in them appear in the same scene simultaneously. When performed successfully, this technique can lead to beautiful artistic results, or even hilarious or odd scenes. But before getting to work on compositing, we should first get to know the tools we will be using in MATLAB.

Using imfuse to create a composite image

The most useful function you will use when it comes to compositing tasks is imfuse. This function takes two images as input and returns a fused version of these images as output. The function can also accept extra optional inputs, such as spatial referencing information for the two input images, fusion method selection, intensity scaling option, and output color channel for each of the two images. The main output will be the composite of the two input images. Having the composite image available as an output means we can also save it using the imwrite function presented in previous chapters.

Using imshowpair to inspect a composite image

Usually, before saving an image, we want to make proper adjustments or experimentations. Even more so, in the case of compositing, the mixing process normally needs a lot of tweaking in order to produce the desired result. The tweaking process can be performed using the imshowpair function, which has the same functionality as imfuse, only without producing an output image.

Let's start with a small, straightforward example of blending two images using the aforementioned functions. We will use two pictures of the same seagull, taken only a few seconds apart.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset