automating image registration with matlab -凯发k8网页登录
by garima sharma and andy thé, mathworks
image registration is the process of aligning images from two or more data sets. it involves integrating the images to create a composite view, improving the signal-to-noise ratio, and extracting information that would be impossible to obtain from a single image. image registration is used in remote sensing, medical imaging, cartography, and other applications that rely on obtaining precise information from images—for example, discovering from satellite images how an area became flooded, or detecting tumors from mri scans.
determining an effective image registration approach is situation-dependent, and can be a complex and time-consuming process. it requires careful selection of a point transformation model to provide reference points between the images, and a method for comparing information to identify the parameters required to properly align the images.
there are two well-known approaches to the process of automatic image registration: feature-based and intensity-based registration algorithms. in this article we will use a fever-detection example to illustrate an intensity-based automatic image registration workflow based on imregister()
and related capabilities in image processing toolbox™. this workflow is a fast and effective way to integrate images from different cameras.
image registration glossary
reference (fixed) image: image in the target orientation, specified as a 2d or 3d grayscale image
target (moving) image: image to be transformed into alignment with the reference image, specified as a 2d or 3d grayscale image
intensity-based registration: the alignment of images based on their relative intensity patterns
feature-based registration: the alignment of images using feature detection, extraction, and matching
fever-detection example: goals and challenges
during the outbreak of severe acute respiratory syndrome (sars) in 2003, taiwan’s taoyuan international airport began screening passengers for fever symptoms to contain the spread of the deadly virus. since it was impossible to examine each passenger individually, clinicians used infrared thermography, a noninvasive technique for detecting fever by analyzing infrared images of thermal data.
while this approach is effective, it can be challenging to implement. infrared cameras are extremely sensitive to environmental conditions, and they must be correctly calibrated to account for all the elements that can affect the temperature reading—including ambient room temperature, relative humidity, reflective surfaces, and the distance of the subject from the camera. effective thermal screening also depends on consistent identification of a body part that can produce reliable thermal information—in our example, the area around the eyes.
we will build a screening thermography prototype using matlab®, a flir infrared (ir) camera, and a webcam. the ir camera can measure facial temperatures in increments of 100 millikelvins, while the webcam provides more detailed information on the facial features. by registering the images from both sources, we will be able to detect the location around the eyes from the webcam image (figure 1) and measure the temperature around the eyes from the ir camera image.
acquiring the images and calibrating the ir camera
using image acquisition toolbox™ we capture the images from the webcam and the ir camera and import them into the matlab workspace. the ir camera uses the gige vision® interface, while the webcam uses the standard directshow® interface.
to calibrate the ir camera we adjust for subject distance, humidity, emissivity (the relative power of a surface to emit heat by radiation), and other characteristics. during the image acquisition process, the atmospheric temperature was 295.15k and the emissivity of the wall and the subjects was 0.98.
visualizing the images
we view the ir image using the imshow()
function in image processing toolbox. because we have captured 16-bit data, in which the actual temperature readings were measured in 100 mk increments, we perform a contrast adjustment to scale the data before displaying the image on the monitor (figure 2).
we display the two images in the same figure window using imshowpair()
.
this function provides several visualization options, including 'falsecolor'
, for creating a composite rgb image using different color bands, and 'blend'
, for visualizing alpha blended images (figure 3).
registering the images
we begin the registration process by designating the ir image as the fixed image and webcam image as the moving image. the fixed image is the static reference. our goal is to align the moving image with the fixed image. since intensity-based image registration algorithms require grayscale, we convert the color webcam image to grayscale using rgb2gray()
.
to align the images, we use the image processing toolbox imregister()
function. in addition to a pair of images, intensity-based automatic image registration requires a metric, an optimizer, and a transformation type. we obtain the 'metric'
and 'optimizer'
values using imregconfig()
with the 'multimodal'
option. we then plug the returned values into imregister()
as a starting point for the image registration.
to begin the registration process we use the imregister()
default transform type 'translation'
and view the result with a call to imshowpair()
. the outlines of the subject in the two images are somewhat misaligned (figure 4). the gaps between the images around the head and shoulders indicate issues with both scale and rotation.
note that getting good results from optimization-based image registration frequently involves multiple modifications of optimizer and metric values. note, too, that while imshowpair()
in its default mode works well for the images in our example, it might not work for all image pairs. it is best to explore all the visualization styles in imshowpair()
, such as 'falsecolor'
, 'diff'
, 'blend'
, and 'montage'
, to identify the best one for a specific image pair.
to account for the scale and rotation distortion, we switch the transformation type in imregister()
from 'translation'
to 'similarity'
.
we now have a reasonably accurate registered image in which the eyes are closely aligned (figure 5).
the green and magenta areas are present because the images come from different sources. they do not indicate misregistration.
detecting the eyes and reading the temperature
to detect the eyes, we use the cascade object detector in computer vision toolbox™. this object detector uses the viola-jones algorithm, which detects the eyes using haar-like features and a multistage gentle adaboost classifier. we then draw a bounding box near the eyes to highlight the region of interest on the registered image.
because we have registered the images, we can use the bounding box enclosing the eyes in the webcam image to sample temperature values near the eyes in the infrared image. using this reading we convert the temperature measurement from millikelvin to fahrenheit before displaying it near the eyes on the registered image. we see that the subject does not have a fever (figure 6).
published 2013 - 92121v00