[Image Processing] Research on image registration, image enhancement and image segmentation (Matlab code implementation)

Welcome to this blog

Advantages of bloggers:Blog content should be as thoughtful and logical as possible for the convenience of readers.

Motto:He who travels a hundred miles is half as good as ninety.

The directory of this article is as follows:

Table of Contents

1 Overview

2 Operation results

2.1 Image segmentation

2.2 Image enhancement

2.3 Image registration

3 References

4 Matlab code implementation


1 Overview

The field of image processing involves many important technologies, including image registration, image enhancement and image segmentation. These technologies play an important role in different imaging applications.

Image registration refers to the spatial alignment of multiple images so that they are consistent in geometry, shape and grayscale. Common image registration methods include feature point-based registration and mutual information-based registration. Image registration is widely used in medical imaging, remote sensing imaging and other fields to compare and analyze images taken from different angles or at different times.

Image enhancement is the process of improving image quality and enhancing the visual effects of images. By adjusting the brightness, contrast, sharpening and other parameters of the image, you can enhance the details of the image and improve the visualization of the image. Image enhancement is of great significance in applications such as computer vision, digital photography, and image analysis, such as improving image visibility and reducing noise under low-light conditions.

Image segmentation refers to the process of dividing an image into different regions or objects. Image segmentation can be achieved through methods based on thresholding, edge detection, and region growing. It has wide applications in fields such as target detection, image recognition, and computer-aided diagnosis, and can help extract targets or areas of interest in images.

In summary, image registration, image enhancement and image segmentation are important research directions in the field of image processing. They play an important role in various image applications, helping us better understand, analyze and utilize image information.

2 Running results

2.1 Image Segmentation

2.2 Image Enhancement

2.3 Image Registration

Part of the code:

%% View the images side by side in a montage
imshowpair(Fixed,Moving,'montage');

%% Configure parameters in imregconfig
[optimizer,metric] = imregconfig('Multimodal');

%%Default registration
registered = imregister(Moving,Fixed,'translation',optimizer,metric);
figure;
imshowpair(registered,Fixed);
title('falsecolor');

%% Change visualization in imshowpair
figure;
imshowpair(registered,Fixed,'blend');

%% Change transformType in imregister
registered = imregister(Moving, Fixed,'affine',optimizer,metric);
figure;
imshowpair(registered,Fixed);
title('Intermediate Registration');

%% Final registration
registered = imregister(Moving, Fixed,'Similarity',optimizer,metric);
figure;
imshowpair(registered,Fixed);title('Final Registration');

%% Detect the eyes in the RGB image
eyesDet = vision.CascadeObjectDetector('EyePairSmall');
bbox = step(eyesDet, Moving);
drawBox = vision.ShapeInserter('BorderColor','Black');
image = step(drawBox, registered, int32(bbox));
hold on; rectangle('Position',bbox,'EdgeColor',[1 1 0]);
subsIR = int32(bbox(:,1:2) + bbox(:,3:4)/2);

%% Compute temperature near the eyes
value = mean2(imcrop(registered,bbox));
foreheadTemperature = value/10 - 272; % In Celcius
foreheadTemperature = (foreheadTemperature*9/5) + 32; % Convert to Farenheit

%% Embed temperature on IR image and display
ti = vision.TextInserter('Color',[255 0 0]);
ti.Location = int32(bbox(:,1:2) + bbox(:,3:4)/2);
ti.Text = sprintf('= F', int8(foreheadTemperature));
contAdj = vision.ContrastAdjuster('CustomProductInputDataType',numerictype([],32,8));
imageContrastAdjusted = step(contAdj, Fixed);
textAdded = step(ti, imageContrastAdjusted);
text(320, 180,'98 \circ F ','Color',[1 1 0])

%% View the images side by side in a montage
imshowpair(Fixed,Moving,’montage’);

%% Configure parameters in imregconfig
[optimizer,metric] = imregconfig(‘Multimodal’);

%%Default registration
registered = imregister(Moving,Fixed,’translation’,optimizer,metric);
figure;
imshowpair(registered,Fixed);
title(‘falsecolor’);

%% Change visualization in imshowpair
figure;
imshowpair(registered,Fixed,’blend’);

%% Change transformType in imregister
registered = imregister(Moving, Fixed,’affine’,optimizer,metric);
figure;
imshowpair(registered,Fixed);
title(‘Intermediate Registration’);

%% Final registration
registered = imregister(Moving, Fixed,’Similarity’,optimizer,metric);
figure;
imshowpair(registered,Fixed);title(‘Final Registration’);

%% Detect the eyes in the RGB image
eyesDet = vision.CascadeObjectDetector(‘EyePairSmall’);
bbox = step(eyesDet, Moving);
drawBox = vision.ShapeInserter(‘BorderColor’,’Black’);
image = step(drawBox, registered, int32(bbox));
hold on; rectangle(‘Position’,bbox,’EdgeColor’,[1 1 0]);
subsIR = int32(bbox(:,1:2) + bbox(:,3:4)/2);

%% Compute temperature near the eyes
value = mean2(imcrop(registered,bbox));
foreheadTemperature = value/10 – 272; % In Celcius
foreheadTemperature = (foreheadTemperature*9/5) + 32; % Convert to Farenheit

%% Embed temperature on IR image and display
ti = vision.TextInserter(‘Color’,[255 0 0]);
ti.Location = int32(bbox(:,1:2) + bbox(:,3:4)/2);
ti.Text = sprintf(‘= F’, int8(foreheadTemperature));
contAdj = vision.ContrastAdjuster(‘CustomProductInputDataType’,numerictype([],32,8));
imageContrastAdjusted = step(contAdj, Fixed);
textAdded = step(ti, imageContrastAdjusted);
text(320, 180,’98 \circ F ‘,’Color’,[1 1 0])

3 References

Some of the content in the article is quoted from the Internet. The source will be indicated or cited as a reference. It is inevitable that there will be some unfinished information. If there is anything inappropriate, please feel free to contact us to delete it.

[1] Bian Xianzhang, Fei Haiping, Li Shiqiang. Augmented reality image registration technology based on semantic segmentation [J]. Electronic Technology and Software Engineering, 2018(23):4.

[2] Gu Yu. Self-paced deep learning research on abdominal image segmentation and enhancement[D]. Xi’an University of Electronic Science and Technology, 2020.

[3] Zhou Lu, Zhang Shuxu, Yu Hui, et al. Preprocessing research on PET-CT image registration [J]. Chinese Journal of Medical Physics, 2013. DOI: CNKI: SUN: YXWZ.0.2013-05-013.

4 Matlab code implementation